Skip to content

Commit 77cbc63

Browse files
Remove Python-Pydantic-v1 license format tests (#21619)
1 parent ad6a526 commit 77cbc63

2 files changed

Lines changed: 1 addition & 43 deletions

File tree

modules/openapi-generator/src/main/resources/python-pydantic-v1/pyproject.mustache

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ name = "{{{packageName}}}"
33
version = "{{{packageVersion}}}"
44
description = "{{{appName}}}"
55
authors = ["{{infoName}}{{^infoName}}OpenAPI Generator Community{{/infoName}} <{{infoEmail}}{{^infoEmail}}team@openapitools.org{{/infoEmail}}>"]
6-
license = { text = "{{{licenseInfo}}}{{^licenseInfo}}Unlicense{{/licenseInfo}}" }
6+
license = "{{{licenseInfo}}}{{^licenseInfo}}Unlicense{{/licenseInfo}}"
77
readme = "README.md"
88
repository = "https://{{{gitHost}}}/{{{gitUserId}}}/{{{gitRepoId}}}"
99
keywords = ["OpenAPI", "OpenAPI-Generator", "{{{appName}}}"]

modules/openapi-generator/src/test/java/org/openapitools/codegen/python/PythonPydanticV1ClientCodegenTest.java

Lines changed: 0 additions & 42 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,6 @@
2525
import io.swagger.v3.parser.core.models.ParseOptions;
2626
import io.swagger.v3.parser.util.SchemaTypeUtil;
2727
import org.openapitools.codegen.*;
28-
import org.openapitools.codegen.config.CodegenConfigurator;
2928
import org.openapitools.codegen.languages.PythonPydanticV1ClientCodegen;
3029
import org.openapitools.codegen.languages.features.CXFServerFeatures;
3130
import org.testng.Assert;
@@ -535,45 +534,4 @@ public void testInitFileImportsExports() throws Exception {
535534
assertFileContains(initFilePath, "from openapi_client.models.tag import Tag as Tag");
536535
assertFileContains(initFilePath, "from openapi_client.models.user import User as User");
537536
}
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-
}
579537
}

0 commit comments

Comments
 (0)