|
25 | 25 | import io.swagger.v3.parser.core.models.ParseOptions; |
26 | 26 | import io.swagger.v3.parser.util.SchemaTypeUtil; |
27 | 27 | import org.openapitools.codegen.*; |
28 | | -import org.openapitools.codegen.config.CodegenConfigurator; |
29 | 28 | import org.openapitools.codegen.languages.PythonPydanticV1ClientCodegen; |
30 | 29 | import org.openapitools.codegen.languages.features.CXFServerFeatures; |
31 | 30 | import org.testng.Assert; |
@@ -535,45 +534,4 @@ public void testInitFileImportsExports() throws Exception { |
535 | 534 | assertFileContains(initFilePath, "from openapi_client.models.tag import Tag as Tag"); |
536 | 535 | assertFileContains(initFilePath, "from openapi_client.models.user import User as User"); |
537 | 536 | } |
538 | | - |
539 | | - @Test(description = "Verify pydantic-v1 always uses object notation for license") |
540 | | - public void testLicenseFormatInPyprojectToml() throws IOException { |
541 | | - File output = Files.createTempDirectory("test").toFile().getCanonicalFile(); |
542 | | - output.deleteOnExit(); |
543 | | - |
544 | | - final CodegenConfigurator configurator = new CodegenConfigurator() |
545 | | - .setGeneratorName("python-pydantic-v1") |
546 | | - .setInputSpec("src/test/resources/bugs/issue_21619.yaml") |
547 | | - .setOutputDir(output.getAbsolutePath()) |
548 | | - .addAdditionalProperty("licenseInfo", "MIT"); |
549 | | - |
550 | | - DefaultGenerator generator = new DefaultGenerator(); |
551 | | - List<File> files = generator.opts(configurator.toClientOptInput()).generate(); |
552 | | - files.forEach(File::deleteOnExit); |
553 | | - |
554 | | - TestUtils.assertFileExists(Paths.get(output.getAbsolutePath(), "pyproject.toml")); |
555 | | - // python-pydantic-v1 always uses object notation regardless of poetry1 |
556 | | - TestUtils.assertFileContains(Paths.get(output.getAbsolutePath(), "pyproject.toml"), |
557 | | - "license = { text = \"MIT\" }"); |
558 | | - } |
559 | | - |
560 | | - @Test(description = "Verify pydantic-v1 uses default license when licenseInfo not provided") |
561 | | - public void testDefaultLicenseInPyprojectToml() throws IOException { |
562 | | - File output = Files.createTempDirectory("test").toFile().getCanonicalFile(); |
563 | | - output.deleteOnExit(); |
564 | | - |
565 | | - final CodegenConfigurator configurator = new CodegenConfigurator() |
566 | | - .setGeneratorName("python-pydantic-v1") |
567 | | - .setInputSpec("src/test/resources/bugs/issue_21619.yaml") |
568 | | - .setOutputDir(output.getAbsolutePath()); |
569 | | - |
570 | | - DefaultGenerator generator = new DefaultGenerator(); |
571 | | - List<File> files = generator.opts(configurator.toClientOptInput()).generate(); |
572 | | - files.forEach(File::deleteOnExit); |
573 | | - |
574 | | - TestUtils.assertFileExists(Paths.get(output.getAbsolutePath(), "pyproject.toml")); |
575 | | - // Should use default "Unlicense" |
576 | | - TestUtils.assertFileContains(Paths.get(output.getAbsolutePath(), "pyproject.toml"), |
577 | | - "license = { text = \"Unlicense\" }"); |
578 | | - } |
579 | 537 | } |
0 commit comments