diff --git a/docs/generators/java.md b/docs/generators/java.md index ca9444ebed6..cdacabdafa6 100644 --- a/docs/generators/java.md +++ b/docs/generators/java.md @@ -282,6 +282,13 @@ These options may be applied as additional-properties (cli) or configOptions (pl |Tags|✗|OAS2,OAS3 |ExternalDocs|✗|OAS2,OAS3 +### Operation Feature +| Name | Supported | Defined By | +| ---- | --------- | ---------- | +|Responses_HttpStatusCode|✓|OAS2,OAS3 +|Responses_RangedResponseCodes|✗|OAS2,OAS3 +|Responses_Default|✓|OAS2,OAS3 + ### Parameter Feature | Name | Supported | Defined By | | ---- | --------- | ---------- | diff --git a/docs/generators/jaxrs-jersey.md b/docs/generators/jaxrs-jersey.md index bb52767f45d..761fe53b361 100644 --- a/docs/generators/jaxrs-jersey.md +++ b/docs/generators/jaxrs-jersey.md @@ -265,6 +265,13 @@ These options may be applied as additional-properties (cli) or configOptions (pl |Tags|✗|OAS2,OAS3 |ExternalDocs|✗|OAS2,OAS3 +### Operation Feature +| Name | Supported | Defined By | +| ---- | --------- | ---------- | +|Responses_HttpStatusCode|✓|OAS2,OAS3 +|Responses_RangedResponseCodes|✗|OAS2,OAS3 +|Responses_Default|✓|OAS2,OAS3 + ### Parameter Feature | Name | Supported | Defined By | | ---- | --------- | ---------- | diff --git a/docs/generators/jmeter.md b/docs/generators/jmeter.md index ba4d83d19e4..5dc11232a37 100644 --- a/docs/generators/jmeter.md +++ b/docs/generators/jmeter.md @@ -124,6 +124,13 @@ These options may be applied as additional-properties (cli) or configOptions (pl |Tags|✗|OAS2,OAS3 |ExternalDocs|✗|OAS2,OAS3 +### Operation Feature +| Name | Supported | Defined By | +| ---- | --------- | ---------- | +|Responses_HttpStatusCode|✓|OAS2,OAS3 +|Responses_RangedResponseCodes|✗|OAS2,OAS3 +|Responses_Default|✓|OAS2,OAS3 + ### Parameter Feature | Name | Supported | Defined By | | ---- | --------- | ---------- | diff --git a/docs/generators/kotlin.md b/docs/generators/kotlin.md index 5ac6eb59a6c..2454c2ebbce 100644 --- a/docs/generators/kotlin.md +++ b/docs/generators/kotlin.md @@ -234,6 +234,13 @@ These options may be applied as additional-properties (cli) or configOptions (pl |Tags|✗|OAS2,OAS3 |ExternalDocs|✗|OAS2,OAS3 +### Operation Feature +| Name | Supported | Defined By | +| ---- | --------- | ---------- | +|Responses_HttpStatusCode|✓|OAS2,OAS3 +|Responses_RangedResponseCodes|✗|OAS2,OAS3 +|Responses_Default|✓|OAS2,OAS3 + ### Parameter Feature | Name | Supported | Defined By | | ---- | --------- | ---------- | diff --git a/docs/generators/python.md b/docs/generators/python.md index 830ab89d6b4..39a7ee08229 100644 --- a/docs/generators/python.md +++ b/docs/generators/python.md @@ -193,6 +193,13 @@ These options may be applied as additional-properties (cli) or configOptions (pl |Tags|✓|OAS2,OAS3 |ExternalDocs|✗|OAS2,OAS3 +### Operation Feature +| Name | Supported | Defined By | +| ---- | --------- | ---------- | +|Responses_HttpStatusCode|✓|OAS2,OAS3 +|Responses_RangedResponseCodes|✓|OAS2,OAS3 +|Responses_Default|✓|OAS2,OAS3 + ### Parameter Feature | Name | Supported | Defined By | | ---- | --------- | ---------- | diff --git a/modules/openapi-json-schema-generator-core/src/main/java/org/openapijsonschematools/codegen/meta/FeatureSet.java b/modules/openapi-json-schema-generator-core/src/main/java/org/openapijsonschematools/codegen/meta/FeatureSet.java index e5b33bc1b03..16829b176be 100644 --- a/modules/openapi-json-schema-generator-core/src/main/java/org/openapijsonschematools/codegen/meta/FeatureSet.java +++ b/modules/openapi-json-schema-generator-core/src/main/java/org/openapijsonschematools/codegen/meta/FeatureSet.java @@ -21,6 +21,7 @@ import org.openapijsonschematools.codegen.meta.features.DataTypeFeature; import org.openapijsonschematools.codegen.meta.features.DocumentationFeature; import org.openapijsonschematools.codegen.meta.features.GlobalFeature; +import org.openapijsonschematools.codegen.meta.features.OperationFeature; import org.openapijsonschematools.codegen.meta.features.ParameterFeature; import org.openapijsonschematools.codegen.meta.features.SchemaFeature; import org.openapijsonschematools.codegen.meta.features.SecurityFeature; @@ -46,6 +47,7 @@ public class FeatureSet { private EnumSet schemaFeatures; private EnumSet parameterFeatures; private EnumSet securityFeatures; + private EnumSet operationFeatures; private EnumSet wireFormatFeatures; private FeatureSet(Builder builder) { @@ -59,6 +61,7 @@ private FeatureSet(Builder builder) { parameterFeatures = builder.parameterFeatures; securityFeatures = builder.securityFeatures; wireFormatFeatures = builder.wireFormatFeatures; + operationFeatures = builder.operationFeatures; } } @@ -81,10 +84,19 @@ public static Builder newBuilder(FeatureSet copy) { builder.parameterFeatures = copy.getParameterFeatures(); builder.securityFeatures = copy.getSecurityFeatures(); builder.wireFormatFeatures = copy.getWireFormatFeatures(); + builder.operationFeatures = copy.getOperationFeatures(); } return builder; } + public EnumSet getOperationFeatures() { + if (operationFeatures != null) { + return EnumSet.copyOf(operationFeatures); + } else { + return EnumSet.noneOf(OperationFeature.class); + } + } + /** * Returns the set of client modification features supported by the generator. * @@ -354,6 +366,22 @@ public List flatten() { states.add(state); }); + EnumSet.allOf(OperationFeature.class).forEach(feat -> { + FeatureSetFlattened state = new FeatureSetFlattened(); + state.featureCategory = OperationFeature.class.getSimpleName(); + state.featureName = feat.name(); + state.isSupported = this.operationFeatures.contains(feat); + + try { + for (Annotation an : OperationFeature.class.getField(feat.name()).getAnnotations()) { + state.source.add(AnnotationType.fromAnnotation(an.annotationType())); + } + } catch (NoSuchFieldException e) { + e.printStackTrace(); + } + + states.add(state); + }); EnumSet.allOf(WireFormatFeature.class).forEach(feat -> { FeatureSetFlattened state = new FeatureSetFlattened(); state.featureCategory = WireFormatFeature.class.getSimpleName(); @@ -389,6 +417,8 @@ public static final class Builder { private EnumSet securityFeatures; private EnumSet wireFormatFeatures; + private EnumSet operationFeatures; + private Builder() { this.clientModificationFeatures = EnumSet.noneOf(ClientModificationFeature.class); this.dataTypeFeatures = EnumSet.noneOf(DataTypeFeature.class); @@ -399,6 +429,26 @@ private Builder() { this.globalFeatures = EnumSet.noneOf(GlobalFeature.class); this.componentsFeatures = EnumSet.noneOf(ComponentsFeature.class); this.wireFormatFeatures = EnumSet.noneOf(WireFormatFeature.class); + this.operationFeatures = EnumSet.noneOf(OperationFeature.class); + } + + public Builder operationFeatures(EnumSet operationFeatures) { + if (operationFeatures != null) { + this.operationFeatures = operationFeatures; + } else { + this.operationFeatures = EnumSet.noneOf(OperationFeature.class); + } + return this; + } + + public Builder includeOperationFeatures(OperationFeature... operationFeature) { + this.operationFeatures.addAll(Arrays.stream(operationFeature).collect(Collectors.toList())); + return this; + } + + public Builder excludeOperationFeatures(OperationFeature... operationFeature) { + this.operationFeatures.removeAll(Arrays.stream(operationFeature).collect(Collectors.toList())); + return this; } /** diff --git a/modules/openapi-json-schema-generator-core/src/main/java/org/openapijsonschematools/codegen/meta/features/OperationFeature.java b/modules/openapi-json-schema-generator-core/src/main/java/org/openapijsonschematools/codegen/meta/features/OperationFeature.java new file mode 100644 index 00000000000..bb91ddc2418 --- /dev/null +++ b/modules/openapi-json-schema-generator-core/src/main/java/org/openapijsonschematools/codegen/meta/features/OperationFeature.java @@ -0,0 +1,37 @@ +/* + * Copyright 2019 OpenAPI-Generator Contributors (https://openapi-generator.tech) + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package org.openapijsonschematools.codegen.meta.features; + +import org.openapijsonschematools.codegen.meta.features.annotations.OAS2; +import org.openapijsonschematools.codegen.meta.features.annotations.OAS3; + +/** + * Defines Operation features supported in the generated code. + */ +public enum OperationFeature { + /** + * Supports header-based basic http auth. + */ + @OAS2 @OAS3 + Responses_HttpStatusCode, + + @OAS2 @OAS3 + Responses_RangedResponseCodes, + + @OAS2 @OAS3 + Responses_Default, +} diff --git a/modules/openapi-json-schema-generator/src/main/java/org/openapijsonschematools/codegen/DefaultCodegen.java b/modules/openapi-json-schema-generator/src/main/java/org/openapijsonschematools/codegen/DefaultCodegen.java index 13bd49b9cf2..7c8157189a0 100644 --- a/modules/openapi-json-schema-generator/src/main/java/org/openapijsonschematools/codegen/DefaultCodegen.java +++ b/modules/openapi-json-schema-generator/src/main/java/org/openapijsonschematools/codegen/DefaultCodegen.java @@ -38,6 +38,7 @@ import org.openapijsonschematools.codegen.meta.features.DataTypeFeature; import org.openapijsonschematools.codegen.meta.features.DocumentationFeature; import org.openapijsonschematools.codegen.meta.features.GlobalFeature; +import org.openapijsonschematools.codegen.meta.features.OperationFeature; import org.openapijsonschematools.codegen.meta.features.ParameterFeature; import org.openapijsonschematools.codegen.meta.features.SchemaFeature; import org.openapijsonschematools.codegen.meta.features.SecurityFeature; @@ -160,6 +161,9 @@ public class DefaultCodegen implements CodegenConfig { ParameterFeature.In_Path, ParameterFeature.In_Query, ParameterFeature.In_Header, ParameterFeature.In_Cookie ) + .includeOperationFeatures( + OperationFeature.Responses_Default, OperationFeature.Responses_HttpStatusCode + ) .includeSecurityFeatures( SecurityFeature.ApiKey, SecurityFeature.HTTP_Basic, SecurityFeature.HTTP_Bearer, SecurityFeature.OAuth2_Implicit, SecurityFeature.OAuth2_Password, @@ -3379,7 +3383,8 @@ private void updateComponentsFilepath(String[] pathPieces) { } } else if (pathPieces[2].equals("responses")) { // #/components/responses/SuccessWithJsonApiResponse/headers - pathPieces[3] = toResponseModuleName(pathPieces[3], null); + String responseJsonPath = "#/components/responses/" + pathPieces[3]; + pathPieces[3] = toResponseModuleName(pathPieces[3], responseJsonPath); if (pathPieces.length < 6) { return; @@ -3407,6 +3412,7 @@ private void updatePathsFilepath(String[] pathPieces) { return; } // #/paths/somePath + String path = pathPieces[2]; pathPieces[2] = toPathFilename(ModelUtils.decodeSlashes(pathPieces[2]), null); if (pathPieces.length < 4) { return; @@ -3434,8 +3440,8 @@ private void updatePathsFilepath(String[] pathPieces) { pathPieces[5] = toSecurityRequirementObjectFilename(pathPieces[5], null); } else if (pathPieces[4].equals("responses")) { // #/paths/user_login/get/responses/200 -> 200 -> response_200 -> length 6 - pathPieces[5] = toResponseModuleName(pathPieces[5], null); - + String responseJsonPath = "#/paths/" + path + "/" + pathPieces[3] + "/responses/" + pathPieces[5]; + pathPieces[5] = toResponseModuleName(pathPieces[5], responseJsonPath); if (pathPieces.length < 8) { return; } diff --git a/modules/openapi-json-schema-generator/src/main/java/org/openapijsonschematools/codegen/DefaultGenerator.java b/modules/openapi-json-schema-generator/src/main/java/org/openapijsonschematools/codegen/DefaultGenerator.java index a3a2181bf71..c5b1fce27dd 100644 --- a/modules/openapi-json-schema-generator/src/main/java/org/openapijsonschematools/codegen/DefaultGenerator.java +++ b/modules/openapi-json-schema-generator/src/main/java/org/openapijsonschematools/codegen/DefaultGenerator.java @@ -451,6 +451,9 @@ private void generatePathItem(List files, CodegenKey pathKey, CodegenPathI } if (pathItem.operations != null) { + String testInitFilename = filenameFromRoot(Arrays.asList("test", "test_paths", "test_" + pathKey.snakeCase, "__init__.py")); + generateFile(new HashMap<>(), "__init__.hbs", testInitFilename, files, true, CodegenConstants.API_TESTS); + for (Map.Entry entry: pathItem.operations.entrySet()) { CodegenKey httpMethod = entry.getKey(); CodegenOperation operation = entry.getValue(); @@ -533,9 +536,6 @@ private void generatePathItem(List files, CodegenKey pathKey, CodegenPathI endpointTestMap.put("packageName", config.packageName()); outputFilename = filenameFromRoot(Arrays.asList("test", "test_paths", "test_" + pathKey.snakeCase, "test_" + httpMethod.original + ".py")); generateFile(endpointTestMap, templateFile, outputFilename, files, true, CodegenConstants.API_TESTS); - - outputFilename = filenameFromRoot(Arrays.asList("test", "test_paths", "test_" + pathKey.snakeCase, "__init__.py")); - generateFile(endpointTestMap, templateFile, outputFilename, files, true, CodegenConstants.API_TESTS); } } } diff --git a/modules/openapi-json-schema-generator/src/main/java/org/openapijsonschematools/codegen/languages/PythonClientCodegen.java b/modules/openapi-json-schema-generator/src/main/java/org/openapijsonschematools/codegen/languages/PythonClientCodegen.java index 02ff4f48dc4..df090324b85 100644 --- a/modules/openapi-json-schema-generator/src/main/java/org/openapijsonschematools/codegen/languages/PythonClientCodegen.java +++ b/modules/openapi-json-schema-generator/src/main/java/org/openapijsonschematools/codegen/languages/PythonClientCodegen.java @@ -26,6 +26,7 @@ import org.openapijsonschematools.codegen.CliOption; import org.openapijsonschematools.codegen.CodegenConstants; import org.openapijsonschematools.codegen.meta.features.ComponentsFeature; +import org.openapijsonschematools.codegen.meta.features.OperationFeature; import org.openapijsonschematools.codegen.meta.features.SchemaFeature; import org.openapijsonschematools.codegen.model.CodegenDiscriminator; import org.openapijsonschematools.codegen.model.CodegenPatternInfo; @@ -226,6 +227,9 @@ public PythonClientCodegen() { ParameterFeature.Schema, ParameterFeature.Content ) + .includeOperationFeatures( + OperationFeature.Responses_RangedResponseCodes + ) .excludeParameterFeatures( ParameterFeature.In_Cookie ) @@ -1747,13 +1751,15 @@ public String toApiDocFilename(String name) { @Override public String toResponseModuleName(String componentName, String jsonPath) { - String suffix = toModuleFilename(componentName, null); + if (!jsonPath.startsWith("#/components/responses/")) { + return "response_" + componentName.toLowerCase(Locale.ROOT); + } + String suffix = toModuleFilename(componentName, jsonPath); String spacer = ""; if (!suffix.startsWith("_")) { spacer = "_"; } return "response" + spacer + suffix; - } @Override @@ -1911,14 +1917,11 @@ public String getCamelCaseParameter(String name) { } public String getCamelCaseResponse(String name) { - try { - Integer.parseInt(name); - // for parameters in path, or an endpoint + if (name.matches("^\\d[X\\d]{2}$")) { + // 200 or 2XX return "ResponseFor" + name; - } catch (NumberFormatException nfe) { - // for header parameters in responses - return toModelName(name, null); } + return toModelName(name, null); } @Override diff --git a/modules/openapi-json-schema-generator/src/main/resources/python/components/responses/response.hbs b/modules/openapi-json-schema-generator/src/main/resources/python/components/responses/response.hbs index 26e4ec103c2..c12d3b39516 100644 --- a/modules/openapi-json-schema-generator/src/main/resources/python/components/responses/response.hbs +++ b/modules/openapi-json-schema-generator/src/main/resources/python/components/responses/response.hbs @@ -69,17 +69,21 @@ class _ApiResponse(api_client.ApiResponse): body: schemas.Unset = schemas.unset {{else}} {{#if hasContentSchema}} + {{#gt content.size 1}} body: typing.Union[ - {{#each content}} - {{#if this.schema}} - {{#with this.schema}} + {{#each content}} + {{#if this.schema}} + {{#with this.schema}} {{../@key.snakeCase}}_{{jsonPathPiece.snakeCase}}.{{jsonPathPiece.camelCase}}, - {{/with}} - {{else}} + {{/with}} + {{else}} schemas.Unset, - {{/if}} - {{/each}} + {{/if}} + {{/each}} ] + {{else}} + body: {{#each content}}{{#if this.schema}}{{#with this.schema}}{{../@key.snakeCase}}_{{jsonPathPiece.snakeCase}}.{{jsonPathPiece.camelCase}}{{/with}}{{else}}schemas.Unset{{/if}}{{/each}} + {{/gt}} {{else}} body: schemas.Unset = schemas.unset {{/if}} diff --git a/modules/openapi-json-schema-generator/src/main/resources/python/paths/path/verb/_helper_operation_test_response_content.hbs b/modules/openapi-json-schema-generator/src/main/resources/python/paths/path/verb/_helper_operation_test_response_content.hbs index 1c178fdcb12..cdb2886c9ec 100644 --- a/modules/openapi-json-schema-generator/src/main/resources/python/paths/path/verb/_helper_operation_test_response_content.hbs +++ b/modules/openapi-json-schema-generator/src/main/resources/python/paths/path/verb/_helper_operation_test_response_content.hbs @@ -1,7 +1,7 @@ {{#if content}} {{#each content}} {{#if schema}} -response_body_schema = {{httpMethod.original}}.response_{{../@key}}.{{responseClassName}}.content["{{{@key.original}}}"].schema +response_body_schema = {{httpMethod.original}}.{{responseModuleName}}.{{responseClassName}}.content["{{{@key.original}}}"].schema {{/if}} {{#if this.testCases}} {{#each testCases}} diff --git a/modules/openapi-json-schema-generator/src/main/resources/python/paths/path/verb/operation.hbs b/modules/openapi-json-schema-generator/src/main/resources/python/paths/path/verb/operation.hbs index 6e3a207c01b..31f316b1515 100644 --- a/modules/openapi-json-schema-generator/src/main/resources/python/paths/path/verb/operation.hbs +++ b/modules/openapi-json-schema-generator/src/main/resources/python/paths/path/verb/operation.hbs @@ -45,7 +45,7 @@ from .responses import response_{{@key}} {{else}} from .responses import ( {{#each responses}} - response_{{@key}}, + {{jsonPathPiece.snakeCase}}, {{/each}} ) {{/eq}} @@ -124,18 +124,33 @@ _security: typing.List[security_schemes.SecurityRequirementObject] = [ default_response = response_default.{{jsonPathPiece.camelCase}} {{/with}} {{/if}} - {{#if nonDefaultResponses}} + {{#if statusCodeResponses}} __StatusCodeToResponse = typing_extensions.TypedDict( '__StatusCodeToResponse', { - {{#each nonDefaultResponses}} - '{{@key}}': typing.Type[response_{{@key}}.{{jsonPathPiece.camelCase}}], + {{#each statusCodeResponses}} + '{{@key}}': typing.Type[{{jsonPathPiece.snakeCase}}.{{jsonPathPiece.camelCase}}], {{/each}} } ) _status_code_to_response: __StatusCodeToResponse = { - {{#each nonDefaultResponses}} - '{{@key}}': response_{{@key}}.{{jsonPathPiece.camelCase}}, + {{#each statusCodeResponses}} + '{{@key}}': {{jsonPathPiece.snakeCase}}.{{jsonPathPiece.camelCase}}, + {{/each}} +} + {{/if}} + {{#if wildcardCodeResponses}} +__RangedStatusCodeToResponse = typing_extensions.TypedDict( + '__RangedStatusCodeToResponse', + { + {{#each wildcardCodeResponses}} + '{{@key}}': typing.Type[{{jsonPathPiece.snakeCase}}.{{jsonPathPiece.camelCase}}], + {{/each}} + } +) +_ranged_status_code_to_response: __RangedStatusCodeToResponse = { + {{#each wildcardCodeResponses}} + '{{@key}}': {{jsonPathPiece.snakeCase}}.{{jsonPathPiece.camelCase}}, {{/each}} } {{/if}} @@ -344,25 +359,50 @@ class BaseApi(api_client.Api): else: {{#if nonDefaultResponses}} status = str(response.status) + {{#if wildcardCodeResponses}} + ranged_response_status_code = status[0] + {{/if}} + {{#if statusCodeResponses}} if status in _status_code_to_response: status: typing_extensions.Literal[ -{{#each nonDefaultResponses}} + {{#each statusCodeResponses}} '{{@key}}', -{{/each}} + {{/each}} + ] + api_response = _status_code_to_response[status].deserialize( + response, self.api_client.schema_configuration) + {{#if wildcardCodeResponses}} + elif ranged_response_status_code in _ranged_status_code_to_response: + ranged_response_status_code: typing_extensions.Literal[ + {{#each wildcardCodeResponses}} + '{{@key}}', + {{/each}} ] - api_response = _status_code_to_response[status].deserialize(response, self.api_client.schema_configuration) + api_response = _ranged_status_code_to_response[ranged_response_status_code].deserialize( + response, self.api_client.schema_configuration) + {{/if}} + {{else}} + if ranged_response_status_code in _ranged_status_code_to_response: + ranged_response_status_code: typing_extensions.Literal[ + {{#each wildcardCodeResponses}} + '{{@key}}', + {{/each}} + ] + api_response = _ranged_status_code_to_response[ranged_response_status_code].deserialize( + response, self.api_client.schema_configuration) + {{/if}} else: - {{#if defaultResponse}} + {{#if defaultResponse}} api_response = default_response.deserialize(response, self.api_client.schema_configuration) - {{else}} + {{else}} api_response = api_client.ApiResponseWithoutDeserialization(response=response) - {{/if}} + {{/if}} {{else}} - {{#if defaultResponse}} + {{#if defaultResponse}} api_response = default_response.deserialize(response, self.api_client.schema_configuration) - {{else}} + {{else}} api_response = api_client.ApiResponseWithoutDeserialization(response=response) - {{/if}} + {{/if}} {{/if}} if not 200 <= response.status <= 299: diff --git a/modules/openapi-json-schema-generator/src/main/resources/python/paths/path/verb/operation_test.hbs b/modules/openapi-json-schema-generator/src/main/resources/python/paths/path/verb/operation_test.hbs index da25f5e096e..f86e12aabf2 100644 --- a/modules/openapi-json-schema-generator/src/main/resources/python/paths/path/verb/operation_test.hbs +++ b/modules/openapi-json-schema-generator/src/main/resources/python/paths/path/verb/operation_test.hbs @@ -28,18 +28,46 @@ class Test{{httpMethod.camelCase}}(ApiTestMixin, unittest.TestCase): used_api_client = api_client.ApiClient(configuration=api_config, schema_config=schema_config) api = {{httpMethod.original}}.ApiFor{{httpMethod.camelCase}}(api_client=used_api_client) # noqa: E501 -{{#each responses}} - {{#if @first}} - response_status = {{#eq @key "default"}}0{{else}}{{@key}}{{/eq}} - {{#if refInfo}} - {{#with getDeepestRef}} - {{> paths/path/verb/_helper_operation_test_response_content responseClassName=../jsonPathPiece.camelCase }} - {{/with}} - {{else}} - {{> paths/path/verb/_helper_operation_test_response_content responseClassName=jsonPathPiece.camelCase }} +{{#if statusCodeResponses}} + {{#each statusCodeResponses}} + {{#if @first}} + response_status = {{@key}} + {{#if refInfo}} + {{#with getDeepestRef}} + {{> paths/path/verb/_helper_operation_test_response_content responseModuleName=../jsonPathPiece.snakeCase responseClassName=../jsonPathPiece.camelCase }} + {{/with}} + {{else}} + {{> paths/path/verb/_helper_operation_test_response_content responseModuleName=jsonPathPiece.snakeCase responseClassName=jsonPathPiece.camelCase }} + {{/if}} {{/if}} + {{/each}} +{{else}} + {{#if wildcardCodeResponses}} + {{#each wildcardCodeResponses}} + {{#if @first}} + response_status = {{@key}}99 + {{#if refInfo}} + {{#with getDeepestRef}} + {{> paths/path/verb/_helper_operation_test_response_content responseModuleName=../jsonPathPiece.snakeCase responseClassName=../jsonPathPiece.camelCase }} + {{/with}} + {{else}} + {{> paths/path/verb/_helper_operation_test_response_content responseModuleName=jsonPathPiece.snakeCase responseClassName=jsonPathPiece.camelCase }} + {{/if}} + {{/if}} + {{/each}} + {{else}} + {{#with defaultResponse}} + response_status = 200 + {{#if refInfo}} + {{#with getDeepestRef}} + {{> paths/path/verb/_helper_operation_test_response_content responseModuleName=../jsonPathPiece.snakeCase responseClassName=../jsonPathPiece.camelCase }} + {{/with}} + {{else}} + {{> paths/path/verb/_helper_operation_test_response_content responseModuleName=jsonPathPiece.snakeCase responseClassName=jsonPathPiece.camelCase }} + {{/if}} + {{/with}} {{/if}} -{{/each}} +{{/if}} {{#if requestBody}} {{#with requestBody}} {{#if required}} diff --git a/modules/openapi-json-schema-generator/src/test/java/org/openapijsonschematools/codegen/DefaultGeneratorTest.java b/modules/openapi-json-schema-generator/src/test/java/org/openapijsonschematools/codegen/DefaultGeneratorTest.java index 23a4895e9e4..04544cf82b4 100644 --- a/modules/openapi-json-schema-generator/src/test/java/org/openapijsonschematools/codegen/DefaultGeneratorTest.java +++ b/modules/openapi-json-schema-generator/src/test/java/org/openapijsonschematools/codegen/DefaultGeneratorTest.java @@ -204,7 +204,7 @@ public void dryRunWithApisOnly() throws IOException { List files = generator.opts(clientOptInput).generate(); - Assert.assertEquals(files.size(), 1); + Assert.assertEquals(files.size(), 2); TestUtils.ensureContainsFile(files, output, "src/main/java/org/openapijsonschematools/client/api/tags/PingApi.java"); } finally { output.delete(); diff --git a/modules/openapi-json-schema-generator/src/test/resources/3_0/python/petstore_customized.yaml b/modules/openapi-json-schema-generator/src/test/resources/3_0/python/petstore_customized.yaml index f2269cc29d3..0796bbdd41a 100644 --- a/modules/openapi-json-schema-generator/src/test/resources/3_0/python/petstore_customized.yaml +++ b/modules/openapi-json-schema-generator/src/test/resources/3_0/python/petstore_customized.yaml @@ -1644,6 +1644,43 @@ paths: content: application/json: schema: {} + /fake/wildCardResponses: + get: + operationId: wildCardResponses + summary: operation with wildcard responses + tags: + - fake + responses: + 200: + description: success + content: + application/json: + schema: {} + 1XX: + description: 1XX response + content: + application/json: + schema: {} + 2XX: + description: 2XX response + content: + application/json: + schema: {} + 3XX: + description: 3XX response + content: + application/json: + schema: {} + 4XX: + description: 4XX response + content: + application/json: + schema: {} + 5XX: + description: 5XX response + content: + application/json: + schema: {} servers: - url: 'http://{server}.swagger.io:{port}/v2' description: petstore server diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_additionalproperties_allows_a_schema_which_should_validate_request_body/post/operation.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_additionalproperties_allows_a_schema_which_should_validate_request_body/post/operation.py index 8d18a7dcf31..ba44a2b5fab 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_additionalproperties_allows_a_schema_which_should_validate_request_body/post/operation.py +++ b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_additionalproperties_allows_a_schema_which_should_validate_request_body/post/operation.py @@ -164,7 +164,8 @@ class instances status: typing_extensions.Literal[ '200', ] - api_response = _status_code_to_response[status].deserialize(response, self.api_client.schema_configuration) + api_response = _status_code_to_response[status].deserialize( + response, self.api_client.schema_configuration) else: api_response = api_client.ApiResponseWithoutDeserialization(response=response) diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_additionalproperties_are_allowed_by_default_request_body/post/operation.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_additionalproperties_are_allowed_by_default_request_body/post/operation.py index a390794ed8a..437c59919d6 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_additionalproperties_are_allowed_by_default_request_body/post/operation.py +++ b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_additionalproperties_are_allowed_by_default_request_body/post/operation.py @@ -234,7 +234,8 @@ class instances status: typing_extensions.Literal[ '200', ] - api_response = _status_code_to_response[status].deserialize(response, self.api_client.schema_configuration) + api_response = _status_code_to_response[status].deserialize( + response, self.api_client.schema_configuration) else: api_response = api_client.ApiResponseWithoutDeserialization(response=response) diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_additionalproperties_can_exist_by_itself_request_body/post/operation.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_additionalproperties_can_exist_by_itself_request_body/post/operation.py index 41aa4ac46c6..90237cc968a 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_additionalproperties_can_exist_by_itself_request_body/post/operation.py +++ b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_additionalproperties_can_exist_by_itself_request_body/post/operation.py @@ -164,7 +164,8 @@ class instances status: typing_extensions.Literal[ '200', ] - api_response = _status_code_to_response[status].deserialize(response, self.api_client.schema_configuration) + api_response = _status_code_to_response[status].deserialize( + response, self.api_client.schema_configuration) else: api_response = api_client.ApiResponseWithoutDeserialization(response=response) diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_additionalproperties_should_not_look_in_applicators_request_body/post/operation.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_additionalproperties_should_not_look_in_applicators_request_body/post/operation.py index e71abed3af4..ea0cb365ca0 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_additionalproperties_should_not_look_in_applicators_request_body/post/operation.py +++ b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_additionalproperties_should_not_look_in_applicators_request_body/post/operation.py @@ -234,7 +234,8 @@ class instances status: typing_extensions.Literal[ '200', ] - api_response = _status_code_to_response[status].deserialize(response, self.api_client.schema_configuration) + api_response = _status_code_to_response[status].deserialize( + response, self.api_client.schema_configuration) else: api_response = api_client.ApiResponseWithoutDeserialization(response=response) diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_allof_combined_with_anyof_oneof_request_body/post/operation.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_allof_combined_with_anyof_oneof_request_body/post/operation.py index a52ecf19c53..b3f33ee8a78 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_allof_combined_with_anyof_oneof_request_body/post/operation.py +++ b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_allof_combined_with_anyof_oneof_request_body/post/operation.py @@ -234,7 +234,8 @@ class instances status: typing_extensions.Literal[ '200', ] - api_response = _status_code_to_response[status].deserialize(response, self.api_client.schema_configuration) + api_response = _status_code_to_response[status].deserialize( + response, self.api_client.schema_configuration) else: api_response = api_client.ApiResponseWithoutDeserialization(response=response) diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_allof_request_body/post/operation.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_allof_request_body/post/operation.py index 9baeb37f166..bac49ecd019 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_allof_request_body/post/operation.py +++ b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_allof_request_body/post/operation.py @@ -234,7 +234,8 @@ class instances status: typing_extensions.Literal[ '200', ] - api_response = _status_code_to_response[status].deserialize(response, self.api_client.schema_configuration) + api_response = _status_code_to_response[status].deserialize( + response, self.api_client.schema_configuration) else: api_response = api_client.ApiResponseWithoutDeserialization(response=response) diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_allof_simple_types_request_body/post/operation.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_allof_simple_types_request_body/post/operation.py index f22ae698846..d766dbce9a2 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_allof_simple_types_request_body/post/operation.py +++ b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_allof_simple_types_request_body/post/operation.py @@ -234,7 +234,8 @@ class instances status: typing_extensions.Literal[ '200', ] - api_response = _status_code_to_response[status].deserialize(response, self.api_client.schema_configuration) + api_response = _status_code_to_response[status].deserialize( + response, self.api_client.schema_configuration) else: api_response = api_client.ApiResponseWithoutDeserialization(response=response) diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_allof_with_base_schema_request_body/post/operation.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_allof_with_base_schema_request_body/post/operation.py index 3a49b3f468b..56e95e425bb 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_allof_with_base_schema_request_body/post/operation.py +++ b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_allof_with_base_schema_request_body/post/operation.py @@ -234,7 +234,8 @@ class instances status: typing_extensions.Literal[ '200', ] - api_response = _status_code_to_response[status].deserialize(response, self.api_client.schema_configuration) + api_response = _status_code_to_response[status].deserialize( + response, self.api_client.schema_configuration) else: api_response = api_client.ApiResponseWithoutDeserialization(response=response) diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_allof_with_one_empty_schema_request_body/post/operation.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_allof_with_one_empty_schema_request_body/post/operation.py index 30b5ead17da..09580748492 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_allof_with_one_empty_schema_request_body/post/operation.py +++ b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_allof_with_one_empty_schema_request_body/post/operation.py @@ -234,7 +234,8 @@ class instances status: typing_extensions.Literal[ '200', ] - api_response = _status_code_to_response[status].deserialize(response, self.api_client.schema_configuration) + api_response = _status_code_to_response[status].deserialize( + response, self.api_client.schema_configuration) else: api_response = api_client.ApiResponseWithoutDeserialization(response=response) diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_allof_with_the_first_empty_schema_request_body/post/operation.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_allof_with_the_first_empty_schema_request_body/post/operation.py index e6c7c1c05b4..8ee608f3316 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_allof_with_the_first_empty_schema_request_body/post/operation.py +++ b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_allof_with_the_first_empty_schema_request_body/post/operation.py @@ -234,7 +234,8 @@ class instances status: typing_extensions.Literal[ '200', ] - api_response = _status_code_to_response[status].deserialize(response, self.api_client.schema_configuration) + api_response = _status_code_to_response[status].deserialize( + response, self.api_client.schema_configuration) else: api_response = api_client.ApiResponseWithoutDeserialization(response=response) diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_allof_with_the_last_empty_schema_request_body/post/operation.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_allof_with_the_last_empty_schema_request_body/post/operation.py index edef21eb9ff..a0c4000a45f 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_allof_with_the_last_empty_schema_request_body/post/operation.py +++ b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_allof_with_the_last_empty_schema_request_body/post/operation.py @@ -234,7 +234,8 @@ class instances status: typing_extensions.Literal[ '200', ] - api_response = _status_code_to_response[status].deserialize(response, self.api_client.schema_configuration) + api_response = _status_code_to_response[status].deserialize( + response, self.api_client.schema_configuration) else: api_response = api_client.ApiResponseWithoutDeserialization(response=response) diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_allof_with_two_empty_schemas_request_body/post/operation.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_allof_with_two_empty_schemas_request_body/post/operation.py index 747d713346d..e769ed26a79 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_allof_with_two_empty_schemas_request_body/post/operation.py +++ b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_allof_with_two_empty_schemas_request_body/post/operation.py @@ -234,7 +234,8 @@ class instances status: typing_extensions.Literal[ '200', ] - api_response = _status_code_to_response[status].deserialize(response, self.api_client.schema_configuration) + api_response = _status_code_to_response[status].deserialize( + response, self.api_client.schema_configuration) else: api_response = api_client.ApiResponseWithoutDeserialization(response=response) diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_anyof_complex_types_request_body/post/operation.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_anyof_complex_types_request_body/post/operation.py index df163a58d31..34a2d64be49 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_anyof_complex_types_request_body/post/operation.py +++ b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_anyof_complex_types_request_body/post/operation.py @@ -234,7 +234,8 @@ class instances status: typing_extensions.Literal[ '200', ] - api_response = _status_code_to_response[status].deserialize(response, self.api_client.schema_configuration) + api_response = _status_code_to_response[status].deserialize( + response, self.api_client.schema_configuration) else: api_response = api_client.ApiResponseWithoutDeserialization(response=response) diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_anyof_request_body/post/operation.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_anyof_request_body/post/operation.py index 7d1a71b9b2b..cbfe4799f25 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_anyof_request_body/post/operation.py +++ b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_anyof_request_body/post/operation.py @@ -234,7 +234,8 @@ class instances status: typing_extensions.Literal[ '200', ] - api_response = _status_code_to_response[status].deserialize(response, self.api_client.schema_configuration) + api_response = _status_code_to_response[status].deserialize( + response, self.api_client.schema_configuration) else: api_response = api_client.ApiResponseWithoutDeserialization(response=response) diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_anyof_with_base_schema_request_body/post/operation.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_anyof_with_base_schema_request_body/post/operation.py index 2795297276e..7d14e516d48 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_anyof_with_base_schema_request_body/post/operation.py +++ b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_anyof_with_base_schema_request_body/post/operation.py @@ -159,7 +159,8 @@ class instances status: typing_extensions.Literal[ '200', ] - api_response = _status_code_to_response[status].deserialize(response, self.api_client.schema_configuration) + api_response = _status_code_to_response[status].deserialize( + response, self.api_client.schema_configuration) else: api_response = api_client.ApiResponseWithoutDeserialization(response=response) diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_anyof_with_one_empty_schema_request_body/post/operation.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_anyof_with_one_empty_schema_request_body/post/operation.py index d2cf3ed54eb..54828aa1402 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_anyof_with_one_empty_schema_request_body/post/operation.py +++ b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_anyof_with_one_empty_schema_request_body/post/operation.py @@ -234,7 +234,8 @@ class instances status: typing_extensions.Literal[ '200', ] - api_response = _status_code_to_response[status].deserialize(response, self.api_client.schema_configuration) + api_response = _status_code_to_response[status].deserialize( + response, self.api_client.schema_configuration) else: api_response = api_client.ApiResponseWithoutDeserialization(response=response) diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_array_type_matches_arrays_request_body/post/operation.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_array_type_matches_arrays_request_body/post/operation.py index bc46d716d65..2bd10c10437 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_array_type_matches_arrays_request_body/post/operation.py +++ b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_array_type_matches_arrays_request_body/post/operation.py @@ -164,7 +164,8 @@ class instances status: typing_extensions.Literal[ '200', ] - api_response = _status_code_to_response[status].deserialize(response, self.api_client.schema_configuration) + api_response = _status_code_to_response[status].deserialize( + response, self.api_client.schema_configuration) else: api_response = api_client.ApiResponseWithoutDeserialization(response=response) diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_boolean_type_matches_booleans_request_body/post/operation.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_boolean_type_matches_booleans_request_body/post/operation.py index ff8a133f53f..845683fbddb 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_boolean_type_matches_booleans_request_body/post/operation.py +++ b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_boolean_type_matches_booleans_request_body/post/operation.py @@ -159,7 +159,8 @@ class instances status: typing_extensions.Literal[ '200', ] - api_response = _status_code_to_response[status].deserialize(response, self.api_client.schema_configuration) + api_response = _status_code_to_response[status].deserialize( + response, self.api_client.schema_configuration) else: api_response = api_client.ApiResponseWithoutDeserialization(response=response) diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_by_int_request_body/post/operation.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_by_int_request_body/post/operation.py index 3702225eea5..f476f57bfc0 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_by_int_request_body/post/operation.py +++ b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_by_int_request_body/post/operation.py @@ -234,7 +234,8 @@ class instances status: typing_extensions.Literal[ '200', ] - api_response = _status_code_to_response[status].deserialize(response, self.api_client.schema_configuration) + api_response = _status_code_to_response[status].deserialize( + response, self.api_client.schema_configuration) else: api_response = api_client.ApiResponseWithoutDeserialization(response=response) diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_by_number_request_body/post/operation.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_by_number_request_body/post/operation.py index 5607adb2024..a6caf430661 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_by_number_request_body/post/operation.py +++ b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_by_number_request_body/post/operation.py @@ -234,7 +234,8 @@ class instances status: typing_extensions.Literal[ '200', ] - api_response = _status_code_to_response[status].deserialize(response, self.api_client.schema_configuration) + api_response = _status_code_to_response[status].deserialize( + response, self.api_client.schema_configuration) else: api_response = api_client.ApiResponseWithoutDeserialization(response=response) diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_by_small_number_request_body/post/operation.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_by_small_number_request_body/post/operation.py index b903cf2e18b..c2336d8ca5a 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_by_small_number_request_body/post/operation.py +++ b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_by_small_number_request_body/post/operation.py @@ -234,7 +234,8 @@ class instances status: typing_extensions.Literal[ '200', ] - api_response = _status_code_to_response[status].deserialize(response, self.api_client.schema_configuration) + api_response = _status_code_to_response[status].deserialize( + response, self.api_client.schema_configuration) else: api_response = api_client.ApiResponseWithoutDeserialization(response=response) diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_date_time_format_request_body/post/operation.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_date_time_format_request_body/post/operation.py index 6115bb6807d..9613e7f7ffc 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_date_time_format_request_body/post/operation.py +++ b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_date_time_format_request_body/post/operation.py @@ -234,7 +234,8 @@ class instances status: typing_extensions.Literal[ '200', ] - api_response = _status_code_to_response[status].deserialize(response, self.api_client.schema_configuration) + api_response = _status_code_to_response[status].deserialize( + response, self.api_client.schema_configuration) else: api_response = api_client.ApiResponseWithoutDeserialization(response=response) diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_email_format_request_body/post/operation.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_email_format_request_body/post/operation.py index 06f6cafce20..05fbd599e00 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_email_format_request_body/post/operation.py +++ b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_email_format_request_body/post/operation.py @@ -234,7 +234,8 @@ class instances status: typing_extensions.Literal[ '200', ] - api_response = _status_code_to_response[status].deserialize(response, self.api_client.schema_configuration) + api_response = _status_code_to_response[status].deserialize( + response, self.api_client.schema_configuration) else: api_response = api_client.ApiResponseWithoutDeserialization(response=response) diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_enum_with0_does_not_match_false_request_body/post/operation.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_enum_with0_does_not_match_false_request_body/post/operation.py index f539c28055c..522c2fa6d7f 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_enum_with0_does_not_match_false_request_body/post/operation.py +++ b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_enum_with0_does_not_match_false_request_body/post/operation.py @@ -169,7 +169,8 @@ class instances status: typing_extensions.Literal[ '200', ] - api_response = _status_code_to_response[status].deserialize(response, self.api_client.schema_configuration) + api_response = _status_code_to_response[status].deserialize( + response, self.api_client.schema_configuration) else: api_response = api_client.ApiResponseWithoutDeserialization(response=response) diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_enum_with1_does_not_match_true_request_body/post/operation.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_enum_with1_does_not_match_true_request_body/post/operation.py index aede52e1485..6a8fbdf4630 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_enum_with1_does_not_match_true_request_body/post/operation.py +++ b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_enum_with1_does_not_match_true_request_body/post/operation.py @@ -169,7 +169,8 @@ class instances status: typing_extensions.Literal[ '200', ] - api_response = _status_code_to_response[status].deserialize(response, self.api_client.schema_configuration) + api_response = _status_code_to_response[status].deserialize( + response, self.api_client.schema_configuration) else: api_response = api_client.ApiResponseWithoutDeserialization(response=response) diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_enum_with_escaped_characters_request_body/post/operation.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_enum_with_escaped_characters_request_body/post/operation.py index 18a2700495b..2498de9aa41 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_enum_with_escaped_characters_request_body/post/operation.py +++ b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_enum_with_escaped_characters_request_body/post/operation.py @@ -159,7 +159,8 @@ class instances status: typing_extensions.Literal[ '200', ] - api_response = _status_code_to_response[status].deserialize(response, self.api_client.schema_configuration) + api_response = _status_code_to_response[status].deserialize( + response, self.api_client.schema_configuration) else: api_response = api_client.ApiResponseWithoutDeserialization(response=response) diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_enum_with_false_does_not_match0_request_body/post/operation.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_enum_with_false_does_not_match0_request_body/post/operation.py index 544f160f150..07b0f970f35 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_enum_with_false_does_not_match0_request_body/post/operation.py +++ b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_enum_with_false_does_not_match0_request_body/post/operation.py @@ -159,7 +159,8 @@ class instances status: typing_extensions.Literal[ '200', ] - api_response = _status_code_to_response[status].deserialize(response, self.api_client.schema_configuration) + api_response = _status_code_to_response[status].deserialize( + response, self.api_client.schema_configuration) else: api_response = api_client.ApiResponseWithoutDeserialization(response=response) diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_enum_with_true_does_not_match1_request_body/post/operation.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_enum_with_true_does_not_match1_request_body/post/operation.py index 5cd0a62d04f..f39eb12e3cc 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_enum_with_true_does_not_match1_request_body/post/operation.py +++ b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_enum_with_true_does_not_match1_request_body/post/operation.py @@ -159,7 +159,8 @@ class instances status: typing_extensions.Literal[ '200', ] - api_response = _status_code_to_response[status].deserialize(response, self.api_client.schema_configuration) + api_response = _status_code_to_response[status].deserialize( + response, self.api_client.schema_configuration) else: api_response = api_client.ApiResponseWithoutDeserialization(response=response) diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_enums_in_properties_request_body/post/operation.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_enums_in_properties_request_body/post/operation.py index 42ac4dcef9b..30188a5cce3 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_enums_in_properties_request_body/post/operation.py +++ b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_enums_in_properties_request_body/post/operation.py @@ -164,7 +164,8 @@ class instances status: typing_extensions.Literal[ '200', ] - api_response = _status_code_to_response[status].deserialize(response, self.api_client.schema_configuration) + api_response = _status_code_to_response[status].deserialize( + response, self.api_client.schema_configuration) else: api_response = api_client.ApiResponseWithoutDeserialization(response=response) diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_forbidden_property_request_body/post/operation.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_forbidden_property_request_body/post/operation.py index a942ff69311..b7d3231f756 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_forbidden_property_request_body/post/operation.py +++ b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_forbidden_property_request_body/post/operation.py @@ -234,7 +234,8 @@ class instances status: typing_extensions.Literal[ '200', ] - api_response = _status_code_to_response[status].deserialize(response, self.api_client.schema_configuration) + api_response = _status_code_to_response[status].deserialize( + response, self.api_client.schema_configuration) else: api_response = api_client.ApiResponseWithoutDeserialization(response=response) diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_hostname_format_request_body/post/operation.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_hostname_format_request_body/post/operation.py index fd58d0d68fa..4f2d7306896 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_hostname_format_request_body/post/operation.py +++ b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_hostname_format_request_body/post/operation.py @@ -234,7 +234,8 @@ class instances status: typing_extensions.Literal[ '200', ] - api_response = _status_code_to_response[status].deserialize(response, self.api_client.schema_configuration) + api_response = _status_code_to_response[status].deserialize( + response, self.api_client.schema_configuration) else: api_response = api_client.ApiResponseWithoutDeserialization(response=response) diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_integer_type_matches_integers_request_body/post/operation.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_integer_type_matches_integers_request_body/post/operation.py index 9593eb7c9a5..a1e4382988d 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_integer_type_matches_integers_request_body/post/operation.py +++ b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_integer_type_matches_integers_request_body/post/operation.py @@ -164,7 +164,8 @@ class instances status: typing_extensions.Literal[ '200', ] - api_response = _status_code_to_response[status].deserialize(response, self.api_client.schema_configuration) + api_response = _status_code_to_response[status].deserialize( + response, self.api_client.schema_configuration) else: api_response = api_client.ApiResponseWithoutDeserialization(response=response) diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_invalid_instance_should_not_raise_error_when_float_division_inf_request_body/post/operation.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_invalid_instance_should_not_raise_error_when_float_division_inf_request_body/post/operation.py index d7d96ea343c..911ea450aca 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_invalid_instance_should_not_raise_error_when_float_division_inf_request_body/post/operation.py +++ b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_invalid_instance_should_not_raise_error_when_float_division_inf_request_body/post/operation.py @@ -164,7 +164,8 @@ class instances status: typing_extensions.Literal[ '200', ] - api_response = _status_code_to_response[status].deserialize(response, self.api_client.schema_configuration) + api_response = _status_code_to_response[status].deserialize( + response, self.api_client.schema_configuration) else: api_response = api_client.ApiResponseWithoutDeserialization(response=response) diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_invalid_string_value_for_default_request_body/post/operation.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_invalid_string_value_for_default_request_body/post/operation.py index 9194afa1a28..10bc715c922 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_invalid_string_value_for_default_request_body/post/operation.py +++ b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_invalid_string_value_for_default_request_body/post/operation.py @@ -234,7 +234,8 @@ class instances status: typing_extensions.Literal[ '200', ] - api_response = _status_code_to_response[status].deserialize(response, self.api_client.schema_configuration) + api_response = _status_code_to_response[status].deserialize( + response, self.api_client.schema_configuration) else: api_response = api_client.ApiResponseWithoutDeserialization(response=response) diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_ipv4_format_request_body/post/operation.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_ipv4_format_request_body/post/operation.py index 790bffa2786..9bf8b503449 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_ipv4_format_request_body/post/operation.py +++ b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_ipv4_format_request_body/post/operation.py @@ -234,7 +234,8 @@ class instances status: typing_extensions.Literal[ '200', ] - api_response = _status_code_to_response[status].deserialize(response, self.api_client.schema_configuration) + api_response = _status_code_to_response[status].deserialize( + response, self.api_client.schema_configuration) else: api_response = api_client.ApiResponseWithoutDeserialization(response=response) diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_ipv6_format_request_body/post/operation.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_ipv6_format_request_body/post/operation.py index 9586ba6d574..97a552602f2 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_ipv6_format_request_body/post/operation.py +++ b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_ipv6_format_request_body/post/operation.py @@ -234,7 +234,8 @@ class instances status: typing_extensions.Literal[ '200', ] - api_response = _status_code_to_response[status].deserialize(response, self.api_client.schema_configuration) + api_response = _status_code_to_response[status].deserialize( + response, self.api_client.schema_configuration) else: api_response = api_client.ApiResponseWithoutDeserialization(response=response) diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_json_pointer_format_request_body/post/operation.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_json_pointer_format_request_body/post/operation.py index 5151e14dc9b..688244306c4 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_json_pointer_format_request_body/post/operation.py +++ b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_json_pointer_format_request_body/post/operation.py @@ -234,7 +234,8 @@ class instances status: typing_extensions.Literal[ '200', ] - api_response = _status_code_to_response[status].deserialize(response, self.api_client.schema_configuration) + api_response = _status_code_to_response[status].deserialize( + response, self.api_client.schema_configuration) else: api_response = api_client.ApiResponseWithoutDeserialization(response=response) diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_maximum_validation_request_body/post/operation.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_maximum_validation_request_body/post/operation.py index 2dea568b612..b5c10f72bf0 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_maximum_validation_request_body/post/operation.py +++ b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_maximum_validation_request_body/post/operation.py @@ -234,7 +234,8 @@ class instances status: typing_extensions.Literal[ '200', ] - api_response = _status_code_to_response[status].deserialize(response, self.api_client.schema_configuration) + api_response = _status_code_to_response[status].deserialize( + response, self.api_client.schema_configuration) else: api_response = api_client.ApiResponseWithoutDeserialization(response=response) diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_maximum_validation_with_unsigned_integer_request_body/post/operation.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_maximum_validation_with_unsigned_integer_request_body/post/operation.py index 439d3413713..071f695cad5 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_maximum_validation_with_unsigned_integer_request_body/post/operation.py +++ b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_maximum_validation_with_unsigned_integer_request_body/post/operation.py @@ -234,7 +234,8 @@ class instances status: typing_extensions.Literal[ '200', ] - api_response = _status_code_to_response[status].deserialize(response, self.api_client.schema_configuration) + api_response = _status_code_to_response[status].deserialize( + response, self.api_client.schema_configuration) else: api_response = api_client.ApiResponseWithoutDeserialization(response=response) diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_maxitems_validation_request_body/post/operation.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_maxitems_validation_request_body/post/operation.py index 05ef7548d36..9ca9712a9c0 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_maxitems_validation_request_body/post/operation.py +++ b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_maxitems_validation_request_body/post/operation.py @@ -234,7 +234,8 @@ class instances status: typing_extensions.Literal[ '200', ] - api_response = _status_code_to_response[status].deserialize(response, self.api_client.schema_configuration) + api_response = _status_code_to_response[status].deserialize( + response, self.api_client.schema_configuration) else: api_response = api_client.ApiResponseWithoutDeserialization(response=response) diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_maxlength_validation_request_body/post/operation.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_maxlength_validation_request_body/post/operation.py index 3985d18b38b..add4781fd22 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_maxlength_validation_request_body/post/operation.py +++ b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_maxlength_validation_request_body/post/operation.py @@ -234,7 +234,8 @@ class instances status: typing_extensions.Literal[ '200', ] - api_response = _status_code_to_response[status].deserialize(response, self.api_client.schema_configuration) + api_response = _status_code_to_response[status].deserialize( + response, self.api_client.schema_configuration) else: api_response = api_client.ApiResponseWithoutDeserialization(response=response) diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_maxproperties0_means_the_object_is_empty_request_body/post/operation.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_maxproperties0_means_the_object_is_empty_request_body/post/operation.py index 2a9554ea55e..27a6fb3e3a7 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_maxproperties0_means_the_object_is_empty_request_body/post/operation.py +++ b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_maxproperties0_means_the_object_is_empty_request_body/post/operation.py @@ -234,7 +234,8 @@ class instances status: typing_extensions.Literal[ '200', ] - api_response = _status_code_to_response[status].deserialize(response, self.api_client.schema_configuration) + api_response = _status_code_to_response[status].deserialize( + response, self.api_client.schema_configuration) else: api_response = api_client.ApiResponseWithoutDeserialization(response=response) diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_maxproperties_validation_request_body/post/operation.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_maxproperties_validation_request_body/post/operation.py index 777d59755d0..fc5f61d00a1 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_maxproperties_validation_request_body/post/operation.py +++ b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_maxproperties_validation_request_body/post/operation.py @@ -234,7 +234,8 @@ class instances status: typing_extensions.Literal[ '200', ] - api_response = _status_code_to_response[status].deserialize(response, self.api_client.schema_configuration) + api_response = _status_code_to_response[status].deserialize( + response, self.api_client.schema_configuration) else: api_response = api_client.ApiResponseWithoutDeserialization(response=response) diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_minimum_validation_request_body/post/operation.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_minimum_validation_request_body/post/operation.py index 79d44757a47..1075a5073a9 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_minimum_validation_request_body/post/operation.py +++ b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_minimum_validation_request_body/post/operation.py @@ -234,7 +234,8 @@ class instances status: typing_extensions.Literal[ '200', ] - api_response = _status_code_to_response[status].deserialize(response, self.api_client.schema_configuration) + api_response = _status_code_to_response[status].deserialize( + response, self.api_client.schema_configuration) else: api_response = api_client.ApiResponseWithoutDeserialization(response=response) diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_minimum_validation_with_signed_integer_request_body/post/operation.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_minimum_validation_with_signed_integer_request_body/post/operation.py index dd84bba50db..488c6beacc1 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_minimum_validation_with_signed_integer_request_body/post/operation.py +++ b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_minimum_validation_with_signed_integer_request_body/post/operation.py @@ -234,7 +234,8 @@ class instances status: typing_extensions.Literal[ '200', ] - api_response = _status_code_to_response[status].deserialize(response, self.api_client.schema_configuration) + api_response = _status_code_to_response[status].deserialize( + response, self.api_client.schema_configuration) else: api_response = api_client.ApiResponseWithoutDeserialization(response=response) diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_minitems_validation_request_body/post/operation.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_minitems_validation_request_body/post/operation.py index 496b31431f2..82ee5f83598 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_minitems_validation_request_body/post/operation.py +++ b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_minitems_validation_request_body/post/operation.py @@ -234,7 +234,8 @@ class instances status: typing_extensions.Literal[ '200', ] - api_response = _status_code_to_response[status].deserialize(response, self.api_client.schema_configuration) + api_response = _status_code_to_response[status].deserialize( + response, self.api_client.schema_configuration) else: api_response = api_client.ApiResponseWithoutDeserialization(response=response) diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_minlength_validation_request_body/post/operation.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_minlength_validation_request_body/post/operation.py index 55840ab3473..9f6432cf03b 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_minlength_validation_request_body/post/operation.py +++ b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_minlength_validation_request_body/post/operation.py @@ -234,7 +234,8 @@ class instances status: typing_extensions.Literal[ '200', ] - api_response = _status_code_to_response[status].deserialize(response, self.api_client.schema_configuration) + api_response = _status_code_to_response[status].deserialize( + response, self.api_client.schema_configuration) else: api_response = api_client.ApiResponseWithoutDeserialization(response=response) diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_minproperties_validation_request_body/post/operation.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_minproperties_validation_request_body/post/operation.py index 7507657db7b..3c130130277 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_minproperties_validation_request_body/post/operation.py +++ b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_minproperties_validation_request_body/post/operation.py @@ -234,7 +234,8 @@ class instances status: typing_extensions.Literal[ '200', ] - api_response = _status_code_to_response[status].deserialize(response, self.api_client.schema_configuration) + api_response = _status_code_to_response[status].deserialize( + response, self.api_client.schema_configuration) else: api_response = api_client.ApiResponseWithoutDeserialization(response=response) diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_nested_allof_to_check_validation_semantics_request_body/post/operation.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_nested_allof_to_check_validation_semantics_request_body/post/operation.py index 30b0606faa7..f07025becd0 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_nested_allof_to_check_validation_semantics_request_body/post/operation.py +++ b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_nested_allof_to_check_validation_semantics_request_body/post/operation.py @@ -234,7 +234,8 @@ class instances status: typing_extensions.Literal[ '200', ] - api_response = _status_code_to_response[status].deserialize(response, self.api_client.schema_configuration) + api_response = _status_code_to_response[status].deserialize( + response, self.api_client.schema_configuration) else: api_response = api_client.ApiResponseWithoutDeserialization(response=response) diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_nested_anyof_to_check_validation_semantics_request_body/post/operation.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_nested_anyof_to_check_validation_semantics_request_body/post/operation.py index ab6ccc8d7e7..ababc11dc05 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_nested_anyof_to_check_validation_semantics_request_body/post/operation.py +++ b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_nested_anyof_to_check_validation_semantics_request_body/post/operation.py @@ -234,7 +234,8 @@ class instances status: typing_extensions.Literal[ '200', ] - api_response = _status_code_to_response[status].deserialize(response, self.api_client.schema_configuration) + api_response = _status_code_to_response[status].deserialize( + response, self.api_client.schema_configuration) else: api_response = api_client.ApiResponseWithoutDeserialization(response=response) diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_nested_items_request_body/post/operation.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_nested_items_request_body/post/operation.py index 02ebbbfc8d4..c7cf11a2ff3 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_nested_items_request_body/post/operation.py +++ b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_nested_items_request_body/post/operation.py @@ -164,7 +164,8 @@ class instances status: typing_extensions.Literal[ '200', ] - api_response = _status_code_to_response[status].deserialize(response, self.api_client.schema_configuration) + api_response = _status_code_to_response[status].deserialize( + response, self.api_client.schema_configuration) else: api_response = api_client.ApiResponseWithoutDeserialization(response=response) diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_nested_oneof_to_check_validation_semantics_request_body/post/operation.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_nested_oneof_to_check_validation_semantics_request_body/post/operation.py index d8e864a5079..e409dcce5d7 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_nested_oneof_to_check_validation_semantics_request_body/post/operation.py +++ b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_nested_oneof_to_check_validation_semantics_request_body/post/operation.py @@ -234,7 +234,8 @@ class instances status: typing_extensions.Literal[ '200', ] - api_response = _status_code_to_response[status].deserialize(response, self.api_client.schema_configuration) + api_response = _status_code_to_response[status].deserialize( + response, self.api_client.schema_configuration) else: api_response = api_client.ApiResponseWithoutDeserialization(response=response) diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_not_more_complex_schema_request_body/post/operation.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_not_more_complex_schema_request_body/post/operation.py index 77c3b7223e5..831120d56a5 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_not_more_complex_schema_request_body/post/operation.py +++ b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_not_more_complex_schema_request_body/post/operation.py @@ -234,7 +234,8 @@ class instances status: typing_extensions.Literal[ '200', ] - api_response = _status_code_to_response[status].deserialize(response, self.api_client.schema_configuration) + api_response = _status_code_to_response[status].deserialize( + response, self.api_client.schema_configuration) else: api_response = api_client.ApiResponseWithoutDeserialization(response=response) diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_not_request_body/post/operation.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_not_request_body/post/operation.py index 556c6c577d9..73ac9cddb3e 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_not_request_body/post/operation.py +++ b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_not_request_body/post/operation.py @@ -234,7 +234,8 @@ class instances status: typing_extensions.Literal[ '200', ] - api_response = _status_code_to_response[status].deserialize(response, self.api_client.schema_configuration) + api_response = _status_code_to_response[status].deserialize( + response, self.api_client.schema_configuration) else: api_response = api_client.ApiResponseWithoutDeserialization(response=response) diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_nul_characters_in_strings_request_body/post/operation.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_nul_characters_in_strings_request_body/post/operation.py index 31ecd7f8518..02d4126f2a6 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_nul_characters_in_strings_request_body/post/operation.py +++ b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_nul_characters_in_strings_request_body/post/operation.py @@ -159,7 +159,8 @@ class instances status: typing_extensions.Literal[ '200', ] - api_response = _status_code_to_response[status].deserialize(response, self.api_client.schema_configuration) + api_response = _status_code_to_response[status].deserialize( + response, self.api_client.schema_configuration) else: api_response = api_client.ApiResponseWithoutDeserialization(response=response) diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_null_type_matches_only_the_null_object_request_body/post/operation.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_null_type_matches_only_the_null_object_request_body/post/operation.py index 19afa328569..18041a6e0cc 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_null_type_matches_only_the_null_object_request_body/post/operation.py +++ b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_null_type_matches_only_the_null_object_request_body/post/operation.py @@ -159,7 +159,8 @@ class instances status: typing_extensions.Literal[ '200', ] - api_response = _status_code_to_response[status].deserialize(response, self.api_client.schema_configuration) + api_response = _status_code_to_response[status].deserialize( + response, self.api_client.schema_configuration) else: api_response = api_client.ApiResponseWithoutDeserialization(response=response) diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_number_type_matches_numbers_request_body/post/operation.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_number_type_matches_numbers_request_body/post/operation.py index 7e3e9caa9b2..4e6dfcd8df7 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_number_type_matches_numbers_request_body/post/operation.py +++ b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_number_type_matches_numbers_request_body/post/operation.py @@ -169,7 +169,8 @@ class instances status: typing_extensions.Literal[ '200', ] - api_response = _status_code_to_response[status].deserialize(response, self.api_client.schema_configuration) + api_response = _status_code_to_response[status].deserialize( + response, self.api_client.schema_configuration) else: api_response = api_client.ApiResponseWithoutDeserialization(response=response) diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_object_properties_validation_request_body/post/operation.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_object_properties_validation_request_body/post/operation.py index 8e521651019..0ad2d47107a 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_object_properties_validation_request_body/post/operation.py +++ b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_object_properties_validation_request_body/post/operation.py @@ -234,7 +234,8 @@ class instances status: typing_extensions.Literal[ '200', ] - api_response = _status_code_to_response[status].deserialize(response, self.api_client.schema_configuration) + api_response = _status_code_to_response[status].deserialize( + response, self.api_client.schema_configuration) else: api_response = api_client.ApiResponseWithoutDeserialization(response=response) diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_object_type_matches_objects_request_body/post/operation.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_object_type_matches_objects_request_body/post/operation.py index ba4d4dd76c6..2b757c68a15 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_object_type_matches_objects_request_body/post/operation.py +++ b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_object_type_matches_objects_request_body/post/operation.py @@ -164,7 +164,8 @@ class instances status: typing_extensions.Literal[ '200', ] - api_response = _status_code_to_response[status].deserialize(response, self.api_client.schema_configuration) + api_response = _status_code_to_response[status].deserialize( + response, self.api_client.schema_configuration) else: api_response = api_client.ApiResponseWithoutDeserialization(response=response) diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_oneof_complex_types_request_body/post/operation.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_oneof_complex_types_request_body/post/operation.py index edcc9704522..fea438885da 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_oneof_complex_types_request_body/post/operation.py +++ b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_oneof_complex_types_request_body/post/operation.py @@ -234,7 +234,8 @@ class instances status: typing_extensions.Literal[ '200', ] - api_response = _status_code_to_response[status].deserialize(response, self.api_client.schema_configuration) + api_response = _status_code_to_response[status].deserialize( + response, self.api_client.schema_configuration) else: api_response = api_client.ApiResponseWithoutDeserialization(response=response) diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_oneof_request_body/post/operation.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_oneof_request_body/post/operation.py index 5878484b195..da101eddacb 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_oneof_request_body/post/operation.py +++ b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_oneof_request_body/post/operation.py @@ -234,7 +234,8 @@ class instances status: typing_extensions.Literal[ '200', ] - api_response = _status_code_to_response[status].deserialize(response, self.api_client.schema_configuration) + api_response = _status_code_to_response[status].deserialize( + response, self.api_client.schema_configuration) else: api_response = api_client.ApiResponseWithoutDeserialization(response=response) diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_oneof_with_base_schema_request_body/post/operation.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_oneof_with_base_schema_request_body/post/operation.py index 2024991252a..93f434dc6fd 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_oneof_with_base_schema_request_body/post/operation.py +++ b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_oneof_with_base_schema_request_body/post/operation.py @@ -159,7 +159,8 @@ class instances status: typing_extensions.Literal[ '200', ] - api_response = _status_code_to_response[status].deserialize(response, self.api_client.schema_configuration) + api_response = _status_code_to_response[status].deserialize( + response, self.api_client.schema_configuration) else: api_response = api_client.ApiResponseWithoutDeserialization(response=response) diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_oneof_with_empty_schema_request_body/post/operation.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_oneof_with_empty_schema_request_body/post/operation.py index 2bb9dee7c70..e09425011ba 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_oneof_with_empty_schema_request_body/post/operation.py +++ b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_oneof_with_empty_schema_request_body/post/operation.py @@ -234,7 +234,8 @@ class instances status: typing_extensions.Literal[ '200', ] - api_response = _status_code_to_response[status].deserialize(response, self.api_client.schema_configuration) + api_response = _status_code_to_response[status].deserialize( + response, self.api_client.schema_configuration) else: api_response = api_client.ApiResponseWithoutDeserialization(response=response) diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_oneof_with_required_request_body/post/operation.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_oneof_with_required_request_body/post/operation.py index 0cf553f0c8a..5be3617455f 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_oneof_with_required_request_body/post/operation.py +++ b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_oneof_with_required_request_body/post/operation.py @@ -164,7 +164,8 @@ class instances status: typing_extensions.Literal[ '200', ] - api_response = _status_code_to_response[status].deserialize(response, self.api_client.schema_configuration) + api_response = _status_code_to_response[status].deserialize( + response, self.api_client.schema_configuration) else: api_response = api_client.ApiResponseWithoutDeserialization(response=response) diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_pattern_is_not_anchored_request_body/post/operation.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_pattern_is_not_anchored_request_body/post/operation.py index 3246e3451e9..2bf71004652 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_pattern_is_not_anchored_request_body/post/operation.py +++ b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_pattern_is_not_anchored_request_body/post/operation.py @@ -234,7 +234,8 @@ class instances status: typing_extensions.Literal[ '200', ] - api_response = _status_code_to_response[status].deserialize(response, self.api_client.schema_configuration) + api_response = _status_code_to_response[status].deserialize( + response, self.api_client.schema_configuration) else: api_response = api_client.ApiResponseWithoutDeserialization(response=response) diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_pattern_validation_request_body/post/operation.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_pattern_validation_request_body/post/operation.py index 4ab87cafd6e..658649ff782 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_pattern_validation_request_body/post/operation.py +++ b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_pattern_validation_request_body/post/operation.py @@ -234,7 +234,8 @@ class instances status: typing_extensions.Literal[ '200', ] - api_response = _status_code_to_response[status].deserialize(response, self.api_client.schema_configuration) + api_response = _status_code_to_response[status].deserialize( + response, self.api_client.schema_configuration) else: api_response = api_client.ApiResponseWithoutDeserialization(response=response) diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_properties_with_escaped_characters_request_body/post/operation.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_properties_with_escaped_characters_request_body/post/operation.py index 3180741a4aa..6cedfb3a1c4 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_properties_with_escaped_characters_request_body/post/operation.py +++ b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_properties_with_escaped_characters_request_body/post/operation.py @@ -234,7 +234,8 @@ class instances status: typing_extensions.Literal[ '200', ] - api_response = _status_code_to_response[status].deserialize(response, self.api_client.schema_configuration) + api_response = _status_code_to_response[status].deserialize( + response, self.api_client.schema_configuration) else: api_response = api_client.ApiResponseWithoutDeserialization(response=response) diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_property_named_ref_that_is_not_a_reference_request_body/post/operation.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_property_named_ref_that_is_not_a_reference_request_body/post/operation.py index 0d70b43f1d2..c376827c12d 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_property_named_ref_that_is_not_a_reference_request_body/post/operation.py +++ b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_property_named_ref_that_is_not_a_reference_request_body/post/operation.py @@ -234,7 +234,8 @@ class instances status: typing_extensions.Literal[ '200', ] - api_response = _status_code_to_response[status].deserialize(response, self.api_client.schema_configuration) + api_response = _status_code_to_response[status].deserialize( + response, self.api_client.schema_configuration) else: api_response = api_client.ApiResponseWithoutDeserialization(response=response) diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_ref_in_additionalproperties_request_body/post/operation.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_ref_in_additionalproperties_request_body/post/operation.py index 4b4bf49f650..39e06dfd687 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_ref_in_additionalproperties_request_body/post/operation.py +++ b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_ref_in_additionalproperties_request_body/post/operation.py @@ -164,7 +164,8 @@ class instances status: typing_extensions.Literal[ '200', ] - api_response = _status_code_to_response[status].deserialize(response, self.api_client.schema_configuration) + api_response = _status_code_to_response[status].deserialize( + response, self.api_client.schema_configuration) else: api_response = api_client.ApiResponseWithoutDeserialization(response=response) diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_ref_in_allof_request_body/post/operation.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_ref_in_allof_request_body/post/operation.py index 3fa30ad031d..918e1ae2473 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_ref_in_allof_request_body/post/operation.py +++ b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_ref_in_allof_request_body/post/operation.py @@ -234,7 +234,8 @@ class instances status: typing_extensions.Literal[ '200', ] - api_response = _status_code_to_response[status].deserialize(response, self.api_client.schema_configuration) + api_response = _status_code_to_response[status].deserialize( + response, self.api_client.schema_configuration) else: api_response = api_client.ApiResponseWithoutDeserialization(response=response) diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_ref_in_anyof_request_body/post/operation.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_ref_in_anyof_request_body/post/operation.py index 4e969bda6b0..9df5bf24750 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_ref_in_anyof_request_body/post/operation.py +++ b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_ref_in_anyof_request_body/post/operation.py @@ -234,7 +234,8 @@ class instances status: typing_extensions.Literal[ '200', ] - api_response = _status_code_to_response[status].deserialize(response, self.api_client.schema_configuration) + api_response = _status_code_to_response[status].deserialize( + response, self.api_client.schema_configuration) else: api_response = api_client.ApiResponseWithoutDeserialization(response=response) diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_ref_in_items_request_body/post/operation.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_ref_in_items_request_body/post/operation.py index b37431ced86..e014e421052 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_ref_in_items_request_body/post/operation.py +++ b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_ref_in_items_request_body/post/operation.py @@ -164,7 +164,8 @@ class instances status: typing_extensions.Literal[ '200', ] - api_response = _status_code_to_response[status].deserialize(response, self.api_client.schema_configuration) + api_response = _status_code_to_response[status].deserialize( + response, self.api_client.schema_configuration) else: api_response = api_client.ApiResponseWithoutDeserialization(response=response) diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_ref_in_not_request_body/post/operation.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_ref_in_not_request_body/post/operation.py index 589324421b5..a747a87d073 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_ref_in_not_request_body/post/operation.py +++ b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_ref_in_not_request_body/post/operation.py @@ -234,7 +234,8 @@ class instances status: typing_extensions.Literal[ '200', ] - api_response = _status_code_to_response[status].deserialize(response, self.api_client.schema_configuration) + api_response = _status_code_to_response[status].deserialize( + response, self.api_client.schema_configuration) else: api_response = api_client.ApiResponseWithoutDeserialization(response=response) diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_ref_in_oneof_request_body/post/operation.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_ref_in_oneof_request_body/post/operation.py index 83968e17e91..09e12f5e800 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_ref_in_oneof_request_body/post/operation.py +++ b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_ref_in_oneof_request_body/post/operation.py @@ -234,7 +234,8 @@ class instances status: typing_extensions.Literal[ '200', ] - api_response = _status_code_to_response[status].deserialize(response, self.api_client.schema_configuration) + api_response = _status_code_to_response[status].deserialize( + response, self.api_client.schema_configuration) else: api_response = api_client.ApiResponseWithoutDeserialization(response=response) diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_ref_in_property_request_body/post/operation.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_ref_in_property_request_body/post/operation.py index 5e974a681a2..479c5ebb0e7 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_ref_in_property_request_body/post/operation.py +++ b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_ref_in_property_request_body/post/operation.py @@ -234,7 +234,8 @@ class instances status: typing_extensions.Literal[ '200', ] - api_response = _status_code_to_response[status].deserialize(response, self.api_client.schema_configuration) + api_response = _status_code_to_response[status].deserialize( + response, self.api_client.schema_configuration) else: api_response = api_client.ApiResponseWithoutDeserialization(response=response) diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_required_default_validation_request_body/post/operation.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_required_default_validation_request_body/post/operation.py index 16b64b8271e..ca1560c8777 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_required_default_validation_request_body/post/operation.py +++ b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_required_default_validation_request_body/post/operation.py @@ -234,7 +234,8 @@ class instances status: typing_extensions.Literal[ '200', ] - api_response = _status_code_to_response[status].deserialize(response, self.api_client.schema_configuration) + api_response = _status_code_to_response[status].deserialize( + response, self.api_client.schema_configuration) else: api_response = api_client.ApiResponseWithoutDeserialization(response=response) diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_required_validation_request_body/post/operation.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_required_validation_request_body/post/operation.py index aa28a221995..b51f2de7a3f 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_required_validation_request_body/post/operation.py +++ b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_required_validation_request_body/post/operation.py @@ -234,7 +234,8 @@ class instances status: typing_extensions.Literal[ '200', ] - api_response = _status_code_to_response[status].deserialize(response, self.api_client.schema_configuration) + api_response = _status_code_to_response[status].deserialize( + response, self.api_client.schema_configuration) else: api_response = api_client.ApiResponseWithoutDeserialization(response=response) diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_required_with_empty_array_request_body/post/operation.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_required_with_empty_array_request_body/post/operation.py index 9c416a88376..0e105a0e367 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_required_with_empty_array_request_body/post/operation.py +++ b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_required_with_empty_array_request_body/post/operation.py @@ -234,7 +234,8 @@ class instances status: typing_extensions.Literal[ '200', ] - api_response = _status_code_to_response[status].deserialize(response, self.api_client.schema_configuration) + api_response = _status_code_to_response[status].deserialize( + response, self.api_client.schema_configuration) else: api_response = api_client.ApiResponseWithoutDeserialization(response=response) diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_required_with_escaped_characters_request_body/post/operation.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_required_with_escaped_characters_request_body/post/operation.py index 660584fb8ac..53db886d85d 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_required_with_escaped_characters_request_body/post/operation.py +++ b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_required_with_escaped_characters_request_body/post/operation.py @@ -234,7 +234,8 @@ class instances status: typing_extensions.Literal[ '200', ] - api_response = _status_code_to_response[status].deserialize(response, self.api_client.schema_configuration) + api_response = _status_code_to_response[status].deserialize( + response, self.api_client.schema_configuration) else: api_response = api_client.ApiResponseWithoutDeserialization(response=response) diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_simple_enum_validation_request_body/post/operation.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_simple_enum_validation_request_body/post/operation.py index 5c6feb06a1f..ba9eb6aeca7 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_simple_enum_validation_request_body/post/operation.py +++ b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_simple_enum_validation_request_body/post/operation.py @@ -169,7 +169,8 @@ class instances status: typing_extensions.Literal[ '200', ] - api_response = _status_code_to_response[status].deserialize(response, self.api_client.schema_configuration) + api_response = _status_code_to_response[status].deserialize( + response, self.api_client.schema_configuration) else: api_response = api_client.ApiResponseWithoutDeserialization(response=response) diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_string_type_matches_strings_request_body/post/operation.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_string_type_matches_strings_request_body/post/operation.py index af8628e304b..f29f09072f7 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_string_type_matches_strings_request_body/post/operation.py +++ b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_string_type_matches_strings_request_body/post/operation.py @@ -159,7 +159,8 @@ class instances status: typing_extensions.Literal[ '200', ] - api_response = _status_code_to_response[status].deserialize(response, self.api_client.schema_configuration) + api_response = _status_code_to_response[status].deserialize( + response, self.api_client.schema_configuration) else: api_response = api_client.ApiResponseWithoutDeserialization(response=response) diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_the_default_keyword_does_not_do_anything_if_the_property_is_missing_request_body/post/operation.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_the_default_keyword_does_not_do_anything_if_the_property_is_missing_request_body/post/operation.py index 7ada32391ca..c6141b0c2f5 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_the_default_keyword_does_not_do_anything_if_the_property_is_missing_request_body/post/operation.py +++ b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_the_default_keyword_does_not_do_anything_if_the_property_is_missing_request_body/post/operation.py @@ -164,7 +164,8 @@ class instances status: typing_extensions.Literal[ '200', ] - api_response = _status_code_to_response[status].deserialize(response, self.api_client.schema_configuration) + api_response = _status_code_to_response[status].deserialize( + response, self.api_client.schema_configuration) else: api_response = api_client.ApiResponseWithoutDeserialization(response=response) diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_uniqueitems_false_validation_request_body/post/operation.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_uniqueitems_false_validation_request_body/post/operation.py index 9a013c83c7a..13961a18309 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_uniqueitems_false_validation_request_body/post/operation.py +++ b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_uniqueitems_false_validation_request_body/post/operation.py @@ -234,7 +234,8 @@ class instances status: typing_extensions.Literal[ '200', ] - api_response = _status_code_to_response[status].deserialize(response, self.api_client.schema_configuration) + api_response = _status_code_to_response[status].deserialize( + response, self.api_client.schema_configuration) else: api_response = api_client.ApiResponseWithoutDeserialization(response=response) diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_uniqueitems_validation_request_body/post/operation.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_uniqueitems_validation_request_body/post/operation.py index 881da69ae3e..58e9f62c3b4 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_uniqueitems_validation_request_body/post/operation.py +++ b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_uniqueitems_validation_request_body/post/operation.py @@ -234,7 +234,8 @@ class instances status: typing_extensions.Literal[ '200', ] - api_response = _status_code_to_response[status].deserialize(response, self.api_client.schema_configuration) + api_response = _status_code_to_response[status].deserialize( + response, self.api_client.schema_configuration) else: api_response = api_client.ApiResponseWithoutDeserialization(response=response) diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_uri_format_request_body/post/operation.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_uri_format_request_body/post/operation.py index cb616cacfbd..6472b463de3 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_uri_format_request_body/post/operation.py +++ b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_uri_format_request_body/post/operation.py @@ -234,7 +234,8 @@ class instances status: typing_extensions.Literal[ '200', ] - api_response = _status_code_to_response[status].deserialize(response, self.api_client.schema_configuration) + api_response = _status_code_to_response[status].deserialize( + response, self.api_client.schema_configuration) else: api_response = api_client.ApiResponseWithoutDeserialization(response=response) diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_uri_reference_format_request_body/post/operation.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_uri_reference_format_request_body/post/operation.py index b9b21423c22..76339c38120 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_uri_reference_format_request_body/post/operation.py +++ b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_uri_reference_format_request_body/post/operation.py @@ -234,7 +234,8 @@ class instances status: typing_extensions.Literal[ '200', ] - api_response = _status_code_to_response[status].deserialize(response, self.api_client.schema_configuration) + api_response = _status_code_to_response[status].deserialize( + response, self.api_client.schema_configuration) else: api_response = api_client.ApiResponseWithoutDeserialization(response=response) diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_uri_template_format_request_body/post/operation.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_uri_template_format_request_body/post/operation.py index 793b9350fc4..539021d7b12 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_uri_template_format_request_body/post/operation.py +++ b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/request_body_post_uri_template_format_request_body/post/operation.py @@ -234,7 +234,8 @@ class instances status: typing_extensions.Literal[ '200', ] - api_response = _status_code_to_response[status].deserialize(response, self.api_client.schema_configuration) + api_response = _status_code_to_response[status].deserialize( + response, self.api_client.schema_configuration) else: api_response = api_client.ApiResponseWithoutDeserialization(response=response) diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_additionalproperties_allows_a_schema_which_should_validate_response_body_for_content_types/post/operation.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_additionalproperties_allows_a_schema_which_should_validate_response_body_for_content_types/post/operation.py index 8e91853cb56..e4345f5e062 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_additionalproperties_allows_a_schema_which_should_validate_response_body_for_content_types/post/operation.py +++ b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_additionalproperties_allows_a_schema_which_should_validate_response_body_for_content_types/post/operation.py @@ -120,7 +120,8 @@ class instances status: typing_extensions.Literal[ '200', ] - api_response = _status_code_to_response[status].deserialize(response, self.api_client.schema_configuration) + api_response = _status_code_to_response[status].deserialize( + response, self.api_client.schema_configuration) else: api_response = api_client.ApiResponseWithoutDeserialization(response=response) diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_additionalproperties_allows_a_schema_which_should_validate_response_body_for_content_types/post/responses/response_200/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_additionalproperties_allows_a_schema_which_should_validate_response_body_for_content_types/post/responses/response_200/__init__.py index 5f51d512bcc..790e742c513 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_additionalproperties_allows_a_schema_which_should_validate_response_body_for_content_types/post/responses/response_200/__init__.py +++ b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_additionalproperties_allows_a_schema_which_should_validate_response_body_for_content_types/post/responses/response_200/__init__.py @@ -25,9 +25,7 @@ @dataclasses.dataclass class _ApiResponse(api_client.ApiResponse): response: urllib3.HTTPResponse - body: typing.Union[ - application_json_schema.Schema, - ] + body: application_json_schema.Schema headers: schemas.Unset = schemas.unset diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_additionalproperties_are_allowed_by_default_response_body_for_content_types/post/operation.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_additionalproperties_are_allowed_by_default_response_body_for_content_types/post/operation.py index f569f5218c4..97a6d49be9f 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_additionalproperties_are_allowed_by_default_response_body_for_content_types/post/operation.py +++ b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_additionalproperties_are_allowed_by_default_response_body_for_content_types/post/operation.py @@ -120,7 +120,8 @@ class instances status: typing_extensions.Literal[ '200', ] - api_response = _status_code_to_response[status].deserialize(response, self.api_client.schema_configuration) + api_response = _status_code_to_response[status].deserialize( + response, self.api_client.schema_configuration) else: api_response = api_client.ApiResponseWithoutDeserialization(response=response) diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_additionalproperties_are_allowed_by_default_response_body_for_content_types/post/responses/response_200/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_additionalproperties_are_allowed_by_default_response_body_for_content_types/post/responses/response_200/__init__.py index 5f51d512bcc..790e742c513 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_additionalproperties_are_allowed_by_default_response_body_for_content_types/post/responses/response_200/__init__.py +++ b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_additionalproperties_are_allowed_by_default_response_body_for_content_types/post/responses/response_200/__init__.py @@ -25,9 +25,7 @@ @dataclasses.dataclass class _ApiResponse(api_client.ApiResponse): response: urllib3.HTTPResponse - body: typing.Union[ - application_json_schema.Schema, - ] + body: application_json_schema.Schema headers: schemas.Unset = schemas.unset diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_additionalproperties_can_exist_by_itself_response_body_for_content_types/post/operation.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_additionalproperties_can_exist_by_itself_response_body_for_content_types/post/operation.py index efad10e2994..b43db4bb82c 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_additionalproperties_can_exist_by_itself_response_body_for_content_types/post/operation.py +++ b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_additionalproperties_can_exist_by_itself_response_body_for_content_types/post/operation.py @@ -120,7 +120,8 @@ class instances status: typing_extensions.Literal[ '200', ] - api_response = _status_code_to_response[status].deserialize(response, self.api_client.schema_configuration) + api_response = _status_code_to_response[status].deserialize( + response, self.api_client.schema_configuration) else: api_response = api_client.ApiResponseWithoutDeserialization(response=response) diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_additionalproperties_can_exist_by_itself_response_body_for_content_types/post/responses/response_200/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_additionalproperties_can_exist_by_itself_response_body_for_content_types/post/responses/response_200/__init__.py index 5f51d512bcc..790e742c513 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_additionalproperties_can_exist_by_itself_response_body_for_content_types/post/responses/response_200/__init__.py +++ b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_additionalproperties_can_exist_by_itself_response_body_for_content_types/post/responses/response_200/__init__.py @@ -25,9 +25,7 @@ @dataclasses.dataclass class _ApiResponse(api_client.ApiResponse): response: urllib3.HTTPResponse - body: typing.Union[ - application_json_schema.Schema, - ] + body: application_json_schema.Schema headers: schemas.Unset = schemas.unset diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_additionalproperties_should_not_look_in_applicators_response_body_for_content_types/post/operation.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_additionalproperties_should_not_look_in_applicators_response_body_for_content_types/post/operation.py index 4b860dd5994..d4ad7ca29c3 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_additionalproperties_should_not_look_in_applicators_response_body_for_content_types/post/operation.py +++ b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_additionalproperties_should_not_look_in_applicators_response_body_for_content_types/post/operation.py @@ -120,7 +120,8 @@ class instances status: typing_extensions.Literal[ '200', ] - api_response = _status_code_to_response[status].deserialize(response, self.api_client.schema_configuration) + api_response = _status_code_to_response[status].deserialize( + response, self.api_client.schema_configuration) else: api_response = api_client.ApiResponseWithoutDeserialization(response=response) diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_additionalproperties_should_not_look_in_applicators_response_body_for_content_types/post/responses/response_200/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_additionalproperties_should_not_look_in_applicators_response_body_for_content_types/post/responses/response_200/__init__.py index 5f51d512bcc..790e742c513 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_additionalproperties_should_not_look_in_applicators_response_body_for_content_types/post/responses/response_200/__init__.py +++ b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_additionalproperties_should_not_look_in_applicators_response_body_for_content_types/post/responses/response_200/__init__.py @@ -25,9 +25,7 @@ @dataclasses.dataclass class _ApiResponse(api_client.ApiResponse): response: urllib3.HTTPResponse - body: typing.Union[ - application_json_schema.Schema, - ] + body: application_json_schema.Schema headers: schemas.Unset = schemas.unset diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_allof_combined_with_anyof_oneof_response_body_for_content_types/post/operation.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_allof_combined_with_anyof_oneof_response_body_for_content_types/post/operation.py index 11fb3201621..a6bad65ee26 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_allof_combined_with_anyof_oneof_response_body_for_content_types/post/operation.py +++ b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_allof_combined_with_anyof_oneof_response_body_for_content_types/post/operation.py @@ -120,7 +120,8 @@ class instances status: typing_extensions.Literal[ '200', ] - api_response = _status_code_to_response[status].deserialize(response, self.api_client.schema_configuration) + api_response = _status_code_to_response[status].deserialize( + response, self.api_client.schema_configuration) else: api_response = api_client.ApiResponseWithoutDeserialization(response=response) diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_allof_combined_with_anyof_oneof_response_body_for_content_types/post/responses/response_200/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_allof_combined_with_anyof_oneof_response_body_for_content_types/post/responses/response_200/__init__.py index 5f51d512bcc..790e742c513 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_allof_combined_with_anyof_oneof_response_body_for_content_types/post/responses/response_200/__init__.py +++ b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_allof_combined_with_anyof_oneof_response_body_for_content_types/post/responses/response_200/__init__.py @@ -25,9 +25,7 @@ @dataclasses.dataclass class _ApiResponse(api_client.ApiResponse): response: urllib3.HTTPResponse - body: typing.Union[ - application_json_schema.Schema, - ] + body: application_json_schema.Schema headers: schemas.Unset = schemas.unset diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_allof_response_body_for_content_types/post/operation.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_allof_response_body_for_content_types/post/operation.py index 0659a860637..47ddd722122 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_allof_response_body_for_content_types/post/operation.py +++ b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_allof_response_body_for_content_types/post/operation.py @@ -120,7 +120,8 @@ class instances status: typing_extensions.Literal[ '200', ] - api_response = _status_code_to_response[status].deserialize(response, self.api_client.schema_configuration) + api_response = _status_code_to_response[status].deserialize( + response, self.api_client.schema_configuration) else: api_response = api_client.ApiResponseWithoutDeserialization(response=response) diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_allof_response_body_for_content_types/post/responses/response_200/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_allof_response_body_for_content_types/post/responses/response_200/__init__.py index 5f51d512bcc..790e742c513 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_allof_response_body_for_content_types/post/responses/response_200/__init__.py +++ b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_allof_response_body_for_content_types/post/responses/response_200/__init__.py @@ -25,9 +25,7 @@ @dataclasses.dataclass class _ApiResponse(api_client.ApiResponse): response: urllib3.HTTPResponse - body: typing.Union[ - application_json_schema.Schema, - ] + body: application_json_schema.Schema headers: schemas.Unset = schemas.unset diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_allof_simple_types_response_body_for_content_types/post/operation.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_allof_simple_types_response_body_for_content_types/post/operation.py index 825a3bf9692..f0c881a8855 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_allof_simple_types_response_body_for_content_types/post/operation.py +++ b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_allof_simple_types_response_body_for_content_types/post/operation.py @@ -120,7 +120,8 @@ class instances status: typing_extensions.Literal[ '200', ] - api_response = _status_code_to_response[status].deserialize(response, self.api_client.schema_configuration) + api_response = _status_code_to_response[status].deserialize( + response, self.api_client.schema_configuration) else: api_response = api_client.ApiResponseWithoutDeserialization(response=response) diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_allof_simple_types_response_body_for_content_types/post/responses/response_200/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_allof_simple_types_response_body_for_content_types/post/responses/response_200/__init__.py index 5f51d512bcc..790e742c513 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_allof_simple_types_response_body_for_content_types/post/responses/response_200/__init__.py +++ b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_allof_simple_types_response_body_for_content_types/post/responses/response_200/__init__.py @@ -25,9 +25,7 @@ @dataclasses.dataclass class _ApiResponse(api_client.ApiResponse): response: urllib3.HTTPResponse - body: typing.Union[ - application_json_schema.Schema, - ] + body: application_json_schema.Schema headers: schemas.Unset = schemas.unset diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_allof_with_base_schema_response_body_for_content_types/post/operation.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_allof_with_base_schema_response_body_for_content_types/post/operation.py index 48f90b4242c..4fb086c1f89 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_allof_with_base_schema_response_body_for_content_types/post/operation.py +++ b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_allof_with_base_schema_response_body_for_content_types/post/operation.py @@ -120,7 +120,8 @@ class instances status: typing_extensions.Literal[ '200', ] - api_response = _status_code_to_response[status].deserialize(response, self.api_client.schema_configuration) + api_response = _status_code_to_response[status].deserialize( + response, self.api_client.schema_configuration) else: api_response = api_client.ApiResponseWithoutDeserialization(response=response) diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_allof_with_base_schema_response_body_for_content_types/post/responses/response_200/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_allof_with_base_schema_response_body_for_content_types/post/responses/response_200/__init__.py index 5f51d512bcc..790e742c513 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_allof_with_base_schema_response_body_for_content_types/post/responses/response_200/__init__.py +++ b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_allof_with_base_schema_response_body_for_content_types/post/responses/response_200/__init__.py @@ -25,9 +25,7 @@ @dataclasses.dataclass class _ApiResponse(api_client.ApiResponse): response: urllib3.HTTPResponse - body: typing.Union[ - application_json_schema.Schema, - ] + body: application_json_schema.Schema headers: schemas.Unset = schemas.unset diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_allof_with_one_empty_schema_response_body_for_content_types/post/operation.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_allof_with_one_empty_schema_response_body_for_content_types/post/operation.py index 07acaa3f56c..36eeac987d4 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_allof_with_one_empty_schema_response_body_for_content_types/post/operation.py +++ b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_allof_with_one_empty_schema_response_body_for_content_types/post/operation.py @@ -120,7 +120,8 @@ class instances status: typing_extensions.Literal[ '200', ] - api_response = _status_code_to_response[status].deserialize(response, self.api_client.schema_configuration) + api_response = _status_code_to_response[status].deserialize( + response, self.api_client.schema_configuration) else: api_response = api_client.ApiResponseWithoutDeserialization(response=response) diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_allof_with_one_empty_schema_response_body_for_content_types/post/responses/response_200/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_allof_with_one_empty_schema_response_body_for_content_types/post/responses/response_200/__init__.py index 5f51d512bcc..790e742c513 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_allof_with_one_empty_schema_response_body_for_content_types/post/responses/response_200/__init__.py +++ b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_allof_with_one_empty_schema_response_body_for_content_types/post/responses/response_200/__init__.py @@ -25,9 +25,7 @@ @dataclasses.dataclass class _ApiResponse(api_client.ApiResponse): response: urllib3.HTTPResponse - body: typing.Union[ - application_json_schema.Schema, - ] + body: application_json_schema.Schema headers: schemas.Unset = schemas.unset diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_allof_with_the_first_empty_schema_response_body_for_content_types/post/operation.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_allof_with_the_first_empty_schema_response_body_for_content_types/post/operation.py index 5a17de31d05..51bcdaa4a8d 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_allof_with_the_first_empty_schema_response_body_for_content_types/post/operation.py +++ b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_allof_with_the_first_empty_schema_response_body_for_content_types/post/operation.py @@ -120,7 +120,8 @@ class instances status: typing_extensions.Literal[ '200', ] - api_response = _status_code_to_response[status].deserialize(response, self.api_client.schema_configuration) + api_response = _status_code_to_response[status].deserialize( + response, self.api_client.schema_configuration) else: api_response = api_client.ApiResponseWithoutDeserialization(response=response) diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_allof_with_the_first_empty_schema_response_body_for_content_types/post/responses/response_200/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_allof_with_the_first_empty_schema_response_body_for_content_types/post/responses/response_200/__init__.py index 5f51d512bcc..790e742c513 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_allof_with_the_first_empty_schema_response_body_for_content_types/post/responses/response_200/__init__.py +++ b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_allof_with_the_first_empty_schema_response_body_for_content_types/post/responses/response_200/__init__.py @@ -25,9 +25,7 @@ @dataclasses.dataclass class _ApiResponse(api_client.ApiResponse): response: urllib3.HTTPResponse - body: typing.Union[ - application_json_schema.Schema, - ] + body: application_json_schema.Schema headers: schemas.Unset = schemas.unset diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_allof_with_the_last_empty_schema_response_body_for_content_types/post/operation.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_allof_with_the_last_empty_schema_response_body_for_content_types/post/operation.py index 29df4b3ae2a..76fb9fe9d09 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_allof_with_the_last_empty_schema_response_body_for_content_types/post/operation.py +++ b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_allof_with_the_last_empty_schema_response_body_for_content_types/post/operation.py @@ -120,7 +120,8 @@ class instances status: typing_extensions.Literal[ '200', ] - api_response = _status_code_to_response[status].deserialize(response, self.api_client.schema_configuration) + api_response = _status_code_to_response[status].deserialize( + response, self.api_client.schema_configuration) else: api_response = api_client.ApiResponseWithoutDeserialization(response=response) diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_allof_with_the_last_empty_schema_response_body_for_content_types/post/responses/response_200/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_allof_with_the_last_empty_schema_response_body_for_content_types/post/responses/response_200/__init__.py index 5f51d512bcc..790e742c513 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_allof_with_the_last_empty_schema_response_body_for_content_types/post/responses/response_200/__init__.py +++ b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_allof_with_the_last_empty_schema_response_body_for_content_types/post/responses/response_200/__init__.py @@ -25,9 +25,7 @@ @dataclasses.dataclass class _ApiResponse(api_client.ApiResponse): response: urllib3.HTTPResponse - body: typing.Union[ - application_json_schema.Schema, - ] + body: application_json_schema.Schema headers: schemas.Unset = schemas.unset diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_allof_with_two_empty_schemas_response_body_for_content_types/post/operation.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_allof_with_two_empty_schemas_response_body_for_content_types/post/operation.py index 2d9c3b01a22..838b106fc86 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_allof_with_two_empty_schemas_response_body_for_content_types/post/operation.py +++ b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_allof_with_two_empty_schemas_response_body_for_content_types/post/operation.py @@ -120,7 +120,8 @@ class instances status: typing_extensions.Literal[ '200', ] - api_response = _status_code_to_response[status].deserialize(response, self.api_client.schema_configuration) + api_response = _status_code_to_response[status].deserialize( + response, self.api_client.schema_configuration) else: api_response = api_client.ApiResponseWithoutDeserialization(response=response) diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_allof_with_two_empty_schemas_response_body_for_content_types/post/responses/response_200/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_allof_with_two_empty_schemas_response_body_for_content_types/post/responses/response_200/__init__.py index 5f51d512bcc..790e742c513 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_allof_with_two_empty_schemas_response_body_for_content_types/post/responses/response_200/__init__.py +++ b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_allof_with_two_empty_schemas_response_body_for_content_types/post/responses/response_200/__init__.py @@ -25,9 +25,7 @@ @dataclasses.dataclass class _ApiResponse(api_client.ApiResponse): response: urllib3.HTTPResponse - body: typing.Union[ - application_json_schema.Schema, - ] + body: application_json_schema.Schema headers: schemas.Unset = schemas.unset diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_anyof_complex_types_response_body_for_content_types/post/operation.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_anyof_complex_types_response_body_for_content_types/post/operation.py index e09ebc79b9e..7f7a1944d22 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_anyof_complex_types_response_body_for_content_types/post/operation.py +++ b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_anyof_complex_types_response_body_for_content_types/post/operation.py @@ -120,7 +120,8 @@ class instances status: typing_extensions.Literal[ '200', ] - api_response = _status_code_to_response[status].deserialize(response, self.api_client.schema_configuration) + api_response = _status_code_to_response[status].deserialize( + response, self.api_client.schema_configuration) else: api_response = api_client.ApiResponseWithoutDeserialization(response=response) diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_anyof_complex_types_response_body_for_content_types/post/responses/response_200/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_anyof_complex_types_response_body_for_content_types/post/responses/response_200/__init__.py index 5f51d512bcc..790e742c513 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_anyof_complex_types_response_body_for_content_types/post/responses/response_200/__init__.py +++ b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_anyof_complex_types_response_body_for_content_types/post/responses/response_200/__init__.py @@ -25,9 +25,7 @@ @dataclasses.dataclass class _ApiResponse(api_client.ApiResponse): response: urllib3.HTTPResponse - body: typing.Union[ - application_json_schema.Schema, - ] + body: application_json_schema.Schema headers: schemas.Unset = schemas.unset diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_anyof_response_body_for_content_types/post/operation.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_anyof_response_body_for_content_types/post/operation.py index fa9152d84d5..0e829d16522 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_anyof_response_body_for_content_types/post/operation.py +++ b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_anyof_response_body_for_content_types/post/operation.py @@ -120,7 +120,8 @@ class instances status: typing_extensions.Literal[ '200', ] - api_response = _status_code_to_response[status].deserialize(response, self.api_client.schema_configuration) + api_response = _status_code_to_response[status].deserialize( + response, self.api_client.schema_configuration) else: api_response = api_client.ApiResponseWithoutDeserialization(response=response) diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_anyof_response_body_for_content_types/post/responses/response_200/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_anyof_response_body_for_content_types/post/responses/response_200/__init__.py index 5f51d512bcc..790e742c513 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_anyof_response_body_for_content_types/post/responses/response_200/__init__.py +++ b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_anyof_response_body_for_content_types/post/responses/response_200/__init__.py @@ -25,9 +25,7 @@ @dataclasses.dataclass class _ApiResponse(api_client.ApiResponse): response: urllib3.HTTPResponse - body: typing.Union[ - application_json_schema.Schema, - ] + body: application_json_schema.Schema headers: schemas.Unset = schemas.unset diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_anyof_with_base_schema_response_body_for_content_types/post/operation.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_anyof_with_base_schema_response_body_for_content_types/post/operation.py index 67abdfe33b0..1a7abca736b 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_anyof_with_base_schema_response_body_for_content_types/post/operation.py +++ b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_anyof_with_base_schema_response_body_for_content_types/post/operation.py @@ -120,7 +120,8 @@ class instances status: typing_extensions.Literal[ '200', ] - api_response = _status_code_to_response[status].deserialize(response, self.api_client.schema_configuration) + api_response = _status_code_to_response[status].deserialize( + response, self.api_client.schema_configuration) else: api_response = api_client.ApiResponseWithoutDeserialization(response=response) diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_anyof_with_base_schema_response_body_for_content_types/post/responses/response_200/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_anyof_with_base_schema_response_body_for_content_types/post/responses/response_200/__init__.py index 5f51d512bcc..790e742c513 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_anyof_with_base_schema_response_body_for_content_types/post/responses/response_200/__init__.py +++ b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_anyof_with_base_schema_response_body_for_content_types/post/responses/response_200/__init__.py @@ -25,9 +25,7 @@ @dataclasses.dataclass class _ApiResponse(api_client.ApiResponse): response: urllib3.HTTPResponse - body: typing.Union[ - application_json_schema.Schema, - ] + body: application_json_schema.Schema headers: schemas.Unset = schemas.unset diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_anyof_with_one_empty_schema_response_body_for_content_types/post/operation.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_anyof_with_one_empty_schema_response_body_for_content_types/post/operation.py index 5a4952c1df7..8670d6b92e9 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_anyof_with_one_empty_schema_response_body_for_content_types/post/operation.py +++ b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_anyof_with_one_empty_schema_response_body_for_content_types/post/operation.py @@ -120,7 +120,8 @@ class instances status: typing_extensions.Literal[ '200', ] - api_response = _status_code_to_response[status].deserialize(response, self.api_client.schema_configuration) + api_response = _status_code_to_response[status].deserialize( + response, self.api_client.schema_configuration) else: api_response = api_client.ApiResponseWithoutDeserialization(response=response) diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_anyof_with_one_empty_schema_response_body_for_content_types/post/responses/response_200/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_anyof_with_one_empty_schema_response_body_for_content_types/post/responses/response_200/__init__.py index 5f51d512bcc..790e742c513 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_anyof_with_one_empty_schema_response_body_for_content_types/post/responses/response_200/__init__.py +++ b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_anyof_with_one_empty_schema_response_body_for_content_types/post/responses/response_200/__init__.py @@ -25,9 +25,7 @@ @dataclasses.dataclass class _ApiResponse(api_client.ApiResponse): response: urllib3.HTTPResponse - body: typing.Union[ - application_json_schema.Schema, - ] + body: application_json_schema.Schema headers: schemas.Unset = schemas.unset diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_array_type_matches_arrays_response_body_for_content_types/post/operation.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_array_type_matches_arrays_response_body_for_content_types/post/operation.py index 7042d5e34e9..3dfffdaf123 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_array_type_matches_arrays_response_body_for_content_types/post/operation.py +++ b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_array_type_matches_arrays_response_body_for_content_types/post/operation.py @@ -120,7 +120,8 @@ class instances status: typing_extensions.Literal[ '200', ] - api_response = _status_code_to_response[status].deserialize(response, self.api_client.schema_configuration) + api_response = _status_code_to_response[status].deserialize( + response, self.api_client.schema_configuration) else: api_response = api_client.ApiResponseWithoutDeserialization(response=response) diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_array_type_matches_arrays_response_body_for_content_types/post/responses/response_200/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_array_type_matches_arrays_response_body_for_content_types/post/responses/response_200/__init__.py index 5f51d512bcc..790e742c513 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_array_type_matches_arrays_response_body_for_content_types/post/responses/response_200/__init__.py +++ b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_array_type_matches_arrays_response_body_for_content_types/post/responses/response_200/__init__.py @@ -25,9 +25,7 @@ @dataclasses.dataclass class _ApiResponse(api_client.ApiResponse): response: urllib3.HTTPResponse - body: typing.Union[ - application_json_schema.Schema, - ] + body: application_json_schema.Schema headers: schemas.Unset = schemas.unset diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_boolean_type_matches_booleans_response_body_for_content_types/post/operation.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_boolean_type_matches_booleans_response_body_for_content_types/post/operation.py index 050f27cb473..31352c2db8d 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_boolean_type_matches_booleans_response_body_for_content_types/post/operation.py +++ b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_boolean_type_matches_booleans_response_body_for_content_types/post/operation.py @@ -120,7 +120,8 @@ class instances status: typing_extensions.Literal[ '200', ] - api_response = _status_code_to_response[status].deserialize(response, self.api_client.schema_configuration) + api_response = _status_code_to_response[status].deserialize( + response, self.api_client.schema_configuration) else: api_response = api_client.ApiResponseWithoutDeserialization(response=response) diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_boolean_type_matches_booleans_response_body_for_content_types/post/responses/response_200/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_boolean_type_matches_booleans_response_body_for_content_types/post/responses/response_200/__init__.py index 5f51d512bcc..790e742c513 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_boolean_type_matches_booleans_response_body_for_content_types/post/responses/response_200/__init__.py +++ b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_boolean_type_matches_booleans_response_body_for_content_types/post/responses/response_200/__init__.py @@ -25,9 +25,7 @@ @dataclasses.dataclass class _ApiResponse(api_client.ApiResponse): response: urllib3.HTTPResponse - body: typing.Union[ - application_json_schema.Schema, - ] + body: application_json_schema.Schema headers: schemas.Unset = schemas.unset diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_by_int_response_body_for_content_types/post/operation.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_by_int_response_body_for_content_types/post/operation.py index 4e93ac3ac8f..c783e192954 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_by_int_response_body_for_content_types/post/operation.py +++ b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_by_int_response_body_for_content_types/post/operation.py @@ -120,7 +120,8 @@ class instances status: typing_extensions.Literal[ '200', ] - api_response = _status_code_to_response[status].deserialize(response, self.api_client.schema_configuration) + api_response = _status_code_to_response[status].deserialize( + response, self.api_client.schema_configuration) else: api_response = api_client.ApiResponseWithoutDeserialization(response=response) diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_by_int_response_body_for_content_types/post/responses/response_200/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_by_int_response_body_for_content_types/post/responses/response_200/__init__.py index 5f51d512bcc..790e742c513 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_by_int_response_body_for_content_types/post/responses/response_200/__init__.py +++ b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_by_int_response_body_for_content_types/post/responses/response_200/__init__.py @@ -25,9 +25,7 @@ @dataclasses.dataclass class _ApiResponse(api_client.ApiResponse): response: urllib3.HTTPResponse - body: typing.Union[ - application_json_schema.Schema, - ] + body: application_json_schema.Schema headers: schemas.Unset = schemas.unset diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_by_number_response_body_for_content_types/post/operation.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_by_number_response_body_for_content_types/post/operation.py index e107a5d55da..35b612e97d4 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_by_number_response_body_for_content_types/post/operation.py +++ b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_by_number_response_body_for_content_types/post/operation.py @@ -120,7 +120,8 @@ class instances status: typing_extensions.Literal[ '200', ] - api_response = _status_code_to_response[status].deserialize(response, self.api_client.schema_configuration) + api_response = _status_code_to_response[status].deserialize( + response, self.api_client.schema_configuration) else: api_response = api_client.ApiResponseWithoutDeserialization(response=response) diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_by_number_response_body_for_content_types/post/responses/response_200/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_by_number_response_body_for_content_types/post/responses/response_200/__init__.py index 5f51d512bcc..790e742c513 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_by_number_response_body_for_content_types/post/responses/response_200/__init__.py +++ b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_by_number_response_body_for_content_types/post/responses/response_200/__init__.py @@ -25,9 +25,7 @@ @dataclasses.dataclass class _ApiResponse(api_client.ApiResponse): response: urllib3.HTTPResponse - body: typing.Union[ - application_json_schema.Schema, - ] + body: application_json_schema.Schema headers: schemas.Unset = schemas.unset diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_by_small_number_response_body_for_content_types/post/operation.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_by_small_number_response_body_for_content_types/post/operation.py index 68ce8ea35ab..47341632d3a 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_by_small_number_response_body_for_content_types/post/operation.py +++ b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_by_small_number_response_body_for_content_types/post/operation.py @@ -120,7 +120,8 @@ class instances status: typing_extensions.Literal[ '200', ] - api_response = _status_code_to_response[status].deserialize(response, self.api_client.schema_configuration) + api_response = _status_code_to_response[status].deserialize( + response, self.api_client.schema_configuration) else: api_response = api_client.ApiResponseWithoutDeserialization(response=response) diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_by_small_number_response_body_for_content_types/post/responses/response_200/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_by_small_number_response_body_for_content_types/post/responses/response_200/__init__.py index 5f51d512bcc..790e742c513 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_by_small_number_response_body_for_content_types/post/responses/response_200/__init__.py +++ b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_by_small_number_response_body_for_content_types/post/responses/response_200/__init__.py @@ -25,9 +25,7 @@ @dataclasses.dataclass class _ApiResponse(api_client.ApiResponse): response: urllib3.HTTPResponse - body: typing.Union[ - application_json_schema.Schema, - ] + body: application_json_schema.Schema headers: schemas.Unset = schemas.unset diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_date_time_format_response_body_for_content_types/post/operation.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_date_time_format_response_body_for_content_types/post/operation.py index 6ec2c8f4767..522cf78b608 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_date_time_format_response_body_for_content_types/post/operation.py +++ b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_date_time_format_response_body_for_content_types/post/operation.py @@ -120,7 +120,8 @@ class instances status: typing_extensions.Literal[ '200', ] - api_response = _status_code_to_response[status].deserialize(response, self.api_client.schema_configuration) + api_response = _status_code_to_response[status].deserialize( + response, self.api_client.schema_configuration) else: api_response = api_client.ApiResponseWithoutDeserialization(response=response) diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_date_time_format_response_body_for_content_types/post/responses/response_200/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_date_time_format_response_body_for_content_types/post/responses/response_200/__init__.py index 5f51d512bcc..790e742c513 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_date_time_format_response_body_for_content_types/post/responses/response_200/__init__.py +++ b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_date_time_format_response_body_for_content_types/post/responses/response_200/__init__.py @@ -25,9 +25,7 @@ @dataclasses.dataclass class _ApiResponse(api_client.ApiResponse): response: urllib3.HTTPResponse - body: typing.Union[ - application_json_schema.Schema, - ] + body: application_json_schema.Schema headers: schemas.Unset = schemas.unset diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_email_format_response_body_for_content_types/post/operation.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_email_format_response_body_for_content_types/post/operation.py index 589b375781f..cf8a830b4b2 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_email_format_response_body_for_content_types/post/operation.py +++ b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_email_format_response_body_for_content_types/post/operation.py @@ -120,7 +120,8 @@ class instances status: typing_extensions.Literal[ '200', ] - api_response = _status_code_to_response[status].deserialize(response, self.api_client.schema_configuration) + api_response = _status_code_to_response[status].deserialize( + response, self.api_client.schema_configuration) else: api_response = api_client.ApiResponseWithoutDeserialization(response=response) diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_email_format_response_body_for_content_types/post/responses/response_200/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_email_format_response_body_for_content_types/post/responses/response_200/__init__.py index 5f51d512bcc..790e742c513 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_email_format_response_body_for_content_types/post/responses/response_200/__init__.py +++ b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_email_format_response_body_for_content_types/post/responses/response_200/__init__.py @@ -25,9 +25,7 @@ @dataclasses.dataclass class _ApiResponse(api_client.ApiResponse): response: urllib3.HTTPResponse - body: typing.Union[ - application_json_schema.Schema, - ] + body: application_json_schema.Schema headers: schemas.Unset = schemas.unset diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_enum_with0_does_not_match_false_response_body_for_content_types/post/operation.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_enum_with0_does_not_match_false_response_body_for_content_types/post/operation.py index 272a9d099be..7ba414586d2 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_enum_with0_does_not_match_false_response_body_for_content_types/post/operation.py +++ b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_enum_with0_does_not_match_false_response_body_for_content_types/post/operation.py @@ -120,7 +120,8 @@ class instances status: typing_extensions.Literal[ '200', ] - api_response = _status_code_to_response[status].deserialize(response, self.api_client.schema_configuration) + api_response = _status_code_to_response[status].deserialize( + response, self.api_client.schema_configuration) else: api_response = api_client.ApiResponseWithoutDeserialization(response=response) diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_enum_with0_does_not_match_false_response_body_for_content_types/post/responses/response_200/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_enum_with0_does_not_match_false_response_body_for_content_types/post/responses/response_200/__init__.py index 5f51d512bcc..790e742c513 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_enum_with0_does_not_match_false_response_body_for_content_types/post/responses/response_200/__init__.py +++ b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_enum_with0_does_not_match_false_response_body_for_content_types/post/responses/response_200/__init__.py @@ -25,9 +25,7 @@ @dataclasses.dataclass class _ApiResponse(api_client.ApiResponse): response: urllib3.HTTPResponse - body: typing.Union[ - application_json_schema.Schema, - ] + body: application_json_schema.Schema headers: schemas.Unset = schemas.unset diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_enum_with1_does_not_match_true_response_body_for_content_types/post/operation.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_enum_with1_does_not_match_true_response_body_for_content_types/post/operation.py index f783383490f..82bd506da71 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_enum_with1_does_not_match_true_response_body_for_content_types/post/operation.py +++ b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_enum_with1_does_not_match_true_response_body_for_content_types/post/operation.py @@ -120,7 +120,8 @@ class instances status: typing_extensions.Literal[ '200', ] - api_response = _status_code_to_response[status].deserialize(response, self.api_client.schema_configuration) + api_response = _status_code_to_response[status].deserialize( + response, self.api_client.schema_configuration) else: api_response = api_client.ApiResponseWithoutDeserialization(response=response) diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_enum_with1_does_not_match_true_response_body_for_content_types/post/responses/response_200/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_enum_with1_does_not_match_true_response_body_for_content_types/post/responses/response_200/__init__.py index 5f51d512bcc..790e742c513 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_enum_with1_does_not_match_true_response_body_for_content_types/post/responses/response_200/__init__.py +++ b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_enum_with1_does_not_match_true_response_body_for_content_types/post/responses/response_200/__init__.py @@ -25,9 +25,7 @@ @dataclasses.dataclass class _ApiResponse(api_client.ApiResponse): response: urllib3.HTTPResponse - body: typing.Union[ - application_json_schema.Schema, - ] + body: application_json_schema.Schema headers: schemas.Unset = schemas.unset diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_enum_with_escaped_characters_response_body_for_content_types/post/operation.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_enum_with_escaped_characters_response_body_for_content_types/post/operation.py index 053a728a035..01eee146e88 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_enum_with_escaped_characters_response_body_for_content_types/post/operation.py +++ b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_enum_with_escaped_characters_response_body_for_content_types/post/operation.py @@ -120,7 +120,8 @@ class instances status: typing_extensions.Literal[ '200', ] - api_response = _status_code_to_response[status].deserialize(response, self.api_client.schema_configuration) + api_response = _status_code_to_response[status].deserialize( + response, self.api_client.schema_configuration) else: api_response = api_client.ApiResponseWithoutDeserialization(response=response) diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_enum_with_escaped_characters_response_body_for_content_types/post/responses/response_200/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_enum_with_escaped_characters_response_body_for_content_types/post/responses/response_200/__init__.py index 5f51d512bcc..790e742c513 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_enum_with_escaped_characters_response_body_for_content_types/post/responses/response_200/__init__.py +++ b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_enum_with_escaped_characters_response_body_for_content_types/post/responses/response_200/__init__.py @@ -25,9 +25,7 @@ @dataclasses.dataclass class _ApiResponse(api_client.ApiResponse): response: urllib3.HTTPResponse - body: typing.Union[ - application_json_schema.Schema, - ] + body: application_json_schema.Schema headers: schemas.Unset = schemas.unset diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_enum_with_false_does_not_match0_response_body_for_content_types/post/operation.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_enum_with_false_does_not_match0_response_body_for_content_types/post/operation.py index c0bc4fd9c02..f7f6cb46324 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_enum_with_false_does_not_match0_response_body_for_content_types/post/operation.py +++ b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_enum_with_false_does_not_match0_response_body_for_content_types/post/operation.py @@ -120,7 +120,8 @@ class instances status: typing_extensions.Literal[ '200', ] - api_response = _status_code_to_response[status].deserialize(response, self.api_client.schema_configuration) + api_response = _status_code_to_response[status].deserialize( + response, self.api_client.schema_configuration) else: api_response = api_client.ApiResponseWithoutDeserialization(response=response) diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_enum_with_false_does_not_match0_response_body_for_content_types/post/responses/response_200/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_enum_with_false_does_not_match0_response_body_for_content_types/post/responses/response_200/__init__.py index 5f51d512bcc..790e742c513 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_enum_with_false_does_not_match0_response_body_for_content_types/post/responses/response_200/__init__.py +++ b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_enum_with_false_does_not_match0_response_body_for_content_types/post/responses/response_200/__init__.py @@ -25,9 +25,7 @@ @dataclasses.dataclass class _ApiResponse(api_client.ApiResponse): response: urllib3.HTTPResponse - body: typing.Union[ - application_json_schema.Schema, - ] + body: application_json_schema.Schema headers: schemas.Unset = schemas.unset diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_enum_with_true_does_not_match1_response_body_for_content_types/post/operation.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_enum_with_true_does_not_match1_response_body_for_content_types/post/operation.py index c509a6c1f8e..4423382bdc0 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_enum_with_true_does_not_match1_response_body_for_content_types/post/operation.py +++ b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_enum_with_true_does_not_match1_response_body_for_content_types/post/operation.py @@ -120,7 +120,8 @@ class instances status: typing_extensions.Literal[ '200', ] - api_response = _status_code_to_response[status].deserialize(response, self.api_client.schema_configuration) + api_response = _status_code_to_response[status].deserialize( + response, self.api_client.schema_configuration) else: api_response = api_client.ApiResponseWithoutDeserialization(response=response) diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_enum_with_true_does_not_match1_response_body_for_content_types/post/responses/response_200/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_enum_with_true_does_not_match1_response_body_for_content_types/post/responses/response_200/__init__.py index 5f51d512bcc..790e742c513 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_enum_with_true_does_not_match1_response_body_for_content_types/post/responses/response_200/__init__.py +++ b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_enum_with_true_does_not_match1_response_body_for_content_types/post/responses/response_200/__init__.py @@ -25,9 +25,7 @@ @dataclasses.dataclass class _ApiResponse(api_client.ApiResponse): response: urllib3.HTTPResponse - body: typing.Union[ - application_json_schema.Schema, - ] + body: application_json_schema.Schema headers: schemas.Unset = schemas.unset diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_enums_in_properties_response_body_for_content_types/post/operation.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_enums_in_properties_response_body_for_content_types/post/operation.py index 33ebb0ff18d..86164e592e9 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_enums_in_properties_response_body_for_content_types/post/operation.py +++ b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_enums_in_properties_response_body_for_content_types/post/operation.py @@ -120,7 +120,8 @@ class instances status: typing_extensions.Literal[ '200', ] - api_response = _status_code_to_response[status].deserialize(response, self.api_client.schema_configuration) + api_response = _status_code_to_response[status].deserialize( + response, self.api_client.schema_configuration) else: api_response = api_client.ApiResponseWithoutDeserialization(response=response) diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_enums_in_properties_response_body_for_content_types/post/responses/response_200/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_enums_in_properties_response_body_for_content_types/post/responses/response_200/__init__.py index 5f51d512bcc..790e742c513 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_enums_in_properties_response_body_for_content_types/post/responses/response_200/__init__.py +++ b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_enums_in_properties_response_body_for_content_types/post/responses/response_200/__init__.py @@ -25,9 +25,7 @@ @dataclasses.dataclass class _ApiResponse(api_client.ApiResponse): response: urllib3.HTTPResponse - body: typing.Union[ - application_json_schema.Schema, - ] + body: application_json_schema.Schema headers: schemas.Unset = schemas.unset diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_forbidden_property_response_body_for_content_types/post/operation.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_forbidden_property_response_body_for_content_types/post/operation.py index 8c1d06f8793..72919573fb3 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_forbidden_property_response_body_for_content_types/post/operation.py +++ b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_forbidden_property_response_body_for_content_types/post/operation.py @@ -120,7 +120,8 @@ class instances status: typing_extensions.Literal[ '200', ] - api_response = _status_code_to_response[status].deserialize(response, self.api_client.schema_configuration) + api_response = _status_code_to_response[status].deserialize( + response, self.api_client.schema_configuration) else: api_response = api_client.ApiResponseWithoutDeserialization(response=response) diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_forbidden_property_response_body_for_content_types/post/responses/response_200/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_forbidden_property_response_body_for_content_types/post/responses/response_200/__init__.py index 5f51d512bcc..790e742c513 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_forbidden_property_response_body_for_content_types/post/responses/response_200/__init__.py +++ b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_forbidden_property_response_body_for_content_types/post/responses/response_200/__init__.py @@ -25,9 +25,7 @@ @dataclasses.dataclass class _ApiResponse(api_client.ApiResponse): response: urllib3.HTTPResponse - body: typing.Union[ - application_json_schema.Schema, - ] + body: application_json_schema.Schema headers: schemas.Unset = schemas.unset diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_hostname_format_response_body_for_content_types/post/operation.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_hostname_format_response_body_for_content_types/post/operation.py index 83320f555f0..6a3bb12e547 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_hostname_format_response_body_for_content_types/post/operation.py +++ b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_hostname_format_response_body_for_content_types/post/operation.py @@ -120,7 +120,8 @@ class instances status: typing_extensions.Literal[ '200', ] - api_response = _status_code_to_response[status].deserialize(response, self.api_client.schema_configuration) + api_response = _status_code_to_response[status].deserialize( + response, self.api_client.schema_configuration) else: api_response = api_client.ApiResponseWithoutDeserialization(response=response) diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_hostname_format_response_body_for_content_types/post/responses/response_200/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_hostname_format_response_body_for_content_types/post/responses/response_200/__init__.py index 5f51d512bcc..790e742c513 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_hostname_format_response_body_for_content_types/post/responses/response_200/__init__.py +++ b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_hostname_format_response_body_for_content_types/post/responses/response_200/__init__.py @@ -25,9 +25,7 @@ @dataclasses.dataclass class _ApiResponse(api_client.ApiResponse): response: urllib3.HTTPResponse - body: typing.Union[ - application_json_schema.Schema, - ] + body: application_json_schema.Schema headers: schemas.Unset = schemas.unset diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_integer_type_matches_integers_response_body_for_content_types/post/operation.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_integer_type_matches_integers_response_body_for_content_types/post/operation.py index 33f0e71ada6..3d12f1cd89c 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_integer_type_matches_integers_response_body_for_content_types/post/operation.py +++ b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_integer_type_matches_integers_response_body_for_content_types/post/operation.py @@ -120,7 +120,8 @@ class instances status: typing_extensions.Literal[ '200', ] - api_response = _status_code_to_response[status].deserialize(response, self.api_client.schema_configuration) + api_response = _status_code_to_response[status].deserialize( + response, self.api_client.schema_configuration) else: api_response = api_client.ApiResponseWithoutDeserialization(response=response) diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_integer_type_matches_integers_response_body_for_content_types/post/responses/response_200/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_integer_type_matches_integers_response_body_for_content_types/post/responses/response_200/__init__.py index 5f51d512bcc..790e742c513 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_integer_type_matches_integers_response_body_for_content_types/post/responses/response_200/__init__.py +++ b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_integer_type_matches_integers_response_body_for_content_types/post/responses/response_200/__init__.py @@ -25,9 +25,7 @@ @dataclasses.dataclass class _ApiResponse(api_client.ApiResponse): response: urllib3.HTTPResponse - body: typing.Union[ - application_json_schema.Schema, - ] + body: application_json_schema.Schema headers: schemas.Unset = schemas.unset diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_invalid_instance_should_not_raise_error_when_float_division_inf_response_body_for_content_types/post/operation.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_invalid_instance_should_not_raise_error_when_float_division_inf_response_body_for_content_types/post/operation.py index 721dc21c9e2..4182ff73741 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_invalid_instance_should_not_raise_error_when_float_division_inf_response_body_for_content_types/post/operation.py +++ b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_invalid_instance_should_not_raise_error_when_float_division_inf_response_body_for_content_types/post/operation.py @@ -120,7 +120,8 @@ class instances status: typing_extensions.Literal[ '200', ] - api_response = _status_code_to_response[status].deserialize(response, self.api_client.schema_configuration) + api_response = _status_code_to_response[status].deserialize( + response, self.api_client.schema_configuration) else: api_response = api_client.ApiResponseWithoutDeserialization(response=response) diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_invalid_instance_should_not_raise_error_when_float_division_inf_response_body_for_content_types/post/responses/response_200/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_invalid_instance_should_not_raise_error_when_float_division_inf_response_body_for_content_types/post/responses/response_200/__init__.py index 5f51d512bcc..790e742c513 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_invalid_instance_should_not_raise_error_when_float_division_inf_response_body_for_content_types/post/responses/response_200/__init__.py +++ b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_invalid_instance_should_not_raise_error_when_float_division_inf_response_body_for_content_types/post/responses/response_200/__init__.py @@ -25,9 +25,7 @@ @dataclasses.dataclass class _ApiResponse(api_client.ApiResponse): response: urllib3.HTTPResponse - body: typing.Union[ - application_json_schema.Schema, - ] + body: application_json_schema.Schema headers: schemas.Unset = schemas.unset diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_invalid_string_value_for_default_response_body_for_content_types/post/operation.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_invalid_string_value_for_default_response_body_for_content_types/post/operation.py index a8165d8074f..33754c0c1b5 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_invalid_string_value_for_default_response_body_for_content_types/post/operation.py +++ b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_invalid_string_value_for_default_response_body_for_content_types/post/operation.py @@ -120,7 +120,8 @@ class instances status: typing_extensions.Literal[ '200', ] - api_response = _status_code_to_response[status].deserialize(response, self.api_client.schema_configuration) + api_response = _status_code_to_response[status].deserialize( + response, self.api_client.schema_configuration) else: api_response = api_client.ApiResponseWithoutDeserialization(response=response) diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_invalid_string_value_for_default_response_body_for_content_types/post/responses/response_200/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_invalid_string_value_for_default_response_body_for_content_types/post/responses/response_200/__init__.py index 5f51d512bcc..790e742c513 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_invalid_string_value_for_default_response_body_for_content_types/post/responses/response_200/__init__.py +++ b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_invalid_string_value_for_default_response_body_for_content_types/post/responses/response_200/__init__.py @@ -25,9 +25,7 @@ @dataclasses.dataclass class _ApiResponse(api_client.ApiResponse): response: urllib3.HTTPResponse - body: typing.Union[ - application_json_schema.Schema, - ] + body: application_json_schema.Schema headers: schemas.Unset = schemas.unset diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_ipv4_format_response_body_for_content_types/post/operation.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_ipv4_format_response_body_for_content_types/post/operation.py index 5b04ac75ee7..8c6bdeff5fb 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_ipv4_format_response_body_for_content_types/post/operation.py +++ b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_ipv4_format_response_body_for_content_types/post/operation.py @@ -120,7 +120,8 @@ class instances status: typing_extensions.Literal[ '200', ] - api_response = _status_code_to_response[status].deserialize(response, self.api_client.schema_configuration) + api_response = _status_code_to_response[status].deserialize( + response, self.api_client.schema_configuration) else: api_response = api_client.ApiResponseWithoutDeserialization(response=response) diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_ipv4_format_response_body_for_content_types/post/responses/response_200/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_ipv4_format_response_body_for_content_types/post/responses/response_200/__init__.py index 5f51d512bcc..790e742c513 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_ipv4_format_response_body_for_content_types/post/responses/response_200/__init__.py +++ b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_ipv4_format_response_body_for_content_types/post/responses/response_200/__init__.py @@ -25,9 +25,7 @@ @dataclasses.dataclass class _ApiResponse(api_client.ApiResponse): response: urllib3.HTTPResponse - body: typing.Union[ - application_json_schema.Schema, - ] + body: application_json_schema.Schema headers: schemas.Unset = schemas.unset diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_ipv6_format_response_body_for_content_types/post/operation.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_ipv6_format_response_body_for_content_types/post/operation.py index 792037c1675..8ca7d3b210b 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_ipv6_format_response_body_for_content_types/post/operation.py +++ b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_ipv6_format_response_body_for_content_types/post/operation.py @@ -120,7 +120,8 @@ class instances status: typing_extensions.Literal[ '200', ] - api_response = _status_code_to_response[status].deserialize(response, self.api_client.schema_configuration) + api_response = _status_code_to_response[status].deserialize( + response, self.api_client.schema_configuration) else: api_response = api_client.ApiResponseWithoutDeserialization(response=response) diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_ipv6_format_response_body_for_content_types/post/responses/response_200/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_ipv6_format_response_body_for_content_types/post/responses/response_200/__init__.py index 5f51d512bcc..790e742c513 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_ipv6_format_response_body_for_content_types/post/responses/response_200/__init__.py +++ b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_ipv6_format_response_body_for_content_types/post/responses/response_200/__init__.py @@ -25,9 +25,7 @@ @dataclasses.dataclass class _ApiResponse(api_client.ApiResponse): response: urllib3.HTTPResponse - body: typing.Union[ - application_json_schema.Schema, - ] + body: application_json_schema.Schema headers: schemas.Unset = schemas.unset diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_json_pointer_format_response_body_for_content_types/post/operation.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_json_pointer_format_response_body_for_content_types/post/operation.py index ae6f65a7ed3..9ca0342b6d0 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_json_pointer_format_response_body_for_content_types/post/operation.py +++ b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_json_pointer_format_response_body_for_content_types/post/operation.py @@ -120,7 +120,8 @@ class instances status: typing_extensions.Literal[ '200', ] - api_response = _status_code_to_response[status].deserialize(response, self.api_client.schema_configuration) + api_response = _status_code_to_response[status].deserialize( + response, self.api_client.schema_configuration) else: api_response = api_client.ApiResponseWithoutDeserialization(response=response) diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_json_pointer_format_response_body_for_content_types/post/responses/response_200/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_json_pointer_format_response_body_for_content_types/post/responses/response_200/__init__.py index 5f51d512bcc..790e742c513 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_json_pointer_format_response_body_for_content_types/post/responses/response_200/__init__.py +++ b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_json_pointer_format_response_body_for_content_types/post/responses/response_200/__init__.py @@ -25,9 +25,7 @@ @dataclasses.dataclass class _ApiResponse(api_client.ApiResponse): response: urllib3.HTTPResponse - body: typing.Union[ - application_json_schema.Schema, - ] + body: application_json_schema.Schema headers: schemas.Unset = schemas.unset diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_maximum_validation_response_body_for_content_types/post/operation.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_maximum_validation_response_body_for_content_types/post/operation.py index b02853b5984..235516b9422 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_maximum_validation_response_body_for_content_types/post/operation.py +++ b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_maximum_validation_response_body_for_content_types/post/operation.py @@ -120,7 +120,8 @@ class instances status: typing_extensions.Literal[ '200', ] - api_response = _status_code_to_response[status].deserialize(response, self.api_client.schema_configuration) + api_response = _status_code_to_response[status].deserialize( + response, self.api_client.schema_configuration) else: api_response = api_client.ApiResponseWithoutDeserialization(response=response) diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_maximum_validation_response_body_for_content_types/post/responses/response_200/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_maximum_validation_response_body_for_content_types/post/responses/response_200/__init__.py index 5f51d512bcc..790e742c513 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_maximum_validation_response_body_for_content_types/post/responses/response_200/__init__.py +++ b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_maximum_validation_response_body_for_content_types/post/responses/response_200/__init__.py @@ -25,9 +25,7 @@ @dataclasses.dataclass class _ApiResponse(api_client.ApiResponse): response: urllib3.HTTPResponse - body: typing.Union[ - application_json_schema.Schema, - ] + body: application_json_schema.Schema headers: schemas.Unset = schemas.unset diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_maximum_validation_with_unsigned_integer_response_body_for_content_types/post/operation.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_maximum_validation_with_unsigned_integer_response_body_for_content_types/post/operation.py index 32b3fe4a564..fcb330346fb 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_maximum_validation_with_unsigned_integer_response_body_for_content_types/post/operation.py +++ b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_maximum_validation_with_unsigned_integer_response_body_for_content_types/post/operation.py @@ -120,7 +120,8 @@ class instances status: typing_extensions.Literal[ '200', ] - api_response = _status_code_to_response[status].deserialize(response, self.api_client.schema_configuration) + api_response = _status_code_to_response[status].deserialize( + response, self.api_client.schema_configuration) else: api_response = api_client.ApiResponseWithoutDeserialization(response=response) diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_maximum_validation_with_unsigned_integer_response_body_for_content_types/post/responses/response_200/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_maximum_validation_with_unsigned_integer_response_body_for_content_types/post/responses/response_200/__init__.py index 5f51d512bcc..790e742c513 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_maximum_validation_with_unsigned_integer_response_body_for_content_types/post/responses/response_200/__init__.py +++ b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_maximum_validation_with_unsigned_integer_response_body_for_content_types/post/responses/response_200/__init__.py @@ -25,9 +25,7 @@ @dataclasses.dataclass class _ApiResponse(api_client.ApiResponse): response: urllib3.HTTPResponse - body: typing.Union[ - application_json_schema.Schema, - ] + body: application_json_schema.Schema headers: schemas.Unset = schemas.unset diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_maxitems_validation_response_body_for_content_types/post/operation.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_maxitems_validation_response_body_for_content_types/post/operation.py index 8661605be42..2f89c5487b0 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_maxitems_validation_response_body_for_content_types/post/operation.py +++ b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_maxitems_validation_response_body_for_content_types/post/operation.py @@ -120,7 +120,8 @@ class instances status: typing_extensions.Literal[ '200', ] - api_response = _status_code_to_response[status].deserialize(response, self.api_client.schema_configuration) + api_response = _status_code_to_response[status].deserialize( + response, self.api_client.schema_configuration) else: api_response = api_client.ApiResponseWithoutDeserialization(response=response) diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_maxitems_validation_response_body_for_content_types/post/responses/response_200/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_maxitems_validation_response_body_for_content_types/post/responses/response_200/__init__.py index 5f51d512bcc..790e742c513 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_maxitems_validation_response_body_for_content_types/post/responses/response_200/__init__.py +++ b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_maxitems_validation_response_body_for_content_types/post/responses/response_200/__init__.py @@ -25,9 +25,7 @@ @dataclasses.dataclass class _ApiResponse(api_client.ApiResponse): response: urllib3.HTTPResponse - body: typing.Union[ - application_json_schema.Schema, - ] + body: application_json_schema.Schema headers: schemas.Unset = schemas.unset diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_maxlength_validation_response_body_for_content_types/post/operation.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_maxlength_validation_response_body_for_content_types/post/operation.py index d11beb00617..1e6222188c9 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_maxlength_validation_response_body_for_content_types/post/operation.py +++ b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_maxlength_validation_response_body_for_content_types/post/operation.py @@ -120,7 +120,8 @@ class instances status: typing_extensions.Literal[ '200', ] - api_response = _status_code_to_response[status].deserialize(response, self.api_client.schema_configuration) + api_response = _status_code_to_response[status].deserialize( + response, self.api_client.schema_configuration) else: api_response = api_client.ApiResponseWithoutDeserialization(response=response) diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_maxlength_validation_response_body_for_content_types/post/responses/response_200/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_maxlength_validation_response_body_for_content_types/post/responses/response_200/__init__.py index 5f51d512bcc..790e742c513 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_maxlength_validation_response_body_for_content_types/post/responses/response_200/__init__.py +++ b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_maxlength_validation_response_body_for_content_types/post/responses/response_200/__init__.py @@ -25,9 +25,7 @@ @dataclasses.dataclass class _ApiResponse(api_client.ApiResponse): response: urllib3.HTTPResponse - body: typing.Union[ - application_json_schema.Schema, - ] + body: application_json_schema.Schema headers: schemas.Unset = schemas.unset diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_maxproperties0_means_the_object_is_empty_response_body_for_content_types/post/operation.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_maxproperties0_means_the_object_is_empty_response_body_for_content_types/post/operation.py index 96281388e90..5a147738cf7 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_maxproperties0_means_the_object_is_empty_response_body_for_content_types/post/operation.py +++ b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_maxproperties0_means_the_object_is_empty_response_body_for_content_types/post/operation.py @@ -120,7 +120,8 @@ class instances status: typing_extensions.Literal[ '200', ] - api_response = _status_code_to_response[status].deserialize(response, self.api_client.schema_configuration) + api_response = _status_code_to_response[status].deserialize( + response, self.api_client.schema_configuration) else: api_response = api_client.ApiResponseWithoutDeserialization(response=response) diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_maxproperties0_means_the_object_is_empty_response_body_for_content_types/post/responses/response_200/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_maxproperties0_means_the_object_is_empty_response_body_for_content_types/post/responses/response_200/__init__.py index 5f51d512bcc..790e742c513 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_maxproperties0_means_the_object_is_empty_response_body_for_content_types/post/responses/response_200/__init__.py +++ b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_maxproperties0_means_the_object_is_empty_response_body_for_content_types/post/responses/response_200/__init__.py @@ -25,9 +25,7 @@ @dataclasses.dataclass class _ApiResponse(api_client.ApiResponse): response: urllib3.HTTPResponse - body: typing.Union[ - application_json_schema.Schema, - ] + body: application_json_schema.Schema headers: schemas.Unset = schemas.unset diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_maxproperties_validation_response_body_for_content_types/post/operation.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_maxproperties_validation_response_body_for_content_types/post/operation.py index 16c994e6149..6fdadfe7a9d 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_maxproperties_validation_response_body_for_content_types/post/operation.py +++ b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_maxproperties_validation_response_body_for_content_types/post/operation.py @@ -120,7 +120,8 @@ class instances status: typing_extensions.Literal[ '200', ] - api_response = _status_code_to_response[status].deserialize(response, self.api_client.schema_configuration) + api_response = _status_code_to_response[status].deserialize( + response, self.api_client.schema_configuration) else: api_response = api_client.ApiResponseWithoutDeserialization(response=response) diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_maxproperties_validation_response_body_for_content_types/post/responses/response_200/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_maxproperties_validation_response_body_for_content_types/post/responses/response_200/__init__.py index 5f51d512bcc..790e742c513 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_maxproperties_validation_response_body_for_content_types/post/responses/response_200/__init__.py +++ b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_maxproperties_validation_response_body_for_content_types/post/responses/response_200/__init__.py @@ -25,9 +25,7 @@ @dataclasses.dataclass class _ApiResponse(api_client.ApiResponse): response: urllib3.HTTPResponse - body: typing.Union[ - application_json_schema.Schema, - ] + body: application_json_schema.Schema headers: schemas.Unset = schemas.unset diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_minimum_validation_response_body_for_content_types/post/operation.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_minimum_validation_response_body_for_content_types/post/operation.py index 9f38965cb06..19b61205ad3 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_minimum_validation_response_body_for_content_types/post/operation.py +++ b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_minimum_validation_response_body_for_content_types/post/operation.py @@ -120,7 +120,8 @@ class instances status: typing_extensions.Literal[ '200', ] - api_response = _status_code_to_response[status].deserialize(response, self.api_client.schema_configuration) + api_response = _status_code_to_response[status].deserialize( + response, self.api_client.schema_configuration) else: api_response = api_client.ApiResponseWithoutDeserialization(response=response) diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_minimum_validation_response_body_for_content_types/post/responses/response_200/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_minimum_validation_response_body_for_content_types/post/responses/response_200/__init__.py index 5f51d512bcc..790e742c513 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_minimum_validation_response_body_for_content_types/post/responses/response_200/__init__.py +++ b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_minimum_validation_response_body_for_content_types/post/responses/response_200/__init__.py @@ -25,9 +25,7 @@ @dataclasses.dataclass class _ApiResponse(api_client.ApiResponse): response: urllib3.HTTPResponse - body: typing.Union[ - application_json_schema.Schema, - ] + body: application_json_schema.Schema headers: schemas.Unset = schemas.unset diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_minimum_validation_with_signed_integer_response_body_for_content_types/post/operation.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_minimum_validation_with_signed_integer_response_body_for_content_types/post/operation.py index af7954e6fdc..24861f45d11 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_minimum_validation_with_signed_integer_response_body_for_content_types/post/operation.py +++ b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_minimum_validation_with_signed_integer_response_body_for_content_types/post/operation.py @@ -120,7 +120,8 @@ class instances status: typing_extensions.Literal[ '200', ] - api_response = _status_code_to_response[status].deserialize(response, self.api_client.schema_configuration) + api_response = _status_code_to_response[status].deserialize( + response, self.api_client.schema_configuration) else: api_response = api_client.ApiResponseWithoutDeserialization(response=response) diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_minimum_validation_with_signed_integer_response_body_for_content_types/post/responses/response_200/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_minimum_validation_with_signed_integer_response_body_for_content_types/post/responses/response_200/__init__.py index 5f51d512bcc..790e742c513 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_minimum_validation_with_signed_integer_response_body_for_content_types/post/responses/response_200/__init__.py +++ b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_minimum_validation_with_signed_integer_response_body_for_content_types/post/responses/response_200/__init__.py @@ -25,9 +25,7 @@ @dataclasses.dataclass class _ApiResponse(api_client.ApiResponse): response: urllib3.HTTPResponse - body: typing.Union[ - application_json_schema.Schema, - ] + body: application_json_schema.Schema headers: schemas.Unset = schemas.unset diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_minitems_validation_response_body_for_content_types/post/operation.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_minitems_validation_response_body_for_content_types/post/operation.py index 620f04d9302..023e5186a5b 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_minitems_validation_response_body_for_content_types/post/operation.py +++ b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_minitems_validation_response_body_for_content_types/post/operation.py @@ -120,7 +120,8 @@ class instances status: typing_extensions.Literal[ '200', ] - api_response = _status_code_to_response[status].deserialize(response, self.api_client.schema_configuration) + api_response = _status_code_to_response[status].deserialize( + response, self.api_client.schema_configuration) else: api_response = api_client.ApiResponseWithoutDeserialization(response=response) diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_minitems_validation_response_body_for_content_types/post/responses/response_200/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_minitems_validation_response_body_for_content_types/post/responses/response_200/__init__.py index 5f51d512bcc..790e742c513 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_minitems_validation_response_body_for_content_types/post/responses/response_200/__init__.py +++ b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_minitems_validation_response_body_for_content_types/post/responses/response_200/__init__.py @@ -25,9 +25,7 @@ @dataclasses.dataclass class _ApiResponse(api_client.ApiResponse): response: urllib3.HTTPResponse - body: typing.Union[ - application_json_schema.Schema, - ] + body: application_json_schema.Schema headers: schemas.Unset = schemas.unset diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_minlength_validation_response_body_for_content_types/post/operation.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_minlength_validation_response_body_for_content_types/post/operation.py index 77f1a701453..8f6c6f9ca7d 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_minlength_validation_response_body_for_content_types/post/operation.py +++ b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_minlength_validation_response_body_for_content_types/post/operation.py @@ -120,7 +120,8 @@ class instances status: typing_extensions.Literal[ '200', ] - api_response = _status_code_to_response[status].deserialize(response, self.api_client.schema_configuration) + api_response = _status_code_to_response[status].deserialize( + response, self.api_client.schema_configuration) else: api_response = api_client.ApiResponseWithoutDeserialization(response=response) diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_minlength_validation_response_body_for_content_types/post/responses/response_200/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_minlength_validation_response_body_for_content_types/post/responses/response_200/__init__.py index 5f51d512bcc..790e742c513 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_minlength_validation_response_body_for_content_types/post/responses/response_200/__init__.py +++ b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_minlength_validation_response_body_for_content_types/post/responses/response_200/__init__.py @@ -25,9 +25,7 @@ @dataclasses.dataclass class _ApiResponse(api_client.ApiResponse): response: urllib3.HTTPResponse - body: typing.Union[ - application_json_schema.Schema, - ] + body: application_json_schema.Schema headers: schemas.Unset = schemas.unset diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_minproperties_validation_response_body_for_content_types/post/operation.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_minproperties_validation_response_body_for_content_types/post/operation.py index 2e769b30bbf..3488fc16d7a 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_minproperties_validation_response_body_for_content_types/post/operation.py +++ b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_minproperties_validation_response_body_for_content_types/post/operation.py @@ -120,7 +120,8 @@ class instances status: typing_extensions.Literal[ '200', ] - api_response = _status_code_to_response[status].deserialize(response, self.api_client.schema_configuration) + api_response = _status_code_to_response[status].deserialize( + response, self.api_client.schema_configuration) else: api_response = api_client.ApiResponseWithoutDeserialization(response=response) diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_minproperties_validation_response_body_for_content_types/post/responses/response_200/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_minproperties_validation_response_body_for_content_types/post/responses/response_200/__init__.py index 5f51d512bcc..790e742c513 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_minproperties_validation_response_body_for_content_types/post/responses/response_200/__init__.py +++ b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_minproperties_validation_response_body_for_content_types/post/responses/response_200/__init__.py @@ -25,9 +25,7 @@ @dataclasses.dataclass class _ApiResponse(api_client.ApiResponse): response: urllib3.HTTPResponse - body: typing.Union[ - application_json_schema.Schema, - ] + body: application_json_schema.Schema headers: schemas.Unset = schemas.unset diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_nested_allof_to_check_validation_semantics_response_body_for_content_types/post/operation.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_nested_allof_to_check_validation_semantics_response_body_for_content_types/post/operation.py index 3229800db5a..6f36a8a445d 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_nested_allof_to_check_validation_semantics_response_body_for_content_types/post/operation.py +++ b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_nested_allof_to_check_validation_semantics_response_body_for_content_types/post/operation.py @@ -120,7 +120,8 @@ class instances status: typing_extensions.Literal[ '200', ] - api_response = _status_code_to_response[status].deserialize(response, self.api_client.schema_configuration) + api_response = _status_code_to_response[status].deserialize( + response, self.api_client.schema_configuration) else: api_response = api_client.ApiResponseWithoutDeserialization(response=response) diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_nested_allof_to_check_validation_semantics_response_body_for_content_types/post/responses/response_200/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_nested_allof_to_check_validation_semantics_response_body_for_content_types/post/responses/response_200/__init__.py index 5f51d512bcc..790e742c513 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_nested_allof_to_check_validation_semantics_response_body_for_content_types/post/responses/response_200/__init__.py +++ b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_nested_allof_to_check_validation_semantics_response_body_for_content_types/post/responses/response_200/__init__.py @@ -25,9 +25,7 @@ @dataclasses.dataclass class _ApiResponse(api_client.ApiResponse): response: urllib3.HTTPResponse - body: typing.Union[ - application_json_schema.Schema, - ] + body: application_json_schema.Schema headers: schemas.Unset = schemas.unset diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_nested_anyof_to_check_validation_semantics_response_body_for_content_types/post/operation.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_nested_anyof_to_check_validation_semantics_response_body_for_content_types/post/operation.py index 7aff6b36684..448d4ad5942 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_nested_anyof_to_check_validation_semantics_response_body_for_content_types/post/operation.py +++ b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_nested_anyof_to_check_validation_semantics_response_body_for_content_types/post/operation.py @@ -120,7 +120,8 @@ class instances status: typing_extensions.Literal[ '200', ] - api_response = _status_code_to_response[status].deserialize(response, self.api_client.schema_configuration) + api_response = _status_code_to_response[status].deserialize( + response, self.api_client.schema_configuration) else: api_response = api_client.ApiResponseWithoutDeserialization(response=response) diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_nested_anyof_to_check_validation_semantics_response_body_for_content_types/post/responses/response_200/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_nested_anyof_to_check_validation_semantics_response_body_for_content_types/post/responses/response_200/__init__.py index 5f51d512bcc..790e742c513 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_nested_anyof_to_check_validation_semantics_response_body_for_content_types/post/responses/response_200/__init__.py +++ b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_nested_anyof_to_check_validation_semantics_response_body_for_content_types/post/responses/response_200/__init__.py @@ -25,9 +25,7 @@ @dataclasses.dataclass class _ApiResponse(api_client.ApiResponse): response: urllib3.HTTPResponse - body: typing.Union[ - application_json_schema.Schema, - ] + body: application_json_schema.Schema headers: schemas.Unset = schemas.unset diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_nested_items_response_body_for_content_types/post/operation.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_nested_items_response_body_for_content_types/post/operation.py index b279e842155..8d30b213cfd 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_nested_items_response_body_for_content_types/post/operation.py +++ b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_nested_items_response_body_for_content_types/post/operation.py @@ -120,7 +120,8 @@ class instances status: typing_extensions.Literal[ '200', ] - api_response = _status_code_to_response[status].deserialize(response, self.api_client.schema_configuration) + api_response = _status_code_to_response[status].deserialize( + response, self.api_client.schema_configuration) else: api_response = api_client.ApiResponseWithoutDeserialization(response=response) diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_nested_items_response_body_for_content_types/post/responses/response_200/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_nested_items_response_body_for_content_types/post/responses/response_200/__init__.py index 5f51d512bcc..790e742c513 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_nested_items_response_body_for_content_types/post/responses/response_200/__init__.py +++ b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_nested_items_response_body_for_content_types/post/responses/response_200/__init__.py @@ -25,9 +25,7 @@ @dataclasses.dataclass class _ApiResponse(api_client.ApiResponse): response: urllib3.HTTPResponse - body: typing.Union[ - application_json_schema.Schema, - ] + body: application_json_schema.Schema headers: schemas.Unset = schemas.unset diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_nested_oneof_to_check_validation_semantics_response_body_for_content_types/post/operation.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_nested_oneof_to_check_validation_semantics_response_body_for_content_types/post/operation.py index 12ce1b5240f..4c4fe7eb1fb 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_nested_oneof_to_check_validation_semantics_response_body_for_content_types/post/operation.py +++ b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_nested_oneof_to_check_validation_semantics_response_body_for_content_types/post/operation.py @@ -120,7 +120,8 @@ class instances status: typing_extensions.Literal[ '200', ] - api_response = _status_code_to_response[status].deserialize(response, self.api_client.schema_configuration) + api_response = _status_code_to_response[status].deserialize( + response, self.api_client.schema_configuration) else: api_response = api_client.ApiResponseWithoutDeserialization(response=response) diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_nested_oneof_to_check_validation_semantics_response_body_for_content_types/post/responses/response_200/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_nested_oneof_to_check_validation_semantics_response_body_for_content_types/post/responses/response_200/__init__.py index 5f51d512bcc..790e742c513 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_nested_oneof_to_check_validation_semantics_response_body_for_content_types/post/responses/response_200/__init__.py +++ b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_nested_oneof_to_check_validation_semantics_response_body_for_content_types/post/responses/response_200/__init__.py @@ -25,9 +25,7 @@ @dataclasses.dataclass class _ApiResponse(api_client.ApiResponse): response: urllib3.HTTPResponse - body: typing.Union[ - application_json_schema.Schema, - ] + body: application_json_schema.Schema headers: schemas.Unset = schemas.unset diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_not_more_complex_schema_response_body_for_content_types/post/operation.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_not_more_complex_schema_response_body_for_content_types/post/operation.py index 2eae67ad978..488a438d1d0 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_not_more_complex_schema_response_body_for_content_types/post/operation.py +++ b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_not_more_complex_schema_response_body_for_content_types/post/operation.py @@ -120,7 +120,8 @@ class instances status: typing_extensions.Literal[ '200', ] - api_response = _status_code_to_response[status].deserialize(response, self.api_client.schema_configuration) + api_response = _status_code_to_response[status].deserialize( + response, self.api_client.schema_configuration) else: api_response = api_client.ApiResponseWithoutDeserialization(response=response) diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_not_more_complex_schema_response_body_for_content_types/post/responses/response_200/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_not_more_complex_schema_response_body_for_content_types/post/responses/response_200/__init__.py index 5f51d512bcc..790e742c513 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_not_more_complex_schema_response_body_for_content_types/post/responses/response_200/__init__.py +++ b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_not_more_complex_schema_response_body_for_content_types/post/responses/response_200/__init__.py @@ -25,9 +25,7 @@ @dataclasses.dataclass class _ApiResponse(api_client.ApiResponse): response: urllib3.HTTPResponse - body: typing.Union[ - application_json_schema.Schema, - ] + body: application_json_schema.Schema headers: schemas.Unset = schemas.unset diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_not_response_body_for_content_types/post/operation.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_not_response_body_for_content_types/post/operation.py index c707a185299..d753d2805b8 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_not_response_body_for_content_types/post/operation.py +++ b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_not_response_body_for_content_types/post/operation.py @@ -120,7 +120,8 @@ class instances status: typing_extensions.Literal[ '200', ] - api_response = _status_code_to_response[status].deserialize(response, self.api_client.schema_configuration) + api_response = _status_code_to_response[status].deserialize( + response, self.api_client.schema_configuration) else: api_response = api_client.ApiResponseWithoutDeserialization(response=response) diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_not_response_body_for_content_types/post/responses/response_200/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_not_response_body_for_content_types/post/responses/response_200/__init__.py index 5f51d512bcc..790e742c513 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_not_response_body_for_content_types/post/responses/response_200/__init__.py +++ b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_not_response_body_for_content_types/post/responses/response_200/__init__.py @@ -25,9 +25,7 @@ @dataclasses.dataclass class _ApiResponse(api_client.ApiResponse): response: urllib3.HTTPResponse - body: typing.Union[ - application_json_schema.Schema, - ] + body: application_json_schema.Schema headers: schemas.Unset = schemas.unset diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_nul_characters_in_strings_response_body_for_content_types/post/operation.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_nul_characters_in_strings_response_body_for_content_types/post/operation.py index 5402c8ddaeb..0123aa0062e 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_nul_characters_in_strings_response_body_for_content_types/post/operation.py +++ b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_nul_characters_in_strings_response_body_for_content_types/post/operation.py @@ -120,7 +120,8 @@ class instances status: typing_extensions.Literal[ '200', ] - api_response = _status_code_to_response[status].deserialize(response, self.api_client.schema_configuration) + api_response = _status_code_to_response[status].deserialize( + response, self.api_client.schema_configuration) else: api_response = api_client.ApiResponseWithoutDeserialization(response=response) diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_nul_characters_in_strings_response_body_for_content_types/post/responses/response_200/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_nul_characters_in_strings_response_body_for_content_types/post/responses/response_200/__init__.py index 5f51d512bcc..790e742c513 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_nul_characters_in_strings_response_body_for_content_types/post/responses/response_200/__init__.py +++ b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_nul_characters_in_strings_response_body_for_content_types/post/responses/response_200/__init__.py @@ -25,9 +25,7 @@ @dataclasses.dataclass class _ApiResponse(api_client.ApiResponse): response: urllib3.HTTPResponse - body: typing.Union[ - application_json_schema.Schema, - ] + body: application_json_schema.Schema headers: schemas.Unset = schemas.unset diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_null_type_matches_only_the_null_object_response_body_for_content_types/post/operation.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_null_type_matches_only_the_null_object_response_body_for_content_types/post/operation.py index 0b0e844d0fa..4845708657f 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_null_type_matches_only_the_null_object_response_body_for_content_types/post/operation.py +++ b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_null_type_matches_only_the_null_object_response_body_for_content_types/post/operation.py @@ -120,7 +120,8 @@ class instances status: typing_extensions.Literal[ '200', ] - api_response = _status_code_to_response[status].deserialize(response, self.api_client.schema_configuration) + api_response = _status_code_to_response[status].deserialize( + response, self.api_client.schema_configuration) else: api_response = api_client.ApiResponseWithoutDeserialization(response=response) diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_null_type_matches_only_the_null_object_response_body_for_content_types/post/responses/response_200/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_null_type_matches_only_the_null_object_response_body_for_content_types/post/responses/response_200/__init__.py index 5f51d512bcc..790e742c513 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_null_type_matches_only_the_null_object_response_body_for_content_types/post/responses/response_200/__init__.py +++ b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_null_type_matches_only_the_null_object_response_body_for_content_types/post/responses/response_200/__init__.py @@ -25,9 +25,7 @@ @dataclasses.dataclass class _ApiResponse(api_client.ApiResponse): response: urllib3.HTTPResponse - body: typing.Union[ - application_json_schema.Schema, - ] + body: application_json_schema.Schema headers: schemas.Unset = schemas.unset diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_number_type_matches_numbers_response_body_for_content_types/post/operation.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_number_type_matches_numbers_response_body_for_content_types/post/operation.py index 4df6c2008d9..13767eff96d 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_number_type_matches_numbers_response_body_for_content_types/post/operation.py +++ b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_number_type_matches_numbers_response_body_for_content_types/post/operation.py @@ -120,7 +120,8 @@ class instances status: typing_extensions.Literal[ '200', ] - api_response = _status_code_to_response[status].deserialize(response, self.api_client.schema_configuration) + api_response = _status_code_to_response[status].deserialize( + response, self.api_client.schema_configuration) else: api_response = api_client.ApiResponseWithoutDeserialization(response=response) diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_number_type_matches_numbers_response_body_for_content_types/post/responses/response_200/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_number_type_matches_numbers_response_body_for_content_types/post/responses/response_200/__init__.py index 5f51d512bcc..790e742c513 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_number_type_matches_numbers_response_body_for_content_types/post/responses/response_200/__init__.py +++ b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_number_type_matches_numbers_response_body_for_content_types/post/responses/response_200/__init__.py @@ -25,9 +25,7 @@ @dataclasses.dataclass class _ApiResponse(api_client.ApiResponse): response: urllib3.HTTPResponse - body: typing.Union[ - application_json_schema.Schema, - ] + body: application_json_schema.Schema headers: schemas.Unset = schemas.unset diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_object_properties_validation_response_body_for_content_types/post/operation.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_object_properties_validation_response_body_for_content_types/post/operation.py index 8b037c05c10..c04fc4ea3cd 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_object_properties_validation_response_body_for_content_types/post/operation.py +++ b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_object_properties_validation_response_body_for_content_types/post/operation.py @@ -120,7 +120,8 @@ class instances status: typing_extensions.Literal[ '200', ] - api_response = _status_code_to_response[status].deserialize(response, self.api_client.schema_configuration) + api_response = _status_code_to_response[status].deserialize( + response, self.api_client.schema_configuration) else: api_response = api_client.ApiResponseWithoutDeserialization(response=response) diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_object_properties_validation_response_body_for_content_types/post/responses/response_200/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_object_properties_validation_response_body_for_content_types/post/responses/response_200/__init__.py index 5f51d512bcc..790e742c513 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_object_properties_validation_response_body_for_content_types/post/responses/response_200/__init__.py +++ b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_object_properties_validation_response_body_for_content_types/post/responses/response_200/__init__.py @@ -25,9 +25,7 @@ @dataclasses.dataclass class _ApiResponse(api_client.ApiResponse): response: urllib3.HTTPResponse - body: typing.Union[ - application_json_schema.Schema, - ] + body: application_json_schema.Schema headers: schemas.Unset = schemas.unset diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_object_type_matches_objects_response_body_for_content_types/post/operation.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_object_type_matches_objects_response_body_for_content_types/post/operation.py index 078b4e1215c..39a276679b1 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_object_type_matches_objects_response_body_for_content_types/post/operation.py +++ b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_object_type_matches_objects_response_body_for_content_types/post/operation.py @@ -120,7 +120,8 @@ class instances status: typing_extensions.Literal[ '200', ] - api_response = _status_code_to_response[status].deserialize(response, self.api_client.schema_configuration) + api_response = _status_code_to_response[status].deserialize( + response, self.api_client.schema_configuration) else: api_response = api_client.ApiResponseWithoutDeserialization(response=response) diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_object_type_matches_objects_response_body_for_content_types/post/responses/response_200/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_object_type_matches_objects_response_body_for_content_types/post/responses/response_200/__init__.py index 5f51d512bcc..790e742c513 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_object_type_matches_objects_response_body_for_content_types/post/responses/response_200/__init__.py +++ b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_object_type_matches_objects_response_body_for_content_types/post/responses/response_200/__init__.py @@ -25,9 +25,7 @@ @dataclasses.dataclass class _ApiResponse(api_client.ApiResponse): response: urllib3.HTTPResponse - body: typing.Union[ - application_json_schema.Schema, - ] + body: application_json_schema.Schema headers: schemas.Unset = schemas.unset diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_oneof_complex_types_response_body_for_content_types/post/operation.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_oneof_complex_types_response_body_for_content_types/post/operation.py index 8ea90ca5869..dbcffd57159 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_oneof_complex_types_response_body_for_content_types/post/operation.py +++ b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_oneof_complex_types_response_body_for_content_types/post/operation.py @@ -120,7 +120,8 @@ class instances status: typing_extensions.Literal[ '200', ] - api_response = _status_code_to_response[status].deserialize(response, self.api_client.schema_configuration) + api_response = _status_code_to_response[status].deserialize( + response, self.api_client.schema_configuration) else: api_response = api_client.ApiResponseWithoutDeserialization(response=response) diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_oneof_complex_types_response_body_for_content_types/post/responses/response_200/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_oneof_complex_types_response_body_for_content_types/post/responses/response_200/__init__.py index 5f51d512bcc..790e742c513 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_oneof_complex_types_response_body_for_content_types/post/responses/response_200/__init__.py +++ b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_oneof_complex_types_response_body_for_content_types/post/responses/response_200/__init__.py @@ -25,9 +25,7 @@ @dataclasses.dataclass class _ApiResponse(api_client.ApiResponse): response: urllib3.HTTPResponse - body: typing.Union[ - application_json_schema.Schema, - ] + body: application_json_schema.Schema headers: schemas.Unset = schemas.unset diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_oneof_response_body_for_content_types/post/operation.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_oneof_response_body_for_content_types/post/operation.py index b1be4a89d55..743ab871151 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_oneof_response_body_for_content_types/post/operation.py +++ b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_oneof_response_body_for_content_types/post/operation.py @@ -120,7 +120,8 @@ class instances status: typing_extensions.Literal[ '200', ] - api_response = _status_code_to_response[status].deserialize(response, self.api_client.schema_configuration) + api_response = _status_code_to_response[status].deserialize( + response, self.api_client.schema_configuration) else: api_response = api_client.ApiResponseWithoutDeserialization(response=response) diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_oneof_response_body_for_content_types/post/responses/response_200/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_oneof_response_body_for_content_types/post/responses/response_200/__init__.py index 5f51d512bcc..790e742c513 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_oneof_response_body_for_content_types/post/responses/response_200/__init__.py +++ b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_oneof_response_body_for_content_types/post/responses/response_200/__init__.py @@ -25,9 +25,7 @@ @dataclasses.dataclass class _ApiResponse(api_client.ApiResponse): response: urllib3.HTTPResponse - body: typing.Union[ - application_json_schema.Schema, - ] + body: application_json_schema.Schema headers: schemas.Unset = schemas.unset diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_oneof_with_base_schema_response_body_for_content_types/post/operation.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_oneof_with_base_schema_response_body_for_content_types/post/operation.py index 9b627cfe37f..baed7409293 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_oneof_with_base_schema_response_body_for_content_types/post/operation.py +++ b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_oneof_with_base_schema_response_body_for_content_types/post/operation.py @@ -120,7 +120,8 @@ class instances status: typing_extensions.Literal[ '200', ] - api_response = _status_code_to_response[status].deserialize(response, self.api_client.schema_configuration) + api_response = _status_code_to_response[status].deserialize( + response, self.api_client.schema_configuration) else: api_response = api_client.ApiResponseWithoutDeserialization(response=response) diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_oneof_with_base_schema_response_body_for_content_types/post/responses/response_200/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_oneof_with_base_schema_response_body_for_content_types/post/responses/response_200/__init__.py index 5f51d512bcc..790e742c513 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_oneof_with_base_schema_response_body_for_content_types/post/responses/response_200/__init__.py +++ b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_oneof_with_base_schema_response_body_for_content_types/post/responses/response_200/__init__.py @@ -25,9 +25,7 @@ @dataclasses.dataclass class _ApiResponse(api_client.ApiResponse): response: urllib3.HTTPResponse - body: typing.Union[ - application_json_schema.Schema, - ] + body: application_json_schema.Schema headers: schemas.Unset = schemas.unset diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_oneof_with_empty_schema_response_body_for_content_types/post/operation.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_oneof_with_empty_schema_response_body_for_content_types/post/operation.py index 658bad3e5a2..26ec96f4dc1 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_oneof_with_empty_schema_response_body_for_content_types/post/operation.py +++ b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_oneof_with_empty_schema_response_body_for_content_types/post/operation.py @@ -120,7 +120,8 @@ class instances status: typing_extensions.Literal[ '200', ] - api_response = _status_code_to_response[status].deserialize(response, self.api_client.schema_configuration) + api_response = _status_code_to_response[status].deserialize( + response, self.api_client.schema_configuration) else: api_response = api_client.ApiResponseWithoutDeserialization(response=response) diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_oneof_with_empty_schema_response_body_for_content_types/post/responses/response_200/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_oneof_with_empty_schema_response_body_for_content_types/post/responses/response_200/__init__.py index 5f51d512bcc..790e742c513 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_oneof_with_empty_schema_response_body_for_content_types/post/responses/response_200/__init__.py +++ b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_oneof_with_empty_schema_response_body_for_content_types/post/responses/response_200/__init__.py @@ -25,9 +25,7 @@ @dataclasses.dataclass class _ApiResponse(api_client.ApiResponse): response: urllib3.HTTPResponse - body: typing.Union[ - application_json_schema.Schema, - ] + body: application_json_schema.Schema headers: schemas.Unset = schemas.unset diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_oneof_with_required_response_body_for_content_types/post/operation.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_oneof_with_required_response_body_for_content_types/post/operation.py index a9e592e57f6..14893f240b5 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_oneof_with_required_response_body_for_content_types/post/operation.py +++ b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_oneof_with_required_response_body_for_content_types/post/operation.py @@ -120,7 +120,8 @@ class instances status: typing_extensions.Literal[ '200', ] - api_response = _status_code_to_response[status].deserialize(response, self.api_client.schema_configuration) + api_response = _status_code_to_response[status].deserialize( + response, self.api_client.schema_configuration) else: api_response = api_client.ApiResponseWithoutDeserialization(response=response) diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_oneof_with_required_response_body_for_content_types/post/responses/response_200/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_oneof_with_required_response_body_for_content_types/post/responses/response_200/__init__.py index 5f51d512bcc..790e742c513 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_oneof_with_required_response_body_for_content_types/post/responses/response_200/__init__.py +++ b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_oneof_with_required_response_body_for_content_types/post/responses/response_200/__init__.py @@ -25,9 +25,7 @@ @dataclasses.dataclass class _ApiResponse(api_client.ApiResponse): response: urllib3.HTTPResponse - body: typing.Union[ - application_json_schema.Schema, - ] + body: application_json_schema.Schema headers: schemas.Unset = schemas.unset diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_pattern_is_not_anchored_response_body_for_content_types/post/operation.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_pattern_is_not_anchored_response_body_for_content_types/post/operation.py index e630a5a36ad..999604fc0de 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_pattern_is_not_anchored_response_body_for_content_types/post/operation.py +++ b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_pattern_is_not_anchored_response_body_for_content_types/post/operation.py @@ -120,7 +120,8 @@ class instances status: typing_extensions.Literal[ '200', ] - api_response = _status_code_to_response[status].deserialize(response, self.api_client.schema_configuration) + api_response = _status_code_to_response[status].deserialize( + response, self.api_client.schema_configuration) else: api_response = api_client.ApiResponseWithoutDeserialization(response=response) diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_pattern_is_not_anchored_response_body_for_content_types/post/responses/response_200/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_pattern_is_not_anchored_response_body_for_content_types/post/responses/response_200/__init__.py index 5f51d512bcc..790e742c513 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_pattern_is_not_anchored_response_body_for_content_types/post/responses/response_200/__init__.py +++ b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_pattern_is_not_anchored_response_body_for_content_types/post/responses/response_200/__init__.py @@ -25,9 +25,7 @@ @dataclasses.dataclass class _ApiResponse(api_client.ApiResponse): response: urllib3.HTTPResponse - body: typing.Union[ - application_json_schema.Schema, - ] + body: application_json_schema.Schema headers: schemas.Unset = schemas.unset diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_pattern_validation_response_body_for_content_types/post/operation.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_pattern_validation_response_body_for_content_types/post/operation.py index 42bfffd3d88..6909b8fda72 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_pattern_validation_response_body_for_content_types/post/operation.py +++ b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_pattern_validation_response_body_for_content_types/post/operation.py @@ -120,7 +120,8 @@ class instances status: typing_extensions.Literal[ '200', ] - api_response = _status_code_to_response[status].deserialize(response, self.api_client.schema_configuration) + api_response = _status_code_to_response[status].deserialize( + response, self.api_client.schema_configuration) else: api_response = api_client.ApiResponseWithoutDeserialization(response=response) diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_pattern_validation_response_body_for_content_types/post/responses/response_200/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_pattern_validation_response_body_for_content_types/post/responses/response_200/__init__.py index 5f51d512bcc..790e742c513 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_pattern_validation_response_body_for_content_types/post/responses/response_200/__init__.py +++ b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_pattern_validation_response_body_for_content_types/post/responses/response_200/__init__.py @@ -25,9 +25,7 @@ @dataclasses.dataclass class _ApiResponse(api_client.ApiResponse): response: urllib3.HTTPResponse - body: typing.Union[ - application_json_schema.Schema, - ] + body: application_json_schema.Schema headers: schemas.Unset = schemas.unset diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_properties_with_escaped_characters_response_body_for_content_types/post/operation.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_properties_with_escaped_characters_response_body_for_content_types/post/operation.py index 703645a48ca..24f7da8ca03 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_properties_with_escaped_characters_response_body_for_content_types/post/operation.py +++ b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_properties_with_escaped_characters_response_body_for_content_types/post/operation.py @@ -120,7 +120,8 @@ class instances status: typing_extensions.Literal[ '200', ] - api_response = _status_code_to_response[status].deserialize(response, self.api_client.schema_configuration) + api_response = _status_code_to_response[status].deserialize( + response, self.api_client.schema_configuration) else: api_response = api_client.ApiResponseWithoutDeserialization(response=response) diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_properties_with_escaped_characters_response_body_for_content_types/post/responses/response_200/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_properties_with_escaped_characters_response_body_for_content_types/post/responses/response_200/__init__.py index 5f51d512bcc..790e742c513 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_properties_with_escaped_characters_response_body_for_content_types/post/responses/response_200/__init__.py +++ b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_properties_with_escaped_characters_response_body_for_content_types/post/responses/response_200/__init__.py @@ -25,9 +25,7 @@ @dataclasses.dataclass class _ApiResponse(api_client.ApiResponse): response: urllib3.HTTPResponse - body: typing.Union[ - application_json_schema.Schema, - ] + body: application_json_schema.Schema headers: schemas.Unset = schemas.unset diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_property_named_ref_that_is_not_a_reference_response_body_for_content_types/post/operation.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_property_named_ref_that_is_not_a_reference_response_body_for_content_types/post/operation.py index 10bcf4785ef..7af44970daa 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_property_named_ref_that_is_not_a_reference_response_body_for_content_types/post/operation.py +++ b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_property_named_ref_that_is_not_a_reference_response_body_for_content_types/post/operation.py @@ -120,7 +120,8 @@ class instances status: typing_extensions.Literal[ '200', ] - api_response = _status_code_to_response[status].deserialize(response, self.api_client.schema_configuration) + api_response = _status_code_to_response[status].deserialize( + response, self.api_client.schema_configuration) else: api_response = api_client.ApiResponseWithoutDeserialization(response=response) diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_property_named_ref_that_is_not_a_reference_response_body_for_content_types/post/responses/response_200/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_property_named_ref_that_is_not_a_reference_response_body_for_content_types/post/responses/response_200/__init__.py index 5f51d512bcc..790e742c513 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_property_named_ref_that_is_not_a_reference_response_body_for_content_types/post/responses/response_200/__init__.py +++ b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_property_named_ref_that_is_not_a_reference_response_body_for_content_types/post/responses/response_200/__init__.py @@ -25,9 +25,7 @@ @dataclasses.dataclass class _ApiResponse(api_client.ApiResponse): response: urllib3.HTTPResponse - body: typing.Union[ - application_json_schema.Schema, - ] + body: application_json_schema.Schema headers: schemas.Unset = schemas.unset diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_ref_in_additionalproperties_response_body_for_content_types/post/operation.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_ref_in_additionalproperties_response_body_for_content_types/post/operation.py index 75e09f9ab6f..3d652e70d0d 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_ref_in_additionalproperties_response_body_for_content_types/post/operation.py +++ b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_ref_in_additionalproperties_response_body_for_content_types/post/operation.py @@ -120,7 +120,8 @@ class instances status: typing_extensions.Literal[ '200', ] - api_response = _status_code_to_response[status].deserialize(response, self.api_client.schema_configuration) + api_response = _status_code_to_response[status].deserialize( + response, self.api_client.schema_configuration) else: api_response = api_client.ApiResponseWithoutDeserialization(response=response) diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_ref_in_additionalproperties_response_body_for_content_types/post/responses/response_200/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_ref_in_additionalproperties_response_body_for_content_types/post/responses/response_200/__init__.py index 5f51d512bcc..790e742c513 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_ref_in_additionalproperties_response_body_for_content_types/post/responses/response_200/__init__.py +++ b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_ref_in_additionalproperties_response_body_for_content_types/post/responses/response_200/__init__.py @@ -25,9 +25,7 @@ @dataclasses.dataclass class _ApiResponse(api_client.ApiResponse): response: urllib3.HTTPResponse - body: typing.Union[ - application_json_schema.Schema, - ] + body: application_json_schema.Schema headers: schemas.Unset = schemas.unset diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_ref_in_allof_response_body_for_content_types/post/operation.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_ref_in_allof_response_body_for_content_types/post/operation.py index 8a7be959e9e..f5e25057053 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_ref_in_allof_response_body_for_content_types/post/operation.py +++ b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_ref_in_allof_response_body_for_content_types/post/operation.py @@ -120,7 +120,8 @@ class instances status: typing_extensions.Literal[ '200', ] - api_response = _status_code_to_response[status].deserialize(response, self.api_client.schema_configuration) + api_response = _status_code_to_response[status].deserialize( + response, self.api_client.schema_configuration) else: api_response = api_client.ApiResponseWithoutDeserialization(response=response) diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_ref_in_allof_response_body_for_content_types/post/responses/response_200/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_ref_in_allof_response_body_for_content_types/post/responses/response_200/__init__.py index 5f51d512bcc..790e742c513 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_ref_in_allof_response_body_for_content_types/post/responses/response_200/__init__.py +++ b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_ref_in_allof_response_body_for_content_types/post/responses/response_200/__init__.py @@ -25,9 +25,7 @@ @dataclasses.dataclass class _ApiResponse(api_client.ApiResponse): response: urllib3.HTTPResponse - body: typing.Union[ - application_json_schema.Schema, - ] + body: application_json_schema.Schema headers: schemas.Unset = schemas.unset diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_ref_in_anyof_response_body_for_content_types/post/operation.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_ref_in_anyof_response_body_for_content_types/post/operation.py index 1d8929a3336..23730edbed3 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_ref_in_anyof_response_body_for_content_types/post/operation.py +++ b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_ref_in_anyof_response_body_for_content_types/post/operation.py @@ -120,7 +120,8 @@ class instances status: typing_extensions.Literal[ '200', ] - api_response = _status_code_to_response[status].deserialize(response, self.api_client.schema_configuration) + api_response = _status_code_to_response[status].deserialize( + response, self.api_client.schema_configuration) else: api_response = api_client.ApiResponseWithoutDeserialization(response=response) diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_ref_in_anyof_response_body_for_content_types/post/responses/response_200/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_ref_in_anyof_response_body_for_content_types/post/responses/response_200/__init__.py index 5f51d512bcc..790e742c513 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_ref_in_anyof_response_body_for_content_types/post/responses/response_200/__init__.py +++ b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_ref_in_anyof_response_body_for_content_types/post/responses/response_200/__init__.py @@ -25,9 +25,7 @@ @dataclasses.dataclass class _ApiResponse(api_client.ApiResponse): response: urllib3.HTTPResponse - body: typing.Union[ - application_json_schema.Schema, - ] + body: application_json_schema.Schema headers: schemas.Unset = schemas.unset diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_ref_in_items_response_body_for_content_types/post/operation.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_ref_in_items_response_body_for_content_types/post/operation.py index 9450dbf7cfb..b17353391b0 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_ref_in_items_response_body_for_content_types/post/operation.py +++ b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_ref_in_items_response_body_for_content_types/post/operation.py @@ -120,7 +120,8 @@ class instances status: typing_extensions.Literal[ '200', ] - api_response = _status_code_to_response[status].deserialize(response, self.api_client.schema_configuration) + api_response = _status_code_to_response[status].deserialize( + response, self.api_client.schema_configuration) else: api_response = api_client.ApiResponseWithoutDeserialization(response=response) diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_ref_in_items_response_body_for_content_types/post/responses/response_200/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_ref_in_items_response_body_for_content_types/post/responses/response_200/__init__.py index 5f51d512bcc..790e742c513 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_ref_in_items_response_body_for_content_types/post/responses/response_200/__init__.py +++ b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_ref_in_items_response_body_for_content_types/post/responses/response_200/__init__.py @@ -25,9 +25,7 @@ @dataclasses.dataclass class _ApiResponse(api_client.ApiResponse): response: urllib3.HTTPResponse - body: typing.Union[ - application_json_schema.Schema, - ] + body: application_json_schema.Schema headers: schemas.Unset = schemas.unset diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_ref_in_not_response_body_for_content_types/post/operation.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_ref_in_not_response_body_for_content_types/post/operation.py index 0850650428a..95f4c851e15 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_ref_in_not_response_body_for_content_types/post/operation.py +++ b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_ref_in_not_response_body_for_content_types/post/operation.py @@ -120,7 +120,8 @@ class instances status: typing_extensions.Literal[ '200', ] - api_response = _status_code_to_response[status].deserialize(response, self.api_client.schema_configuration) + api_response = _status_code_to_response[status].deserialize( + response, self.api_client.schema_configuration) else: api_response = api_client.ApiResponseWithoutDeserialization(response=response) diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_ref_in_not_response_body_for_content_types/post/responses/response_200/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_ref_in_not_response_body_for_content_types/post/responses/response_200/__init__.py index 5f51d512bcc..790e742c513 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_ref_in_not_response_body_for_content_types/post/responses/response_200/__init__.py +++ b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_ref_in_not_response_body_for_content_types/post/responses/response_200/__init__.py @@ -25,9 +25,7 @@ @dataclasses.dataclass class _ApiResponse(api_client.ApiResponse): response: urllib3.HTTPResponse - body: typing.Union[ - application_json_schema.Schema, - ] + body: application_json_schema.Schema headers: schemas.Unset = schemas.unset diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_ref_in_oneof_response_body_for_content_types/post/operation.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_ref_in_oneof_response_body_for_content_types/post/operation.py index 5bbf8b50401..656508ed4a2 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_ref_in_oneof_response_body_for_content_types/post/operation.py +++ b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_ref_in_oneof_response_body_for_content_types/post/operation.py @@ -120,7 +120,8 @@ class instances status: typing_extensions.Literal[ '200', ] - api_response = _status_code_to_response[status].deserialize(response, self.api_client.schema_configuration) + api_response = _status_code_to_response[status].deserialize( + response, self.api_client.schema_configuration) else: api_response = api_client.ApiResponseWithoutDeserialization(response=response) diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_ref_in_oneof_response_body_for_content_types/post/responses/response_200/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_ref_in_oneof_response_body_for_content_types/post/responses/response_200/__init__.py index 5f51d512bcc..790e742c513 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_ref_in_oneof_response_body_for_content_types/post/responses/response_200/__init__.py +++ b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_ref_in_oneof_response_body_for_content_types/post/responses/response_200/__init__.py @@ -25,9 +25,7 @@ @dataclasses.dataclass class _ApiResponse(api_client.ApiResponse): response: urllib3.HTTPResponse - body: typing.Union[ - application_json_schema.Schema, - ] + body: application_json_schema.Schema headers: schemas.Unset = schemas.unset diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_ref_in_property_response_body_for_content_types/post/operation.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_ref_in_property_response_body_for_content_types/post/operation.py index b6e2b964c12..7c31140e5d7 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_ref_in_property_response_body_for_content_types/post/operation.py +++ b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_ref_in_property_response_body_for_content_types/post/operation.py @@ -120,7 +120,8 @@ class instances status: typing_extensions.Literal[ '200', ] - api_response = _status_code_to_response[status].deserialize(response, self.api_client.schema_configuration) + api_response = _status_code_to_response[status].deserialize( + response, self.api_client.schema_configuration) else: api_response = api_client.ApiResponseWithoutDeserialization(response=response) diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_ref_in_property_response_body_for_content_types/post/responses/response_200/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_ref_in_property_response_body_for_content_types/post/responses/response_200/__init__.py index 5f51d512bcc..790e742c513 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_ref_in_property_response_body_for_content_types/post/responses/response_200/__init__.py +++ b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_ref_in_property_response_body_for_content_types/post/responses/response_200/__init__.py @@ -25,9 +25,7 @@ @dataclasses.dataclass class _ApiResponse(api_client.ApiResponse): response: urllib3.HTTPResponse - body: typing.Union[ - application_json_schema.Schema, - ] + body: application_json_schema.Schema headers: schemas.Unset = schemas.unset diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_required_default_validation_response_body_for_content_types/post/operation.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_required_default_validation_response_body_for_content_types/post/operation.py index 42aaf500b26..ed4db33fb1c 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_required_default_validation_response_body_for_content_types/post/operation.py +++ b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_required_default_validation_response_body_for_content_types/post/operation.py @@ -120,7 +120,8 @@ class instances status: typing_extensions.Literal[ '200', ] - api_response = _status_code_to_response[status].deserialize(response, self.api_client.schema_configuration) + api_response = _status_code_to_response[status].deserialize( + response, self.api_client.schema_configuration) else: api_response = api_client.ApiResponseWithoutDeserialization(response=response) diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_required_default_validation_response_body_for_content_types/post/responses/response_200/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_required_default_validation_response_body_for_content_types/post/responses/response_200/__init__.py index 5f51d512bcc..790e742c513 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_required_default_validation_response_body_for_content_types/post/responses/response_200/__init__.py +++ b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_required_default_validation_response_body_for_content_types/post/responses/response_200/__init__.py @@ -25,9 +25,7 @@ @dataclasses.dataclass class _ApiResponse(api_client.ApiResponse): response: urllib3.HTTPResponse - body: typing.Union[ - application_json_schema.Schema, - ] + body: application_json_schema.Schema headers: schemas.Unset = schemas.unset diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_required_validation_response_body_for_content_types/post/operation.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_required_validation_response_body_for_content_types/post/operation.py index 329cedfe2bb..fe3a4ea84df 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_required_validation_response_body_for_content_types/post/operation.py +++ b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_required_validation_response_body_for_content_types/post/operation.py @@ -120,7 +120,8 @@ class instances status: typing_extensions.Literal[ '200', ] - api_response = _status_code_to_response[status].deserialize(response, self.api_client.schema_configuration) + api_response = _status_code_to_response[status].deserialize( + response, self.api_client.schema_configuration) else: api_response = api_client.ApiResponseWithoutDeserialization(response=response) diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_required_validation_response_body_for_content_types/post/responses/response_200/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_required_validation_response_body_for_content_types/post/responses/response_200/__init__.py index 5f51d512bcc..790e742c513 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_required_validation_response_body_for_content_types/post/responses/response_200/__init__.py +++ b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_required_validation_response_body_for_content_types/post/responses/response_200/__init__.py @@ -25,9 +25,7 @@ @dataclasses.dataclass class _ApiResponse(api_client.ApiResponse): response: urllib3.HTTPResponse - body: typing.Union[ - application_json_schema.Schema, - ] + body: application_json_schema.Schema headers: schemas.Unset = schemas.unset diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_required_with_empty_array_response_body_for_content_types/post/operation.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_required_with_empty_array_response_body_for_content_types/post/operation.py index 35c693262dc..eb89b819b9b 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_required_with_empty_array_response_body_for_content_types/post/operation.py +++ b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_required_with_empty_array_response_body_for_content_types/post/operation.py @@ -120,7 +120,8 @@ class instances status: typing_extensions.Literal[ '200', ] - api_response = _status_code_to_response[status].deserialize(response, self.api_client.schema_configuration) + api_response = _status_code_to_response[status].deserialize( + response, self.api_client.schema_configuration) else: api_response = api_client.ApiResponseWithoutDeserialization(response=response) diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_required_with_empty_array_response_body_for_content_types/post/responses/response_200/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_required_with_empty_array_response_body_for_content_types/post/responses/response_200/__init__.py index 5f51d512bcc..790e742c513 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_required_with_empty_array_response_body_for_content_types/post/responses/response_200/__init__.py +++ b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_required_with_empty_array_response_body_for_content_types/post/responses/response_200/__init__.py @@ -25,9 +25,7 @@ @dataclasses.dataclass class _ApiResponse(api_client.ApiResponse): response: urllib3.HTTPResponse - body: typing.Union[ - application_json_schema.Schema, - ] + body: application_json_schema.Schema headers: schemas.Unset = schemas.unset diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_required_with_escaped_characters_response_body_for_content_types/post/operation.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_required_with_escaped_characters_response_body_for_content_types/post/operation.py index 92fc033fa8a..d4ee405ebeb 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_required_with_escaped_characters_response_body_for_content_types/post/operation.py +++ b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_required_with_escaped_characters_response_body_for_content_types/post/operation.py @@ -120,7 +120,8 @@ class instances status: typing_extensions.Literal[ '200', ] - api_response = _status_code_to_response[status].deserialize(response, self.api_client.schema_configuration) + api_response = _status_code_to_response[status].deserialize( + response, self.api_client.schema_configuration) else: api_response = api_client.ApiResponseWithoutDeserialization(response=response) diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_required_with_escaped_characters_response_body_for_content_types/post/responses/response_200/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_required_with_escaped_characters_response_body_for_content_types/post/responses/response_200/__init__.py index 5f51d512bcc..790e742c513 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_required_with_escaped_characters_response_body_for_content_types/post/responses/response_200/__init__.py +++ b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_required_with_escaped_characters_response_body_for_content_types/post/responses/response_200/__init__.py @@ -25,9 +25,7 @@ @dataclasses.dataclass class _ApiResponse(api_client.ApiResponse): response: urllib3.HTTPResponse - body: typing.Union[ - application_json_schema.Schema, - ] + body: application_json_schema.Schema headers: schemas.Unset = schemas.unset diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_simple_enum_validation_response_body_for_content_types/post/operation.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_simple_enum_validation_response_body_for_content_types/post/operation.py index f2d5cce8c84..5e5f9af4ae7 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_simple_enum_validation_response_body_for_content_types/post/operation.py +++ b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_simple_enum_validation_response_body_for_content_types/post/operation.py @@ -120,7 +120,8 @@ class instances status: typing_extensions.Literal[ '200', ] - api_response = _status_code_to_response[status].deserialize(response, self.api_client.schema_configuration) + api_response = _status_code_to_response[status].deserialize( + response, self.api_client.schema_configuration) else: api_response = api_client.ApiResponseWithoutDeserialization(response=response) diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_simple_enum_validation_response_body_for_content_types/post/responses/response_200/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_simple_enum_validation_response_body_for_content_types/post/responses/response_200/__init__.py index 5f51d512bcc..790e742c513 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_simple_enum_validation_response_body_for_content_types/post/responses/response_200/__init__.py +++ b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_simple_enum_validation_response_body_for_content_types/post/responses/response_200/__init__.py @@ -25,9 +25,7 @@ @dataclasses.dataclass class _ApiResponse(api_client.ApiResponse): response: urllib3.HTTPResponse - body: typing.Union[ - application_json_schema.Schema, - ] + body: application_json_schema.Schema headers: schemas.Unset = schemas.unset diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_string_type_matches_strings_response_body_for_content_types/post/operation.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_string_type_matches_strings_response_body_for_content_types/post/operation.py index 0a1de86f792..699150bce12 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_string_type_matches_strings_response_body_for_content_types/post/operation.py +++ b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_string_type_matches_strings_response_body_for_content_types/post/operation.py @@ -120,7 +120,8 @@ class instances status: typing_extensions.Literal[ '200', ] - api_response = _status_code_to_response[status].deserialize(response, self.api_client.schema_configuration) + api_response = _status_code_to_response[status].deserialize( + response, self.api_client.schema_configuration) else: api_response = api_client.ApiResponseWithoutDeserialization(response=response) diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_string_type_matches_strings_response_body_for_content_types/post/responses/response_200/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_string_type_matches_strings_response_body_for_content_types/post/responses/response_200/__init__.py index 5f51d512bcc..790e742c513 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_string_type_matches_strings_response_body_for_content_types/post/responses/response_200/__init__.py +++ b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_string_type_matches_strings_response_body_for_content_types/post/responses/response_200/__init__.py @@ -25,9 +25,7 @@ @dataclasses.dataclass class _ApiResponse(api_client.ApiResponse): response: urllib3.HTTPResponse - body: typing.Union[ - application_json_schema.Schema, - ] + body: application_json_schema.Schema headers: schemas.Unset = schemas.unset diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_the_default_keyword_does_not_do_anything_if_the_property_is_missing_response_body_for_content_types/post/operation.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_the_default_keyword_does_not_do_anything_if_the_property_is_missing_response_body_for_content_types/post/operation.py index b7fc72c798d..5c9e8d3e801 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_the_default_keyword_does_not_do_anything_if_the_property_is_missing_response_body_for_content_types/post/operation.py +++ b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_the_default_keyword_does_not_do_anything_if_the_property_is_missing_response_body_for_content_types/post/operation.py @@ -120,7 +120,8 @@ class instances status: typing_extensions.Literal[ '200', ] - api_response = _status_code_to_response[status].deserialize(response, self.api_client.schema_configuration) + api_response = _status_code_to_response[status].deserialize( + response, self.api_client.schema_configuration) else: api_response = api_client.ApiResponseWithoutDeserialization(response=response) diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_the_default_keyword_does_not_do_anything_if_the_property_is_missing_response_body_for_content_types/post/responses/response_200/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_the_default_keyword_does_not_do_anything_if_the_property_is_missing_response_body_for_content_types/post/responses/response_200/__init__.py index 5f51d512bcc..790e742c513 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_the_default_keyword_does_not_do_anything_if_the_property_is_missing_response_body_for_content_types/post/responses/response_200/__init__.py +++ b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_the_default_keyword_does_not_do_anything_if_the_property_is_missing_response_body_for_content_types/post/responses/response_200/__init__.py @@ -25,9 +25,7 @@ @dataclasses.dataclass class _ApiResponse(api_client.ApiResponse): response: urllib3.HTTPResponse - body: typing.Union[ - application_json_schema.Schema, - ] + body: application_json_schema.Schema headers: schemas.Unset = schemas.unset diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_uniqueitems_false_validation_response_body_for_content_types/post/operation.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_uniqueitems_false_validation_response_body_for_content_types/post/operation.py index ea2954da9a0..221f193ef6e 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_uniqueitems_false_validation_response_body_for_content_types/post/operation.py +++ b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_uniqueitems_false_validation_response_body_for_content_types/post/operation.py @@ -120,7 +120,8 @@ class instances status: typing_extensions.Literal[ '200', ] - api_response = _status_code_to_response[status].deserialize(response, self.api_client.schema_configuration) + api_response = _status_code_to_response[status].deserialize( + response, self.api_client.schema_configuration) else: api_response = api_client.ApiResponseWithoutDeserialization(response=response) diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_uniqueitems_false_validation_response_body_for_content_types/post/responses/response_200/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_uniqueitems_false_validation_response_body_for_content_types/post/responses/response_200/__init__.py index 5f51d512bcc..790e742c513 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_uniqueitems_false_validation_response_body_for_content_types/post/responses/response_200/__init__.py +++ b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_uniqueitems_false_validation_response_body_for_content_types/post/responses/response_200/__init__.py @@ -25,9 +25,7 @@ @dataclasses.dataclass class _ApiResponse(api_client.ApiResponse): response: urllib3.HTTPResponse - body: typing.Union[ - application_json_schema.Schema, - ] + body: application_json_schema.Schema headers: schemas.Unset = schemas.unset diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_uniqueitems_validation_response_body_for_content_types/post/operation.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_uniqueitems_validation_response_body_for_content_types/post/operation.py index 557bcb634ea..37c8d96f2d6 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_uniqueitems_validation_response_body_for_content_types/post/operation.py +++ b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_uniqueitems_validation_response_body_for_content_types/post/operation.py @@ -120,7 +120,8 @@ class instances status: typing_extensions.Literal[ '200', ] - api_response = _status_code_to_response[status].deserialize(response, self.api_client.schema_configuration) + api_response = _status_code_to_response[status].deserialize( + response, self.api_client.schema_configuration) else: api_response = api_client.ApiResponseWithoutDeserialization(response=response) diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_uniqueitems_validation_response_body_for_content_types/post/responses/response_200/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_uniqueitems_validation_response_body_for_content_types/post/responses/response_200/__init__.py index 5f51d512bcc..790e742c513 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_uniqueitems_validation_response_body_for_content_types/post/responses/response_200/__init__.py +++ b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_uniqueitems_validation_response_body_for_content_types/post/responses/response_200/__init__.py @@ -25,9 +25,7 @@ @dataclasses.dataclass class _ApiResponse(api_client.ApiResponse): response: urllib3.HTTPResponse - body: typing.Union[ - application_json_schema.Schema, - ] + body: application_json_schema.Schema headers: schemas.Unset = schemas.unset diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_uri_format_response_body_for_content_types/post/operation.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_uri_format_response_body_for_content_types/post/operation.py index 5766e582cc1..f5c2934b2b5 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_uri_format_response_body_for_content_types/post/operation.py +++ b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_uri_format_response_body_for_content_types/post/operation.py @@ -120,7 +120,8 @@ class instances status: typing_extensions.Literal[ '200', ] - api_response = _status_code_to_response[status].deserialize(response, self.api_client.schema_configuration) + api_response = _status_code_to_response[status].deserialize( + response, self.api_client.schema_configuration) else: api_response = api_client.ApiResponseWithoutDeserialization(response=response) diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_uri_format_response_body_for_content_types/post/responses/response_200/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_uri_format_response_body_for_content_types/post/responses/response_200/__init__.py index 5f51d512bcc..790e742c513 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_uri_format_response_body_for_content_types/post/responses/response_200/__init__.py +++ b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_uri_format_response_body_for_content_types/post/responses/response_200/__init__.py @@ -25,9 +25,7 @@ @dataclasses.dataclass class _ApiResponse(api_client.ApiResponse): response: urllib3.HTTPResponse - body: typing.Union[ - application_json_schema.Schema, - ] + body: application_json_schema.Schema headers: schemas.Unset = schemas.unset diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_uri_reference_format_response_body_for_content_types/post/operation.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_uri_reference_format_response_body_for_content_types/post/operation.py index 24bf882b1b8..cf191dd1b77 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_uri_reference_format_response_body_for_content_types/post/operation.py +++ b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_uri_reference_format_response_body_for_content_types/post/operation.py @@ -120,7 +120,8 @@ class instances status: typing_extensions.Literal[ '200', ] - api_response = _status_code_to_response[status].deserialize(response, self.api_client.schema_configuration) + api_response = _status_code_to_response[status].deserialize( + response, self.api_client.schema_configuration) else: api_response = api_client.ApiResponseWithoutDeserialization(response=response) diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_uri_reference_format_response_body_for_content_types/post/responses/response_200/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_uri_reference_format_response_body_for_content_types/post/responses/response_200/__init__.py index 5f51d512bcc..790e742c513 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_uri_reference_format_response_body_for_content_types/post/responses/response_200/__init__.py +++ b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_uri_reference_format_response_body_for_content_types/post/responses/response_200/__init__.py @@ -25,9 +25,7 @@ @dataclasses.dataclass class _ApiResponse(api_client.ApiResponse): response: urllib3.HTTPResponse - body: typing.Union[ - application_json_schema.Schema, - ] + body: application_json_schema.Schema headers: schemas.Unset = schemas.unset diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_uri_template_format_response_body_for_content_types/post/operation.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_uri_template_format_response_body_for_content_types/post/operation.py index eb848a10ecd..6dd5ab1d037 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_uri_template_format_response_body_for_content_types/post/operation.py +++ b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_uri_template_format_response_body_for_content_types/post/operation.py @@ -120,7 +120,8 @@ class instances status: typing_extensions.Literal[ '200', ] - api_response = _status_code_to_response[status].deserialize(response, self.api_client.schema_configuration) + api_response = _status_code_to_response[status].deserialize( + response, self.api_client.schema_configuration) else: api_response = api_client.ApiResponseWithoutDeserialization(response=response) diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_uri_template_format_response_body_for_content_types/post/responses/response_200/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_uri_template_format_response_body_for_content_types/post/responses/response_200/__init__.py index 5f51d512bcc..790e742c513 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_uri_template_format_response_body_for_content_types/post/responses/response_200/__init__.py +++ b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/paths/response_body_post_uri_template_format_response_body_for_content_types/post/responses/response_200/__init__.py @@ -25,9 +25,7 @@ @dataclasses.dataclass class _ApiResponse(api_client.ApiResponse): response: urllib3.HTTPResponse - body: typing.Union[ - application_json_schema.Schema, - ] + body: application_json_schema.Schema headers: schemas.Unset = schemas.unset diff --git a/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_request_body_post_additionalproperties_allows_a_schema_which_should_validate_request_body/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_request_body_post_additionalproperties_allows_a_schema_which_should_validate_request_body/__init__.py index f941695b694..e69de29bb2d 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_request_body_post_additionalproperties_allows_a_schema_which_should_validate_request_body/__init__.py +++ b/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_request_body_post_additionalproperties_allows_a_schema_which_should_validate_request_body/__init__.py @@ -1,126 +0,0 @@ -# coding: utf-8 - -""" - - - Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator -""" - -import unittest -from unittest.mock import patch - -import urllib3 - -import unit_test_api -from unit_test_api.paths.request_body_post_additionalproperties_allows_a_schema_which_should_validate_request_body.post import operation as post # noqa: E501 -from unit_test_api import schemas, api_client -from unit_test_api.configurations import api_configuration, schema_configuration - -from .. import ApiTestMixin - - -class TestPost(ApiTestMixin, unittest.TestCase): - """ - Post unit test stubs - """ - api_config = api_configuration.ApiConfiguration() - schema_config = schema_configuration.SchemaConfiguration() - used_api_client = api_client.ApiClient(configuration=api_config, schema_config=schema_config) - api = post.ApiForPost(api_client=used_api_client) # noqa: E501 - - response_status = 200 - response_body = '' - - def test_no_additional_properties_is_valid_passes(self): - content_type = 'application/json' - # no additional properties is valid - with patch.object(urllib3.PoolManager, 'request') as mock_request: - payload = ( - { - "foo": - 1, - } - ) - body = post.request_body.RequestBody.content["application/json"].schema.from_openapi_data_( - payload, - configuration_=self.schema_config - ) - mock_request.return_value = self.response( - self.json_bytes(self.response_body), - status=self.response_status - ) - api_response = self.api.post( - body=body, - content_type=content_type - ) - self.assert_pool_manager_request_called_with( - mock_request, - self.api_config.get_server_url('servers', None) + "/requestBody/postAdditionalpropertiesAllowsASchemaWhichShouldValidateRequestBody", - method='post'.upper(), - body=self.json_bytes(payload), - content_type=content_type, - ) - - assert isinstance(api_response.response, urllib3.HTTPResponse) - assert isinstance(api_response.body, schemas.Unset) - - def test_an_additional_invalid_property_is_invalid_fails(self): - content_type = 'application/json' - # an additional invalid property is invalid - with patch.object(urllib3.PoolManager, 'request') as mock_request: - payload = ( - { - "foo": - 1, - "bar": - 2, - "quux": - 12, - } - ) - with self.assertRaises((unit_test_api.ApiValueError, unit_test_api.ApiTypeError)): - body = post.request_body.RequestBody.content["application/json"].schema.from_openapi_data_( - payload, - configuration_=self.schema_config - ) - self.api.post(body=body) - - def test_an_additional_valid_property_is_valid_passes(self): - content_type = 'application/json' - # an additional valid property is valid - with patch.object(urllib3.PoolManager, 'request') as mock_request: - payload = ( - { - "foo": - 1, - "bar": - 2, - "quux": - True, - } - ) - body = post.request_body.RequestBody.content["application/json"].schema.from_openapi_data_( - payload, - configuration_=self.schema_config - ) - mock_request.return_value = self.response( - self.json_bytes(self.response_body), - status=self.response_status - ) - api_response = self.api.post( - body=body, - content_type=content_type - ) - self.assert_pool_manager_request_called_with( - mock_request, - self.api_config.get_server_url('servers', None) + "/requestBody/postAdditionalpropertiesAllowsASchemaWhichShouldValidateRequestBody", - method='post'.upper(), - body=self.json_bytes(payload), - content_type=content_type, - ) - - assert isinstance(api_response.response, urllib3.HTTPResponse) - assert isinstance(api_response.body, schemas.Unset) - -if __name__ == '__main__': - unittest.main() diff --git a/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_request_body_post_additionalproperties_are_allowed_by_default_request_body/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_request_body_post_additionalproperties_are_allowed_by_default_request_body/__init__.py index 39f38e79309..e69de29bb2d 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_request_body_post_additionalproperties_are_allowed_by_default_request_body/__init__.py +++ b/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_request_body_post_additionalproperties_are_allowed_by_default_request_body/__init__.py @@ -1,72 +0,0 @@ -# coding: utf-8 - -""" - - - Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator -""" - -import unittest -from unittest.mock import patch - -import urllib3 - -import unit_test_api -from unit_test_api.paths.request_body_post_additionalproperties_are_allowed_by_default_request_body.post import operation as post # noqa: E501 -from unit_test_api import schemas, api_client -from unit_test_api.configurations import api_configuration, schema_configuration - -from .. import ApiTestMixin - - -class TestPost(ApiTestMixin, unittest.TestCase): - """ - Post unit test stubs - """ - api_config = api_configuration.ApiConfiguration() - schema_config = schema_configuration.SchemaConfiguration() - used_api_client = api_client.ApiClient(configuration=api_config, schema_config=schema_config) - api = post.ApiForPost(api_client=used_api_client) # noqa: E501 - - response_status = 200 - response_body = '' - - def test_additional_properties_are_allowed_passes(self): - content_type = 'application/json' - # additional properties are allowed - with patch.object(urllib3.PoolManager, 'request') as mock_request: - payload = ( - { - "foo": - 1, - "bar": - 2, - "quux": - True, - } - ) - body = post.request_body.RequestBody.content["application/json"].schema.from_openapi_data_( - payload, - configuration_=self.schema_config - ) - mock_request.return_value = self.response( - self.json_bytes(self.response_body), - status=self.response_status - ) - api_response = self.api.post( - body=body, - content_type=content_type - ) - self.assert_pool_manager_request_called_with( - mock_request, - self.api_config.get_server_url('servers', None) + "/requestBody/postAdditionalpropertiesAreAllowedByDefaultRequestBody", - method='post'.upper(), - body=self.json_bytes(payload), - content_type=content_type, - ) - - assert isinstance(api_response.response, urllib3.HTTPResponse) - assert isinstance(api_response.body, schemas.Unset) - -if __name__ == '__main__': - unittest.main() diff --git a/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_request_body_post_additionalproperties_can_exist_by_itself_request_body/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_request_body_post_additionalproperties_can_exist_by_itself_request_body/__init__.py index e76c0ad264e..e69de29bb2d 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_request_body_post_additionalproperties_can_exist_by_itself_request_body/__init__.py +++ b/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_request_body_post_additionalproperties_can_exist_by_itself_request_body/__init__.py @@ -1,85 +0,0 @@ -# coding: utf-8 - -""" - - - Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator -""" - -import unittest -from unittest.mock import patch - -import urllib3 - -import unit_test_api -from unit_test_api.paths.request_body_post_additionalproperties_can_exist_by_itself_request_body.post import operation as post # noqa: E501 -from unit_test_api import schemas, api_client -from unit_test_api.configurations import api_configuration, schema_configuration - -from .. import ApiTestMixin - - -class TestPost(ApiTestMixin, unittest.TestCase): - """ - Post unit test stubs - """ - api_config = api_configuration.ApiConfiguration() - schema_config = schema_configuration.SchemaConfiguration() - used_api_client = api_client.ApiClient(configuration=api_config, schema_config=schema_config) - api = post.ApiForPost(api_client=used_api_client) # noqa: E501 - - response_status = 200 - response_body = '' - - def test_an_additional_invalid_property_is_invalid_fails(self): - content_type = 'application/json' - # an additional invalid property is invalid - with patch.object(urllib3.PoolManager, 'request') as mock_request: - payload = ( - { - "foo": - 1, - } - ) - with self.assertRaises((unit_test_api.ApiValueError, unit_test_api.ApiTypeError)): - body = post.request_body.RequestBody.content["application/json"].schema.from_openapi_data_( - payload, - configuration_=self.schema_config - ) - self.api.post(body=body) - - def test_an_additional_valid_property_is_valid_passes(self): - content_type = 'application/json' - # an additional valid property is valid - with patch.object(urllib3.PoolManager, 'request') as mock_request: - payload = ( - { - "foo": - True, - } - ) - body = post.request_body.RequestBody.content["application/json"].schema.from_openapi_data_( - payload, - configuration_=self.schema_config - ) - mock_request.return_value = self.response( - self.json_bytes(self.response_body), - status=self.response_status - ) - api_response = self.api.post( - body=body, - content_type=content_type - ) - self.assert_pool_manager_request_called_with( - mock_request, - self.api_config.get_server_url('servers', None) + "/requestBody/postAdditionalpropertiesCanExistByItselfRequestBody", - method='post'.upper(), - body=self.json_bytes(payload), - content_type=content_type, - ) - - assert isinstance(api_response.response, urllib3.HTTPResponse) - assert isinstance(api_response.body, schemas.Unset) - -if __name__ == '__main__': - unittest.main() diff --git a/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_request_body_post_additionalproperties_should_not_look_in_applicators_request_body/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_request_body_post_additionalproperties_should_not_look_in_applicators_request_body/__init__.py index 74d8e47628e..e69de29bb2d 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_request_body_post_additionalproperties_should_not_look_in_applicators_request_body/__init__.py +++ b/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_request_body_post_additionalproperties_should_not_look_in_applicators_request_body/__init__.py @@ -1,89 +0,0 @@ -# coding: utf-8 - -""" - - - Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator -""" - -import unittest -from unittest.mock import patch - -import urllib3 - -import unit_test_api -from unit_test_api.paths.request_body_post_additionalproperties_should_not_look_in_applicators_request_body.post import operation as post # noqa: E501 -from unit_test_api import schemas, api_client -from unit_test_api.configurations import api_configuration, schema_configuration - -from .. import ApiTestMixin - - -class TestPost(ApiTestMixin, unittest.TestCase): - """ - Post unit test stubs - """ - api_config = api_configuration.ApiConfiguration() - schema_config = schema_configuration.SchemaConfiguration() - used_api_client = api_client.ApiClient(configuration=api_config, schema_config=schema_config) - api = post.ApiForPost(api_client=used_api_client) # noqa: E501 - - response_status = 200 - response_body = '' - - def test_properties_defined_in_allof_are_not_examined_fails(self): - content_type = 'application/json' - # properties defined in allOf are not examined - with patch.object(urllib3.PoolManager, 'request') as mock_request: - payload = ( - { - "foo": - 1, - "bar": - True, - } - ) - with self.assertRaises((unit_test_api.ApiValueError, unit_test_api.ApiTypeError)): - body = post.request_body.RequestBody.content["application/json"].schema.from_openapi_data_( - payload, - configuration_=self.schema_config - ) - self.api.post(body=body) - - def test_valid_test_case_passes(self): - content_type = 'application/json' - # valid test case - with patch.object(urllib3.PoolManager, 'request') as mock_request: - payload = ( - { - "foo": - False, - "bar": - True, - } - ) - body = post.request_body.RequestBody.content["application/json"].schema.from_openapi_data_( - payload, - configuration_=self.schema_config - ) - mock_request.return_value = self.response( - self.json_bytes(self.response_body), - status=self.response_status - ) - api_response = self.api.post( - body=body, - content_type=content_type - ) - self.assert_pool_manager_request_called_with( - mock_request, - self.api_config.get_server_url('servers', None) + "/requestBody/postAdditionalpropertiesShouldNotLookInApplicatorsRequestBody", - method='post'.upper(), - body=self.json_bytes(payload), - content_type=content_type, - ) - - assert isinstance(api_response.response, urllib3.HTTPResponse) - assert isinstance(api_response.body, schemas.Unset) - -if __name__ == '__main__': - unittest.main() diff --git a/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_request_body_post_allof_combined_with_anyof_oneof_request_body/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_request_body_post_allof_combined_with_anyof_oneof_request_body/__init__.py index fa4a4d12146..e69de29bb2d 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_request_body_post_allof_combined_with_anyof_oneof_request_body/__init__.py +++ b/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_request_body_post_allof_combined_with_anyof_oneof_request_body/__init__.py @@ -1,163 +0,0 @@ -# coding: utf-8 - -""" - - - Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator -""" - -import unittest -from unittest.mock import patch - -import urllib3 - -import unit_test_api -from unit_test_api.paths.request_body_post_allof_combined_with_anyof_oneof_request_body.post import operation as post # noqa: E501 -from unit_test_api import schemas, api_client -from unit_test_api.configurations import api_configuration, schema_configuration - -from .. import ApiTestMixin - - -class TestPost(ApiTestMixin, unittest.TestCase): - """ - Post unit test stubs - """ - api_config = api_configuration.ApiConfiguration() - schema_config = schema_configuration.SchemaConfiguration() - used_api_client = api_client.ApiClient(configuration=api_config, schema_config=schema_config) - api = post.ApiForPost(api_client=used_api_client) # noqa: E501 - - response_status = 200 - response_body = '' - - def test_allof_true_anyof_false_oneof_false_fails(self): - content_type = 'application/json' - # allOf: true, anyOf: false, oneOf: false - with patch.object(urllib3.PoolManager, 'request') as mock_request: - payload = ( - 2 - ) - with self.assertRaises((unit_test_api.ApiValueError, unit_test_api.ApiTypeError)): - body = post.request_body.RequestBody.content["application/json"].schema.from_openapi_data_( - payload, - configuration_=self.schema_config - ) - self.api.post(body=body) - - def test_allof_false_anyof_false_oneof_true_fails(self): - content_type = 'application/json' - # allOf: false, anyOf: false, oneOf: true - with patch.object(urllib3.PoolManager, 'request') as mock_request: - payload = ( - 5 - ) - with self.assertRaises((unit_test_api.ApiValueError, unit_test_api.ApiTypeError)): - body = post.request_body.RequestBody.content["application/json"].schema.from_openapi_data_( - payload, - configuration_=self.schema_config - ) - self.api.post(body=body) - - def test_allof_false_anyof_true_oneof_true_fails(self): - content_type = 'application/json' - # allOf: false, anyOf: true, oneOf: true - with patch.object(urllib3.PoolManager, 'request') as mock_request: - payload = ( - 15 - ) - with self.assertRaises((unit_test_api.ApiValueError, unit_test_api.ApiTypeError)): - body = post.request_body.RequestBody.content["application/json"].schema.from_openapi_data_( - payload, - configuration_=self.schema_config - ) - self.api.post(body=body) - - def test_allof_true_anyof_true_oneof_false_fails(self): - content_type = 'application/json' - # allOf: true, anyOf: true, oneOf: false - with patch.object(urllib3.PoolManager, 'request') as mock_request: - payload = ( - 6 - ) - with self.assertRaises((unit_test_api.ApiValueError, unit_test_api.ApiTypeError)): - body = post.request_body.RequestBody.content["application/json"].schema.from_openapi_data_( - payload, - configuration_=self.schema_config - ) - self.api.post(body=body) - - def test_allof_true_anyof_true_oneof_true_passes(self): - content_type = 'application/json' - # allOf: true, anyOf: true, oneOf: true - with patch.object(urllib3.PoolManager, 'request') as mock_request: - payload = ( - 30 - ) - body = post.request_body.RequestBody.content["application/json"].schema.from_openapi_data_( - payload, - configuration_=self.schema_config - ) - mock_request.return_value = self.response( - self.json_bytes(self.response_body), - status=self.response_status - ) - api_response = self.api.post( - body=body, - content_type=content_type - ) - self.assert_pool_manager_request_called_with( - mock_request, - self.api_config.get_server_url('servers', None) + "/requestBody/postAllofCombinedWithAnyofOneofRequestBody", - method='post'.upper(), - body=self.json_bytes(payload), - content_type=content_type, - ) - - assert isinstance(api_response.response, urllib3.HTTPResponse) - assert isinstance(api_response.body, schemas.Unset) - - def test_allof_true_anyof_false_oneof_true_fails(self): - content_type = 'application/json' - # allOf: true, anyOf: false, oneOf: true - with patch.object(urllib3.PoolManager, 'request') as mock_request: - payload = ( - 10 - ) - with self.assertRaises((unit_test_api.ApiValueError, unit_test_api.ApiTypeError)): - body = post.request_body.RequestBody.content["application/json"].schema.from_openapi_data_( - payload, - configuration_=self.schema_config - ) - self.api.post(body=body) - - def test_allof_false_anyof_true_oneof_false_fails(self): - content_type = 'application/json' - # allOf: false, anyOf: true, oneOf: false - with patch.object(urllib3.PoolManager, 'request') as mock_request: - payload = ( - 3 - ) - with self.assertRaises((unit_test_api.ApiValueError, unit_test_api.ApiTypeError)): - body = post.request_body.RequestBody.content["application/json"].schema.from_openapi_data_( - payload, - configuration_=self.schema_config - ) - self.api.post(body=body) - - def test_allof_false_anyof_false_oneof_false_fails(self): - content_type = 'application/json' - # allOf: false, anyOf: false, oneOf: false - with patch.object(urllib3.PoolManager, 'request') as mock_request: - payload = ( - 1 - ) - with self.assertRaises((unit_test_api.ApiValueError, unit_test_api.ApiTypeError)): - body = post.request_body.RequestBody.content["application/json"].schema.from_openapi_data_( - payload, - configuration_=self.schema_config - ) - self.api.post(body=body) - -if __name__ == '__main__': - unittest.main() diff --git a/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_request_body_post_allof_request_body/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_request_body_post_allof_request_body/__init__.py index 6c6ccad9d7c..e69de29bb2d 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_request_body_post_allof_request_body/__init__.py +++ b/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_request_body_post_allof_request_body/__init__.py @@ -1,123 +0,0 @@ -# coding: utf-8 - -""" - - - Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator -""" - -import unittest -from unittest.mock import patch - -import urllib3 - -import unit_test_api -from unit_test_api.paths.request_body_post_allof_request_body.post import operation as post # noqa: E501 -from unit_test_api import schemas, api_client -from unit_test_api.configurations import api_configuration, schema_configuration - -from .. import ApiTestMixin - - -class TestPost(ApiTestMixin, unittest.TestCase): - """ - Post unit test stubs - """ - api_config = api_configuration.ApiConfiguration() - schema_config = schema_configuration.SchemaConfiguration() - used_api_client = api_client.ApiClient(configuration=api_config, schema_config=schema_config) - api = post.ApiForPost(api_client=used_api_client) # noqa: E501 - - response_status = 200 - response_body = '' - - def test_allof_passes(self): - content_type = 'application/json' - # allOf - with patch.object(urllib3.PoolManager, 'request') as mock_request: - payload = ( - { - "foo": - "baz", - "bar": - 2, - } - ) - body = post.request_body.RequestBody.content["application/json"].schema.from_openapi_data_( - payload, - configuration_=self.schema_config - ) - mock_request.return_value = self.response( - self.json_bytes(self.response_body), - status=self.response_status - ) - api_response = self.api.post( - body=body, - content_type=content_type - ) - self.assert_pool_manager_request_called_with( - mock_request, - self.api_config.get_server_url('servers', None) + "/requestBody/postAllofRequestBody", - method='post'.upper(), - body=self.json_bytes(payload), - content_type=content_type, - ) - - assert isinstance(api_response.response, urllib3.HTTPResponse) - assert isinstance(api_response.body, schemas.Unset) - - def test_mismatch_first_fails(self): - content_type = 'application/json' - # mismatch first - with patch.object(urllib3.PoolManager, 'request') as mock_request: - payload = ( - { - "bar": - 2, - } - ) - with self.assertRaises((unit_test_api.ApiValueError, unit_test_api.ApiTypeError)): - body = post.request_body.RequestBody.content["application/json"].schema.from_openapi_data_( - payload, - configuration_=self.schema_config - ) - self.api.post(body=body) - - def test_mismatch_second_fails(self): - content_type = 'application/json' - # mismatch second - with patch.object(urllib3.PoolManager, 'request') as mock_request: - payload = ( - { - "foo": - "baz", - } - ) - with self.assertRaises((unit_test_api.ApiValueError, unit_test_api.ApiTypeError)): - body = post.request_body.RequestBody.content["application/json"].schema.from_openapi_data_( - payload, - configuration_=self.schema_config - ) - self.api.post(body=body) - - def test_wrong_type_fails(self): - content_type = 'application/json' - # wrong type - with patch.object(urllib3.PoolManager, 'request') as mock_request: - payload = ( - { - "foo": - "baz", - "bar": - "quux", - } - ) - with self.assertRaises((unit_test_api.ApiValueError, unit_test_api.ApiTypeError)): - body = post.request_body.RequestBody.content["application/json"].schema.from_openapi_data_( - payload, - configuration_=self.schema_config - ) - self.api.post(body=body) - -if __name__ == '__main__': - unittest.main() diff --git a/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_request_body_post_allof_simple_types_request_body/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_request_body_post_allof_simple_types_request_body/__init__.py index cea6af05bc6..e69de29bb2d 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_request_body_post_allof_simple_types_request_body/__init__.py +++ b/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_request_body_post_allof_simple_types_request_body/__init__.py @@ -1,79 +0,0 @@ -# coding: utf-8 - -""" - - - Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator -""" - -import unittest -from unittest.mock import patch - -import urllib3 - -import unit_test_api -from unit_test_api.paths.request_body_post_allof_simple_types_request_body.post import operation as post # noqa: E501 -from unit_test_api import schemas, api_client -from unit_test_api.configurations import api_configuration, schema_configuration - -from .. import ApiTestMixin - - -class TestPost(ApiTestMixin, unittest.TestCase): - """ - Post unit test stubs - """ - api_config = api_configuration.ApiConfiguration() - schema_config = schema_configuration.SchemaConfiguration() - used_api_client = api_client.ApiClient(configuration=api_config, schema_config=schema_config) - api = post.ApiForPost(api_client=used_api_client) # noqa: E501 - - response_status = 200 - response_body = '' - - def test_valid_passes(self): - content_type = 'application/json' - # valid - with patch.object(urllib3.PoolManager, 'request') as mock_request: - payload = ( - 25 - ) - body = post.request_body.RequestBody.content["application/json"].schema.from_openapi_data_( - payload, - configuration_=self.schema_config - ) - mock_request.return_value = self.response( - self.json_bytes(self.response_body), - status=self.response_status - ) - api_response = self.api.post( - body=body, - content_type=content_type - ) - self.assert_pool_manager_request_called_with( - mock_request, - self.api_config.get_server_url('servers', None) + "/requestBody/postAllofSimpleTypesRequestBody", - method='post'.upper(), - body=self.json_bytes(payload), - content_type=content_type, - ) - - assert isinstance(api_response.response, urllib3.HTTPResponse) - assert isinstance(api_response.body, schemas.Unset) - - def test_mismatch_one_fails(self): - content_type = 'application/json' - # mismatch one - with patch.object(urllib3.PoolManager, 'request') as mock_request: - payload = ( - 35 - ) - with self.assertRaises((unit_test_api.ApiValueError, unit_test_api.ApiTypeError)): - body = post.request_body.RequestBody.content["application/json"].schema.from_openapi_data_( - payload, - configuration_=self.schema_config - ) - self.api.post(body=body) - -if __name__ == '__main__': - unittest.main() diff --git a/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_request_body_post_allof_with_base_schema_request_body/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_request_body_post_allof_with_base_schema_request_body/__init__.py index 1d441f8b6b6..e69de29bb2d 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_request_body_post_allof_with_base_schema_request_body/__init__.py +++ b/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_request_body_post_allof_with_base_schema_request_body/__init__.py @@ -1,146 +0,0 @@ -# coding: utf-8 - -""" - - - Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator -""" - -import unittest -from unittest.mock import patch - -import urllib3 - -import unit_test_api -from unit_test_api.paths.request_body_post_allof_with_base_schema_request_body.post import operation as post # noqa: E501 -from unit_test_api import schemas, api_client -from unit_test_api.configurations import api_configuration, schema_configuration - -from .. import ApiTestMixin - - -class TestPost(ApiTestMixin, unittest.TestCase): - """ - Post unit test stubs - """ - api_config = api_configuration.ApiConfiguration() - schema_config = schema_configuration.SchemaConfiguration() - used_api_client = api_client.ApiClient(configuration=api_config, schema_config=schema_config) - api = post.ApiForPost(api_client=used_api_client) # noqa: E501 - - response_status = 200 - response_body = '' - - def test_valid_passes(self): - content_type = 'application/json' - # valid - with patch.object(urllib3.PoolManager, 'request') as mock_request: - payload = ( - { - "foo": - "quux", - "bar": - 2, - "baz": - None, - } - ) - body = post.request_body.RequestBody.content["application/json"].schema.from_openapi_data_( - payload, - configuration_=self.schema_config - ) - mock_request.return_value = self.response( - self.json_bytes(self.response_body), - status=self.response_status - ) - api_response = self.api.post( - body=body, - content_type=content_type - ) - self.assert_pool_manager_request_called_with( - mock_request, - self.api_config.get_server_url('servers', None) + "/requestBody/postAllofWithBaseSchemaRequestBody", - method='post'.upper(), - body=self.json_bytes(payload), - content_type=content_type, - ) - - assert isinstance(api_response.response, urllib3.HTTPResponse) - assert isinstance(api_response.body, schemas.Unset) - - def test_mismatch_first_allof_fails(self): - content_type = 'application/json' - # mismatch first allOf - with patch.object(urllib3.PoolManager, 'request') as mock_request: - payload = ( - { - "bar": - 2, - "baz": - None, - } - ) - with self.assertRaises((unit_test_api.ApiValueError, unit_test_api.ApiTypeError)): - body = post.request_body.RequestBody.content["application/json"].schema.from_openapi_data_( - payload, - configuration_=self.schema_config - ) - self.api.post(body=body) - - def test_mismatch_base_schema_fails(self): - content_type = 'application/json' - # mismatch base schema - with patch.object(urllib3.PoolManager, 'request') as mock_request: - payload = ( - { - "foo": - "quux", - "baz": - None, - } - ) - with self.assertRaises((unit_test_api.ApiValueError, unit_test_api.ApiTypeError)): - body = post.request_body.RequestBody.content["application/json"].schema.from_openapi_data_( - payload, - configuration_=self.schema_config - ) - self.api.post(body=body) - - def test_mismatch_both_fails(self): - content_type = 'application/json' - # mismatch both - with patch.object(urllib3.PoolManager, 'request') as mock_request: - payload = ( - { - "bar": - 2, - } - ) - with self.assertRaises((unit_test_api.ApiValueError, unit_test_api.ApiTypeError)): - body = post.request_body.RequestBody.content["application/json"].schema.from_openapi_data_( - payload, - configuration_=self.schema_config - ) - self.api.post(body=body) - - def test_mismatch_second_allof_fails(self): - content_type = 'application/json' - # mismatch second allOf - with patch.object(urllib3.PoolManager, 'request') as mock_request: - payload = ( - { - "foo": - "quux", - "bar": - 2, - } - ) - with self.assertRaises((unit_test_api.ApiValueError, unit_test_api.ApiTypeError)): - body = post.request_body.RequestBody.content["application/json"].schema.from_openapi_data_( - payload, - configuration_=self.schema_config - ) - self.api.post(body=body) - -if __name__ == '__main__': - unittest.main() diff --git a/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_request_body_post_allof_with_one_empty_schema_request_body/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_request_body_post_allof_with_one_empty_schema_request_body/__init__.py index 30d1cb7134b..e69de29bb2d 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_request_body_post_allof_with_one_empty_schema_request_body/__init__.py +++ b/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_request_body_post_allof_with_one_empty_schema_request_body/__init__.py @@ -1,65 +0,0 @@ -# coding: utf-8 - -""" - - - Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator -""" - -import unittest -from unittest.mock import patch - -import urllib3 - -import unit_test_api -from unit_test_api.paths.request_body_post_allof_with_one_empty_schema_request_body.post import operation as post # noqa: E501 -from unit_test_api import schemas, api_client -from unit_test_api.configurations import api_configuration, schema_configuration - -from .. import ApiTestMixin - - -class TestPost(ApiTestMixin, unittest.TestCase): - """ - Post unit test stubs - """ - api_config = api_configuration.ApiConfiguration() - schema_config = schema_configuration.SchemaConfiguration() - used_api_client = api_client.ApiClient(configuration=api_config, schema_config=schema_config) - api = post.ApiForPost(api_client=used_api_client) # noqa: E501 - - response_status = 200 - response_body = '' - - def test_any_data_is_valid_passes(self): - content_type = 'application/json' - # any data is valid - with patch.object(urllib3.PoolManager, 'request') as mock_request: - payload = ( - 1 - ) - body = post.request_body.RequestBody.content["application/json"].schema.from_openapi_data_( - payload, - configuration_=self.schema_config - ) - mock_request.return_value = self.response( - self.json_bytes(self.response_body), - status=self.response_status - ) - api_response = self.api.post( - body=body, - content_type=content_type - ) - self.assert_pool_manager_request_called_with( - mock_request, - self.api_config.get_server_url('servers', None) + "/requestBody/postAllofWithOneEmptySchemaRequestBody", - method='post'.upper(), - body=self.json_bytes(payload), - content_type=content_type, - ) - - assert isinstance(api_response.response, urllib3.HTTPResponse) - assert isinstance(api_response.body, schemas.Unset) - -if __name__ == '__main__': - unittest.main() diff --git a/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_request_body_post_allof_with_the_first_empty_schema_request_body/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_request_body_post_allof_with_the_first_empty_schema_request_body/__init__.py index f9a1d8e1cd6..e69de29bb2d 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_request_body_post_allof_with_the_first_empty_schema_request_body/__init__.py +++ b/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_request_body_post_allof_with_the_first_empty_schema_request_body/__init__.py @@ -1,79 +0,0 @@ -# coding: utf-8 - -""" - - - Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator -""" - -import unittest -from unittest.mock import patch - -import urllib3 - -import unit_test_api -from unit_test_api.paths.request_body_post_allof_with_the_first_empty_schema_request_body.post import operation as post # noqa: E501 -from unit_test_api import schemas, api_client -from unit_test_api.configurations import api_configuration, schema_configuration - -from .. import ApiTestMixin - - -class TestPost(ApiTestMixin, unittest.TestCase): - """ - Post unit test stubs - """ - api_config = api_configuration.ApiConfiguration() - schema_config = schema_configuration.SchemaConfiguration() - used_api_client = api_client.ApiClient(configuration=api_config, schema_config=schema_config) - api = post.ApiForPost(api_client=used_api_client) # noqa: E501 - - response_status = 200 - response_body = '' - - def test_string_is_invalid_fails(self): - content_type = 'application/json' - # string is invalid - with patch.object(urllib3.PoolManager, 'request') as mock_request: - payload = ( - "foo" - ) - with self.assertRaises((unit_test_api.ApiValueError, unit_test_api.ApiTypeError)): - body = post.request_body.RequestBody.content["application/json"].schema.from_openapi_data_( - payload, - configuration_=self.schema_config - ) - self.api.post(body=body) - - def test_number_is_valid_passes(self): - content_type = 'application/json' - # number is valid - with patch.object(urllib3.PoolManager, 'request') as mock_request: - payload = ( - 1 - ) - body = post.request_body.RequestBody.content["application/json"].schema.from_openapi_data_( - payload, - configuration_=self.schema_config - ) - mock_request.return_value = self.response( - self.json_bytes(self.response_body), - status=self.response_status - ) - api_response = self.api.post( - body=body, - content_type=content_type - ) - self.assert_pool_manager_request_called_with( - mock_request, - self.api_config.get_server_url('servers', None) + "/requestBody/postAllofWithTheFirstEmptySchemaRequestBody", - method='post'.upper(), - body=self.json_bytes(payload), - content_type=content_type, - ) - - assert isinstance(api_response.response, urllib3.HTTPResponse) - assert isinstance(api_response.body, schemas.Unset) - -if __name__ == '__main__': - unittest.main() diff --git a/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_request_body_post_allof_with_the_last_empty_schema_request_body/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_request_body_post_allof_with_the_last_empty_schema_request_body/__init__.py index f276863b094..e69de29bb2d 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_request_body_post_allof_with_the_last_empty_schema_request_body/__init__.py +++ b/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_request_body_post_allof_with_the_last_empty_schema_request_body/__init__.py @@ -1,79 +0,0 @@ -# coding: utf-8 - -""" - - - Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator -""" - -import unittest -from unittest.mock import patch - -import urllib3 - -import unit_test_api -from unit_test_api.paths.request_body_post_allof_with_the_last_empty_schema_request_body.post import operation as post # noqa: E501 -from unit_test_api import schemas, api_client -from unit_test_api.configurations import api_configuration, schema_configuration - -from .. import ApiTestMixin - - -class TestPost(ApiTestMixin, unittest.TestCase): - """ - Post unit test stubs - """ - api_config = api_configuration.ApiConfiguration() - schema_config = schema_configuration.SchemaConfiguration() - used_api_client = api_client.ApiClient(configuration=api_config, schema_config=schema_config) - api = post.ApiForPost(api_client=used_api_client) # noqa: E501 - - response_status = 200 - response_body = '' - - def test_string_is_invalid_fails(self): - content_type = 'application/json' - # string is invalid - with patch.object(urllib3.PoolManager, 'request') as mock_request: - payload = ( - "foo" - ) - with self.assertRaises((unit_test_api.ApiValueError, unit_test_api.ApiTypeError)): - body = post.request_body.RequestBody.content["application/json"].schema.from_openapi_data_( - payload, - configuration_=self.schema_config - ) - self.api.post(body=body) - - def test_number_is_valid_passes(self): - content_type = 'application/json' - # number is valid - with patch.object(urllib3.PoolManager, 'request') as mock_request: - payload = ( - 1 - ) - body = post.request_body.RequestBody.content["application/json"].schema.from_openapi_data_( - payload, - configuration_=self.schema_config - ) - mock_request.return_value = self.response( - self.json_bytes(self.response_body), - status=self.response_status - ) - api_response = self.api.post( - body=body, - content_type=content_type - ) - self.assert_pool_manager_request_called_with( - mock_request, - self.api_config.get_server_url('servers', None) + "/requestBody/postAllofWithTheLastEmptySchemaRequestBody", - method='post'.upper(), - body=self.json_bytes(payload), - content_type=content_type, - ) - - assert isinstance(api_response.response, urllib3.HTTPResponse) - assert isinstance(api_response.body, schemas.Unset) - -if __name__ == '__main__': - unittest.main() diff --git a/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_request_body_post_allof_with_two_empty_schemas_request_body/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_request_body_post_allof_with_two_empty_schemas_request_body/__init__.py index 22e2b810e82..e69de29bb2d 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_request_body_post_allof_with_two_empty_schemas_request_body/__init__.py +++ b/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_request_body_post_allof_with_two_empty_schemas_request_body/__init__.py @@ -1,65 +0,0 @@ -# coding: utf-8 - -""" - - - Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator -""" - -import unittest -from unittest.mock import patch - -import urllib3 - -import unit_test_api -from unit_test_api.paths.request_body_post_allof_with_two_empty_schemas_request_body.post import operation as post # noqa: E501 -from unit_test_api import schemas, api_client -from unit_test_api.configurations import api_configuration, schema_configuration - -from .. import ApiTestMixin - - -class TestPost(ApiTestMixin, unittest.TestCase): - """ - Post unit test stubs - """ - api_config = api_configuration.ApiConfiguration() - schema_config = schema_configuration.SchemaConfiguration() - used_api_client = api_client.ApiClient(configuration=api_config, schema_config=schema_config) - api = post.ApiForPost(api_client=used_api_client) # noqa: E501 - - response_status = 200 - response_body = '' - - def test_any_data_is_valid_passes(self): - content_type = 'application/json' - # any data is valid - with patch.object(urllib3.PoolManager, 'request') as mock_request: - payload = ( - 1 - ) - body = post.request_body.RequestBody.content["application/json"].schema.from_openapi_data_( - payload, - configuration_=self.schema_config - ) - mock_request.return_value = self.response( - self.json_bytes(self.response_body), - status=self.response_status - ) - api_response = self.api.post( - body=body, - content_type=content_type - ) - self.assert_pool_manager_request_called_with( - mock_request, - self.api_config.get_server_url('servers', None) + "/requestBody/postAllofWithTwoEmptySchemasRequestBody", - method='post'.upper(), - body=self.json_bytes(payload), - content_type=content_type, - ) - - assert isinstance(api_response.response, urllib3.HTTPResponse) - assert isinstance(api_response.body, schemas.Unset) - -if __name__ == '__main__': - unittest.main() diff --git a/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_request_body_post_anyof_complex_types_request_body/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_request_body_post_anyof_complex_types_request_body/__init__.py index 995d6af6d4d..e69de29bb2d 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_request_body_post_anyof_complex_types_request_body/__init__.py +++ b/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_request_body_post_anyof_complex_types_request_body/__init__.py @@ -1,155 +0,0 @@ -# coding: utf-8 - -""" - - - Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator -""" - -import unittest -from unittest.mock import patch - -import urllib3 - -import unit_test_api -from unit_test_api.paths.request_body_post_anyof_complex_types_request_body.post import operation as post # noqa: E501 -from unit_test_api import schemas, api_client -from unit_test_api.configurations import api_configuration, schema_configuration - -from .. import ApiTestMixin - - -class TestPost(ApiTestMixin, unittest.TestCase): - """ - Post unit test stubs - """ - api_config = api_configuration.ApiConfiguration() - schema_config = schema_configuration.SchemaConfiguration() - used_api_client = api_client.ApiClient(configuration=api_config, schema_config=schema_config) - api = post.ApiForPost(api_client=used_api_client) # noqa: E501 - - response_status = 200 - response_body = '' - - def test_second_anyof_valid_complex_passes(self): - content_type = 'application/json' - # second anyOf valid (complex) - with patch.object(urllib3.PoolManager, 'request') as mock_request: - payload = ( - { - "foo": - "baz", - } - ) - body = post.request_body.RequestBody.content["application/json"].schema.from_openapi_data_( - payload, - configuration_=self.schema_config - ) - mock_request.return_value = self.response( - self.json_bytes(self.response_body), - status=self.response_status - ) - api_response = self.api.post( - body=body, - content_type=content_type - ) - self.assert_pool_manager_request_called_with( - mock_request, - self.api_config.get_server_url('servers', None) + "/requestBody/postAnyofComplexTypesRequestBody", - method='post'.upper(), - body=self.json_bytes(payload), - content_type=content_type, - ) - - assert isinstance(api_response.response, urllib3.HTTPResponse) - assert isinstance(api_response.body, schemas.Unset) - - def test_neither_anyof_valid_complex_fails(self): - content_type = 'application/json' - # neither anyOf valid (complex) - with patch.object(urllib3.PoolManager, 'request') as mock_request: - payload = ( - { - "foo": - 2, - "bar": - "quux", - } - ) - with self.assertRaises((unit_test_api.ApiValueError, unit_test_api.ApiTypeError)): - body = post.request_body.RequestBody.content["application/json"].schema.from_openapi_data_( - payload, - configuration_=self.schema_config - ) - self.api.post(body=body) - - def test_both_anyof_valid_complex_passes(self): - content_type = 'application/json' - # both anyOf valid (complex) - with patch.object(urllib3.PoolManager, 'request') as mock_request: - payload = ( - { - "foo": - "baz", - "bar": - 2, - } - ) - body = post.request_body.RequestBody.content["application/json"].schema.from_openapi_data_( - payload, - configuration_=self.schema_config - ) - mock_request.return_value = self.response( - self.json_bytes(self.response_body), - status=self.response_status - ) - api_response = self.api.post( - body=body, - content_type=content_type - ) - self.assert_pool_manager_request_called_with( - mock_request, - self.api_config.get_server_url('servers', None) + "/requestBody/postAnyofComplexTypesRequestBody", - method='post'.upper(), - body=self.json_bytes(payload), - content_type=content_type, - ) - - assert isinstance(api_response.response, urllib3.HTTPResponse) - assert isinstance(api_response.body, schemas.Unset) - - def test_first_anyof_valid_complex_passes(self): - content_type = 'application/json' - # first anyOf valid (complex) - with patch.object(urllib3.PoolManager, 'request') as mock_request: - payload = ( - { - "bar": - 2, - } - ) - body = post.request_body.RequestBody.content["application/json"].schema.from_openapi_data_( - payload, - configuration_=self.schema_config - ) - mock_request.return_value = self.response( - self.json_bytes(self.response_body), - status=self.response_status - ) - api_response = self.api.post( - body=body, - content_type=content_type - ) - self.assert_pool_manager_request_called_with( - mock_request, - self.api_config.get_server_url('servers', None) + "/requestBody/postAnyofComplexTypesRequestBody", - method='post'.upper(), - body=self.json_bytes(payload), - content_type=content_type, - ) - - assert isinstance(api_response.response, urllib3.HTTPResponse) - assert isinstance(api_response.body, schemas.Unset) - -if __name__ == '__main__': - unittest.main() diff --git a/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_request_body_post_anyof_request_body/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_request_body_post_anyof_request_body/__init__.py index edcb7690568..e69de29bb2d 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_request_body_post_anyof_request_body/__init__.py +++ b/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_request_body_post_anyof_request_body/__init__.py @@ -1,139 +0,0 @@ -# coding: utf-8 - -""" - - - Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator -""" - -import unittest -from unittest.mock import patch - -import urllib3 - -import unit_test_api -from unit_test_api.paths.request_body_post_anyof_request_body.post import operation as post # noqa: E501 -from unit_test_api import schemas, api_client -from unit_test_api.configurations import api_configuration, schema_configuration - -from .. import ApiTestMixin - - -class TestPost(ApiTestMixin, unittest.TestCase): - """ - Post unit test stubs - """ - api_config = api_configuration.ApiConfiguration() - schema_config = schema_configuration.SchemaConfiguration() - used_api_client = api_client.ApiClient(configuration=api_config, schema_config=schema_config) - api = post.ApiForPost(api_client=used_api_client) # noqa: E501 - - response_status = 200 - response_body = '' - - def test_second_anyof_valid_passes(self): - content_type = 'application/json' - # second anyOf valid - with patch.object(urllib3.PoolManager, 'request') as mock_request: - payload = ( - 2.5 - ) - body = post.request_body.RequestBody.content["application/json"].schema.from_openapi_data_( - payload, - configuration_=self.schema_config - ) - mock_request.return_value = self.response( - self.json_bytes(self.response_body), - status=self.response_status - ) - api_response = self.api.post( - body=body, - content_type=content_type - ) - self.assert_pool_manager_request_called_with( - mock_request, - self.api_config.get_server_url('servers', None) + "/requestBody/postAnyofRequestBody", - method='post'.upper(), - body=self.json_bytes(payload), - content_type=content_type, - ) - - assert isinstance(api_response.response, urllib3.HTTPResponse) - assert isinstance(api_response.body, schemas.Unset) - - def test_neither_anyof_valid_fails(self): - content_type = 'application/json' - # neither anyOf valid - with patch.object(urllib3.PoolManager, 'request') as mock_request: - payload = ( - 1.5 - ) - with self.assertRaises((unit_test_api.ApiValueError, unit_test_api.ApiTypeError)): - body = post.request_body.RequestBody.content["application/json"].schema.from_openapi_data_( - payload, - configuration_=self.schema_config - ) - self.api.post(body=body) - - def test_both_anyof_valid_passes(self): - content_type = 'application/json' - # both anyOf valid - with patch.object(urllib3.PoolManager, 'request') as mock_request: - payload = ( - 3 - ) - body = post.request_body.RequestBody.content["application/json"].schema.from_openapi_data_( - payload, - configuration_=self.schema_config - ) - mock_request.return_value = self.response( - self.json_bytes(self.response_body), - status=self.response_status - ) - api_response = self.api.post( - body=body, - content_type=content_type - ) - self.assert_pool_manager_request_called_with( - mock_request, - self.api_config.get_server_url('servers', None) + "/requestBody/postAnyofRequestBody", - method='post'.upper(), - body=self.json_bytes(payload), - content_type=content_type, - ) - - assert isinstance(api_response.response, urllib3.HTTPResponse) - assert isinstance(api_response.body, schemas.Unset) - - def test_first_anyof_valid_passes(self): - content_type = 'application/json' - # first anyOf valid - with patch.object(urllib3.PoolManager, 'request') as mock_request: - payload = ( - 1 - ) - body = post.request_body.RequestBody.content["application/json"].schema.from_openapi_data_( - payload, - configuration_=self.schema_config - ) - mock_request.return_value = self.response( - self.json_bytes(self.response_body), - status=self.response_status - ) - api_response = self.api.post( - body=body, - content_type=content_type - ) - self.assert_pool_manager_request_called_with( - mock_request, - self.api_config.get_server_url('servers', None) + "/requestBody/postAnyofRequestBody", - method='post'.upper(), - body=self.json_bytes(payload), - content_type=content_type, - ) - - assert isinstance(api_response.response, urllib3.HTTPResponse) - assert isinstance(api_response.body, schemas.Unset) - -if __name__ == '__main__': - unittest.main() diff --git a/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_request_body_post_anyof_with_base_schema_request_body/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_request_body_post_anyof_with_base_schema_request_body/__init__.py index 84d6010a339..e69de29bb2d 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_request_body_post_anyof_with_base_schema_request_body/__init__.py +++ b/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_request_body_post_anyof_with_base_schema_request_body/__init__.py @@ -1,93 +0,0 @@ -# coding: utf-8 - -""" - - - Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator -""" - -import unittest -from unittest.mock import patch - -import urllib3 - -import unit_test_api -from unit_test_api.paths.request_body_post_anyof_with_base_schema_request_body.post import operation as post # noqa: E501 -from unit_test_api import schemas, api_client -from unit_test_api.configurations import api_configuration, schema_configuration - -from .. import ApiTestMixin - - -class TestPost(ApiTestMixin, unittest.TestCase): - """ - Post unit test stubs - """ - api_config = api_configuration.ApiConfiguration() - schema_config = schema_configuration.SchemaConfiguration() - used_api_client = api_client.ApiClient(configuration=api_config, schema_config=schema_config) - api = post.ApiForPost(api_client=used_api_client) # noqa: E501 - - response_status = 200 - response_body = '' - - def test_one_anyof_valid_passes(self): - content_type = 'application/json' - # one anyOf valid - with patch.object(urllib3.PoolManager, 'request') as mock_request: - payload = ( - "foobar" - ) - body = post.request_body.RequestBody.content["application/json"].schema.from_openapi_data_( - payload, - configuration_=self.schema_config - ) - mock_request.return_value = self.response( - self.json_bytes(self.response_body), - status=self.response_status - ) - api_response = self.api.post( - body=body, - content_type=content_type - ) - self.assert_pool_manager_request_called_with( - mock_request, - self.api_config.get_server_url('servers', None) + "/requestBody/postAnyofWithBaseSchemaRequestBody", - method='post'.upper(), - body=self.json_bytes(payload), - content_type=content_type, - ) - - assert isinstance(api_response.response, urllib3.HTTPResponse) - assert isinstance(api_response.body, schemas.Unset) - - def test_both_anyof_invalid_fails(self): - content_type = 'application/json' - # both anyOf invalid - with patch.object(urllib3.PoolManager, 'request') as mock_request: - payload = ( - "foo" - ) - with self.assertRaises((unit_test_api.ApiValueError, unit_test_api.ApiTypeError)): - body = post.request_body.RequestBody.content["application/json"].schema.from_openapi_data_( - payload, - configuration_=self.schema_config - ) - self.api.post(body=body) - - def test_mismatch_base_schema_fails(self): - content_type = 'application/json' - # mismatch base schema - with patch.object(urllib3.PoolManager, 'request') as mock_request: - payload = ( - 3 - ) - with self.assertRaises((unit_test_api.ApiValueError, unit_test_api.ApiTypeError)): - body = post.request_body.RequestBody.content["application/json"].schema.from_openapi_data_( - payload, - configuration_=self.schema_config - ) - self.api.post(body=body) - -if __name__ == '__main__': - unittest.main() diff --git a/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_request_body_post_anyof_with_one_empty_schema_request_body/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_request_body_post_anyof_with_one_empty_schema_request_body/__init__.py index b68b154c690..e69de29bb2d 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_request_body_post_anyof_with_one_empty_schema_request_body/__init__.py +++ b/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_request_body_post_anyof_with_one_empty_schema_request_body/__init__.py @@ -1,95 +0,0 @@ -# coding: utf-8 - -""" - - - Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator -""" - -import unittest -from unittest.mock import patch - -import urllib3 - -import unit_test_api -from unit_test_api.paths.request_body_post_anyof_with_one_empty_schema_request_body.post import operation as post # noqa: E501 -from unit_test_api import schemas, api_client -from unit_test_api.configurations import api_configuration, schema_configuration - -from .. import ApiTestMixin - - -class TestPost(ApiTestMixin, unittest.TestCase): - """ - Post unit test stubs - """ - api_config = api_configuration.ApiConfiguration() - schema_config = schema_configuration.SchemaConfiguration() - used_api_client = api_client.ApiClient(configuration=api_config, schema_config=schema_config) - api = post.ApiForPost(api_client=used_api_client) # noqa: E501 - - response_status = 200 - response_body = '' - - def test_string_is_valid_passes(self): - content_type = 'application/json' - # string is valid - with patch.object(urllib3.PoolManager, 'request') as mock_request: - payload = ( - "foo" - ) - body = post.request_body.RequestBody.content["application/json"].schema.from_openapi_data_( - payload, - configuration_=self.schema_config - ) - mock_request.return_value = self.response( - self.json_bytes(self.response_body), - status=self.response_status - ) - api_response = self.api.post( - body=body, - content_type=content_type - ) - self.assert_pool_manager_request_called_with( - mock_request, - self.api_config.get_server_url('servers', None) + "/requestBody/postAnyofWithOneEmptySchemaRequestBody", - method='post'.upper(), - body=self.json_bytes(payload), - content_type=content_type, - ) - - assert isinstance(api_response.response, urllib3.HTTPResponse) - assert isinstance(api_response.body, schemas.Unset) - - def test_number_is_valid_passes(self): - content_type = 'application/json' - # number is valid - with patch.object(urllib3.PoolManager, 'request') as mock_request: - payload = ( - 123 - ) - body = post.request_body.RequestBody.content["application/json"].schema.from_openapi_data_( - payload, - configuration_=self.schema_config - ) - mock_request.return_value = self.response( - self.json_bytes(self.response_body), - status=self.response_status - ) - api_response = self.api.post( - body=body, - content_type=content_type - ) - self.assert_pool_manager_request_called_with( - mock_request, - self.api_config.get_server_url('servers', None) + "/requestBody/postAnyofWithOneEmptySchemaRequestBody", - method='post'.upper(), - body=self.json_bytes(payload), - content_type=content_type, - ) - - assert isinstance(api_response.response, urllib3.HTTPResponse) - assert isinstance(api_response.body, schemas.Unset) - -if __name__ == '__main__': - unittest.main() diff --git a/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_request_body_post_array_type_matches_arrays_request_body/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_request_body_post_array_type_matches_arrays_request_body/__init__.py index 7b359ef38f7..e69de29bb2d 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_request_body_post_array_type_matches_arrays_request_body/__init__.py +++ b/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_request_body_post_array_type_matches_arrays_request_body/__init__.py @@ -1,151 +0,0 @@ -# coding: utf-8 - -""" - - - Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator -""" - -import unittest -from unittest.mock import patch - -import urllib3 - -import unit_test_api -from unit_test_api.paths.request_body_post_array_type_matches_arrays_request_body.post import operation as post # noqa: E501 -from unit_test_api import schemas, api_client -from unit_test_api.configurations import api_configuration, schema_configuration - -from .. import ApiTestMixin - - -class TestPost(ApiTestMixin, unittest.TestCase): - """ - Post unit test stubs - """ - api_config = api_configuration.ApiConfiguration() - schema_config = schema_configuration.SchemaConfiguration() - used_api_client = api_client.ApiClient(configuration=api_config, schema_config=schema_config) - api = post.ApiForPost(api_client=used_api_client) # noqa: E501 - - response_status = 200 - response_body = '' - - def test_a_float_is_not_an_array_fails(self): - content_type = 'application/json' - # a float is not an array - with patch.object(urllib3.PoolManager, 'request') as mock_request: - payload = ( - 1.1 - ) - with self.assertRaises((unit_test_api.ApiValueError, unit_test_api.ApiTypeError)): - body = post.request_body.RequestBody.content["application/json"].schema.from_openapi_data_( - payload, - configuration_=self.schema_config - ) - self.api.post(body=body) - - def test_a_boolean_is_not_an_array_fails(self): - content_type = 'application/json' - # a boolean is not an array - with patch.object(urllib3.PoolManager, 'request') as mock_request: - payload = ( - True - ) - with self.assertRaises((unit_test_api.ApiValueError, unit_test_api.ApiTypeError)): - body = post.request_body.RequestBody.content["application/json"].schema.from_openapi_data_( - payload, - configuration_=self.schema_config - ) - self.api.post(body=body) - - def test_null_is_not_an_array_fails(self): - content_type = 'application/json' - # null is not an array - with patch.object(urllib3.PoolManager, 'request') as mock_request: - payload = ( - None - ) - with self.assertRaises((unit_test_api.ApiValueError, unit_test_api.ApiTypeError)): - body = post.request_body.RequestBody.content["application/json"].schema.from_openapi_data_( - payload, - configuration_=self.schema_config - ) - self.api.post(body=body) - - def test_an_object_is_not_an_array_fails(self): - content_type = 'application/json' - # an object is not an array - with patch.object(urllib3.PoolManager, 'request') as mock_request: - payload = ( - { - } - ) - with self.assertRaises((unit_test_api.ApiValueError, unit_test_api.ApiTypeError)): - body = post.request_body.RequestBody.content["application/json"].schema.from_openapi_data_( - payload, - configuration_=self.schema_config - ) - self.api.post(body=body) - - def test_a_string_is_not_an_array_fails(self): - content_type = 'application/json' - # a string is not an array - with patch.object(urllib3.PoolManager, 'request') as mock_request: - payload = ( - "foo" - ) - with self.assertRaises((unit_test_api.ApiValueError, unit_test_api.ApiTypeError)): - body = post.request_body.RequestBody.content["application/json"].schema.from_openapi_data_( - payload, - configuration_=self.schema_config - ) - self.api.post(body=body) - - def test_an_array_is_an_array_passes(self): - content_type = 'application/json' - # an array is an array - with patch.object(urllib3.PoolManager, 'request') as mock_request: - payload = ( - [ - ] - ) - body = post.request_body.RequestBody.content["application/json"].schema.from_openapi_data_( - payload, - configuration_=self.schema_config - ) - mock_request.return_value = self.response( - self.json_bytes(self.response_body), - status=self.response_status - ) - api_response = self.api.post( - body=body, - content_type=content_type - ) - self.assert_pool_manager_request_called_with( - mock_request, - self.api_config.get_server_url('servers', None) + "/requestBody/postArrayTypeMatchesArraysRequestBody", - method='post'.upper(), - body=self.json_bytes(payload), - content_type=content_type, - ) - - assert isinstance(api_response.response, urllib3.HTTPResponse) - assert isinstance(api_response.body, schemas.Unset) - - def test_an_integer_is_not_an_array_fails(self): - content_type = 'application/json' - # an integer is not an array - with patch.object(urllib3.PoolManager, 'request') as mock_request: - payload = ( - 1 - ) - with self.assertRaises((unit_test_api.ApiValueError, unit_test_api.ApiTypeError)): - body = post.request_body.RequestBody.content["application/json"].schema.from_openapi_data_( - payload, - configuration_=self.schema_config - ) - self.api.post(body=body) - -if __name__ == '__main__': - unittest.main() diff --git a/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_request_body_post_boolean_type_matches_booleans_request_body/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_request_body_post_boolean_type_matches_booleans_request_body/__init__.py index 48d186152c3..e69de29bb2d 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_request_body_post_boolean_type_matches_booleans_request_body/__init__.py +++ b/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_request_body_post_boolean_type_matches_booleans_request_body/__init__.py @@ -1,209 +0,0 @@ -# coding: utf-8 - -""" - - - Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator -""" - -import unittest -from unittest.mock import patch - -import urllib3 - -import unit_test_api -from unit_test_api.paths.request_body_post_boolean_type_matches_booleans_request_body.post import operation as post # noqa: E501 -from unit_test_api import schemas, api_client -from unit_test_api.configurations import api_configuration, schema_configuration - -from .. import ApiTestMixin - - -class TestPost(ApiTestMixin, unittest.TestCase): - """ - Post unit test stubs - """ - api_config = api_configuration.ApiConfiguration() - schema_config = schema_configuration.SchemaConfiguration() - used_api_client = api_client.ApiClient(configuration=api_config, schema_config=schema_config) - api = post.ApiForPost(api_client=used_api_client) # noqa: E501 - - response_status = 200 - response_body = '' - - def test_an_empty_string_is_not_a_boolean_fails(self): - content_type = 'application/json' - # an empty string is not a boolean - with patch.object(urllib3.PoolManager, 'request') as mock_request: - payload = ( - "" - ) - with self.assertRaises((unit_test_api.ApiValueError, unit_test_api.ApiTypeError)): - body = post.request_body.RequestBody.content["application/json"].schema.from_openapi_data_( - payload, - configuration_=self.schema_config - ) - self.api.post(body=body) - - def test_a_float_is_not_a_boolean_fails(self): - content_type = 'application/json' - # a float is not a boolean - with patch.object(urllib3.PoolManager, 'request') as mock_request: - payload = ( - 1.1 - ) - with self.assertRaises((unit_test_api.ApiValueError, unit_test_api.ApiTypeError)): - body = post.request_body.RequestBody.content["application/json"].schema.from_openapi_data_( - payload, - configuration_=self.schema_config - ) - self.api.post(body=body) - - def test_null_is_not_a_boolean_fails(self): - content_type = 'application/json' - # null is not a boolean - with patch.object(urllib3.PoolManager, 'request') as mock_request: - payload = ( - None - ) - with self.assertRaises((unit_test_api.ApiValueError, unit_test_api.ApiTypeError)): - body = post.request_body.RequestBody.content["application/json"].schema.from_openapi_data_( - payload, - configuration_=self.schema_config - ) - self.api.post(body=body) - - def test_zero_is_not_a_boolean_fails(self): - content_type = 'application/json' - # zero is not a boolean - with patch.object(urllib3.PoolManager, 'request') as mock_request: - payload = ( - 0 - ) - with self.assertRaises((unit_test_api.ApiValueError, unit_test_api.ApiTypeError)): - body = post.request_body.RequestBody.content["application/json"].schema.from_openapi_data_( - payload, - configuration_=self.schema_config - ) - self.api.post(body=body) - - def test_an_array_is_not_a_boolean_fails(self): - content_type = 'application/json' - # an array is not a boolean - with patch.object(urllib3.PoolManager, 'request') as mock_request: - payload = ( - [ - ] - ) - with self.assertRaises((unit_test_api.ApiValueError, unit_test_api.ApiTypeError)): - body = post.request_body.RequestBody.content["application/json"].schema.from_openapi_data_( - payload, - configuration_=self.schema_config - ) - self.api.post(body=body) - - def test_a_string_is_not_a_boolean_fails(self): - content_type = 'application/json' - # a string is not a boolean - with patch.object(urllib3.PoolManager, 'request') as mock_request: - payload = ( - "foo" - ) - with self.assertRaises((unit_test_api.ApiValueError, unit_test_api.ApiTypeError)): - body = post.request_body.RequestBody.content["application/json"].schema.from_openapi_data_( - payload, - configuration_=self.schema_config - ) - self.api.post(body=body) - - def test_false_is_a_boolean_passes(self): - content_type = 'application/json' - # false is a boolean - with patch.object(urllib3.PoolManager, 'request') as mock_request: - payload = ( - False - ) - body = post.request_body.RequestBody.content["application/json"].schema.from_openapi_data_( - payload, - configuration_=self.schema_config - ) - mock_request.return_value = self.response( - self.json_bytes(self.response_body), - status=self.response_status - ) - api_response = self.api.post( - body=body, - content_type=content_type - ) - self.assert_pool_manager_request_called_with( - mock_request, - self.api_config.get_server_url('servers', None) + "/requestBody/postBooleanTypeMatchesBooleansRequestBody", - method='post'.upper(), - body=self.json_bytes(payload), - content_type=content_type, - ) - - assert isinstance(api_response.response, urllib3.HTTPResponse) - assert isinstance(api_response.body, schemas.Unset) - - def test_an_integer_is_not_a_boolean_fails(self): - content_type = 'application/json' - # an integer is not a boolean - with patch.object(urllib3.PoolManager, 'request') as mock_request: - payload = ( - 1 - ) - with self.assertRaises((unit_test_api.ApiValueError, unit_test_api.ApiTypeError)): - body = post.request_body.RequestBody.content["application/json"].schema.from_openapi_data_( - payload, - configuration_=self.schema_config - ) - self.api.post(body=body) - - def test_true_is_a_boolean_passes(self): - content_type = 'application/json' - # true is a boolean - with patch.object(urllib3.PoolManager, 'request') as mock_request: - payload = ( - True - ) - body = post.request_body.RequestBody.content["application/json"].schema.from_openapi_data_( - payload, - configuration_=self.schema_config - ) - mock_request.return_value = self.response( - self.json_bytes(self.response_body), - status=self.response_status - ) - api_response = self.api.post( - body=body, - content_type=content_type - ) - self.assert_pool_manager_request_called_with( - mock_request, - self.api_config.get_server_url('servers', None) + "/requestBody/postBooleanTypeMatchesBooleansRequestBody", - method='post'.upper(), - body=self.json_bytes(payload), - content_type=content_type, - ) - - assert isinstance(api_response.response, urllib3.HTTPResponse) - assert isinstance(api_response.body, schemas.Unset) - - def test_an_object_is_not_a_boolean_fails(self): - content_type = 'application/json' - # an object is not a boolean - with patch.object(urllib3.PoolManager, 'request') as mock_request: - payload = ( - { - } - ) - with self.assertRaises((unit_test_api.ApiValueError, unit_test_api.ApiTypeError)): - body = post.request_body.RequestBody.content["application/json"].schema.from_openapi_data_( - payload, - configuration_=self.schema_config - ) - self.api.post(body=body) - -if __name__ == '__main__': - unittest.main() diff --git a/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_request_body_post_by_int_request_body/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_request_body_post_by_int_request_body/__init__.py index 4c8126395f7..e69de29bb2d 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_request_body_post_by_int_request_body/__init__.py +++ b/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_request_body_post_by_int_request_body/__init__.py @@ -1,109 +0,0 @@ -# coding: utf-8 - -""" - - - Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator -""" - -import unittest -from unittest.mock import patch - -import urllib3 - -import unit_test_api -from unit_test_api.paths.request_body_post_by_int_request_body.post import operation as post # noqa: E501 -from unit_test_api import schemas, api_client -from unit_test_api.configurations import api_configuration, schema_configuration - -from .. import ApiTestMixin - - -class TestPost(ApiTestMixin, unittest.TestCase): - """ - Post unit test stubs - """ - api_config = api_configuration.ApiConfiguration() - schema_config = schema_configuration.SchemaConfiguration() - used_api_client = api_client.ApiClient(configuration=api_config, schema_config=schema_config) - api = post.ApiForPost(api_client=used_api_client) # noqa: E501 - - response_status = 200 - response_body = '' - - def test_int_by_int_fail_fails(self): - content_type = 'application/json' - # int by int fail - with patch.object(urllib3.PoolManager, 'request') as mock_request: - payload = ( - 7 - ) - with self.assertRaises((unit_test_api.ApiValueError, unit_test_api.ApiTypeError)): - body = post.request_body.RequestBody.content["application/json"].schema.from_openapi_data_( - payload, - configuration_=self.schema_config - ) - self.api.post(body=body) - - def test_int_by_int_passes(self): - content_type = 'application/json' - # int by int - with patch.object(urllib3.PoolManager, 'request') as mock_request: - payload = ( - 10 - ) - body = post.request_body.RequestBody.content["application/json"].schema.from_openapi_data_( - payload, - configuration_=self.schema_config - ) - mock_request.return_value = self.response( - self.json_bytes(self.response_body), - status=self.response_status - ) - api_response = self.api.post( - body=body, - content_type=content_type - ) - self.assert_pool_manager_request_called_with( - mock_request, - self.api_config.get_server_url('servers', None) + "/requestBody/postByIntRequestBody", - method='post'.upper(), - body=self.json_bytes(payload), - content_type=content_type, - ) - - assert isinstance(api_response.response, urllib3.HTTPResponse) - assert isinstance(api_response.body, schemas.Unset) - - def test_ignores_non_numbers_passes(self): - content_type = 'application/json' - # ignores non-numbers - with patch.object(urllib3.PoolManager, 'request') as mock_request: - payload = ( - "foo" - ) - body = post.request_body.RequestBody.content["application/json"].schema.from_openapi_data_( - payload, - configuration_=self.schema_config - ) - mock_request.return_value = self.response( - self.json_bytes(self.response_body), - status=self.response_status - ) - api_response = self.api.post( - body=body, - content_type=content_type - ) - self.assert_pool_manager_request_called_with( - mock_request, - self.api_config.get_server_url('servers', None) + "/requestBody/postByIntRequestBody", - method='post'.upper(), - body=self.json_bytes(payload), - content_type=content_type, - ) - - assert isinstance(api_response.response, urllib3.HTTPResponse) - assert isinstance(api_response.body, schemas.Unset) - -if __name__ == '__main__': - unittest.main() diff --git a/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_request_body_post_by_number_request_body/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_request_body_post_by_number_request_body/__init__.py index 3403efd98d7..e69de29bb2d 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_request_body_post_by_number_request_body/__init__.py +++ b/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_request_body_post_by_number_request_body/__init__.py @@ -1,109 +0,0 @@ -# coding: utf-8 - -""" - - - Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator -""" - -import unittest -from unittest.mock import patch - -import urllib3 - -import unit_test_api -from unit_test_api.paths.request_body_post_by_number_request_body.post import operation as post # noqa: E501 -from unit_test_api import schemas, api_client -from unit_test_api.configurations import api_configuration, schema_configuration - -from .. import ApiTestMixin - - -class TestPost(ApiTestMixin, unittest.TestCase): - """ - Post unit test stubs - """ - api_config = api_configuration.ApiConfiguration() - schema_config = schema_configuration.SchemaConfiguration() - used_api_client = api_client.ApiClient(configuration=api_config, schema_config=schema_config) - api = post.ApiForPost(api_client=used_api_client) # noqa: E501 - - response_status = 200 - response_body = '' - - def test_45_is_multiple_of15_passes(self): - content_type = 'application/json' - # 4.5 is multiple of 1.5 - with patch.object(urllib3.PoolManager, 'request') as mock_request: - payload = ( - 4.5 - ) - body = post.request_body.RequestBody.content["application/json"].schema.from_openapi_data_( - payload, - configuration_=self.schema_config - ) - mock_request.return_value = self.response( - self.json_bytes(self.response_body), - status=self.response_status - ) - api_response = self.api.post( - body=body, - content_type=content_type - ) - self.assert_pool_manager_request_called_with( - mock_request, - self.api_config.get_server_url('servers', None) + "/requestBody/postByNumberRequestBody", - method='post'.upper(), - body=self.json_bytes(payload), - content_type=content_type, - ) - - assert isinstance(api_response.response, urllib3.HTTPResponse) - assert isinstance(api_response.body, schemas.Unset) - - def test_35_is_not_multiple_of15_fails(self): - content_type = 'application/json' - # 35 is not multiple of 1.5 - with patch.object(urllib3.PoolManager, 'request') as mock_request: - payload = ( - 35 - ) - with self.assertRaises((unit_test_api.ApiValueError, unit_test_api.ApiTypeError)): - body = post.request_body.RequestBody.content["application/json"].schema.from_openapi_data_( - payload, - configuration_=self.schema_config - ) - self.api.post(body=body) - - def test_zero_is_multiple_of_anything_passes(self): - content_type = 'application/json' - # zero is multiple of anything - with patch.object(urllib3.PoolManager, 'request') as mock_request: - payload = ( - 0 - ) - body = post.request_body.RequestBody.content["application/json"].schema.from_openapi_data_( - payload, - configuration_=self.schema_config - ) - mock_request.return_value = self.response( - self.json_bytes(self.response_body), - status=self.response_status - ) - api_response = self.api.post( - body=body, - content_type=content_type - ) - self.assert_pool_manager_request_called_with( - mock_request, - self.api_config.get_server_url('servers', None) + "/requestBody/postByNumberRequestBody", - method='post'.upper(), - body=self.json_bytes(payload), - content_type=content_type, - ) - - assert isinstance(api_response.response, urllib3.HTTPResponse) - assert isinstance(api_response.body, schemas.Unset) - -if __name__ == '__main__': - unittest.main() diff --git a/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_request_body_post_by_small_number_request_body/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_request_body_post_by_small_number_request_body/__init__.py index 7c6bec3b71e..e69de29bb2d 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_request_body_post_by_small_number_request_body/__init__.py +++ b/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_request_body_post_by_small_number_request_body/__init__.py @@ -1,79 +0,0 @@ -# coding: utf-8 - -""" - - - Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator -""" - -import unittest -from unittest.mock import patch - -import urllib3 - -import unit_test_api -from unit_test_api.paths.request_body_post_by_small_number_request_body.post import operation as post # noqa: E501 -from unit_test_api import schemas, api_client -from unit_test_api.configurations import api_configuration, schema_configuration - -from .. import ApiTestMixin - - -class TestPost(ApiTestMixin, unittest.TestCase): - """ - Post unit test stubs - """ - api_config = api_configuration.ApiConfiguration() - schema_config = schema_configuration.SchemaConfiguration() - used_api_client = api_client.ApiClient(configuration=api_config, schema_config=schema_config) - api = post.ApiForPost(api_client=used_api_client) # noqa: E501 - - response_status = 200 - response_body = '' - - def test_000751_is_not_multiple_of00001_fails(self): - content_type = 'application/json' - # 0.00751 is not multiple of 0.0001 - with patch.object(urllib3.PoolManager, 'request') as mock_request: - payload = ( - 0.00751 - ) - with self.assertRaises((unit_test_api.ApiValueError, unit_test_api.ApiTypeError)): - body = post.request_body.RequestBody.content["application/json"].schema.from_openapi_data_( - payload, - configuration_=self.schema_config - ) - self.api.post(body=body) - - def test_00075_is_multiple_of00001_passes(self): - content_type = 'application/json' - # 0.0075 is multiple of 0.0001 - with patch.object(urllib3.PoolManager, 'request') as mock_request: - payload = ( - 0.0075 - ) - body = post.request_body.RequestBody.content["application/json"].schema.from_openapi_data_( - payload, - configuration_=self.schema_config - ) - mock_request.return_value = self.response( - self.json_bytes(self.response_body), - status=self.response_status - ) - api_response = self.api.post( - body=body, - content_type=content_type - ) - self.assert_pool_manager_request_called_with( - mock_request, - self.api_config.get_server_url('servers', None) + "/requestBody/postBySmallNumberRequestBody", - method='post'.upper(), - body=self.json_bytes(payload), - content_type=content_type, - ) - - assert isinstance(api_response.response, urllib3.HTTPResponse) - assert isinstance(api_response.body, schemas.Unset) - -if __name__ == '__main__': - unittest.main() diff --git a/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_request_body_post_date_time_format_request_body/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_request_body_post_date_time_format_request_body/__init__.py index 05868c772a0..e69de29bb2d 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_request_body_post_date_time_format_request_body/__init__.py +++ b/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_request_body_post_date_time_format_request_body/__init__.py @@ -1,217 +0,0 @@ -# coding: utf-8 - -""" - - - Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator -""" - -import unittest -from unittest.mock import patch - -import urllib3 - -import unit_test_api -from unit_test_api.paths.request_body_post_date_time_format_request_body.post import operation as post # noqa: E501 -from unit_test_api import schemas, api_client -from unit_test_api.configurations import api_configuration, schema_configuration - -from .. import ApiTestMixin - - -class TestPost(ApiTestMixin, unittest.TestCase): - """ - Post unit test stubs - """ - api_config = api_configuration.ApiConfiguration() - schema_config = schema_configuration.SchemaConfiguration() - used_api_client = api_client.ApiClient(configuration=api_config, schema_config=schema_config) - api = post.ApiForPost(api_client=used_api_client) # noqa: E501 - - response_status = 200 - response_body = '' - - def test_all_string_formats_ignore_objects_passes(self): - content_type = 'application/json' - # all string formats ignore objects - with patch.object(urllib3.PoolManager, 'request') as mock_request: - payload = ( - { - } - ) - body = post.request_body.RequestBody.content["application/json"].schema.from_openapi_data_( - payload, - configuration_=self.schema_config - ) - mock_request.return_value = self.response( - self.json_bytes(self.response_body), - status=self.response_status - ) - api_response = self.api.post( - body=body, - content_type=content_type - ) - self.assert_pool_manager_request_called_with( - mock_request, - self.api_config.get_server_url('servers', None) + "/requestBody/postDateTimeFormatRequestBody", - method='post'.upper(), - body=self.json_bytes(payload), - content_type=content_type, - ) - - assert isinstance(api_response.response, urllib3.HTTPResponse) - assert isinstance(api_response.body, schemas.Unset) - - def test_all_string_formats_ignore_booleans_passes(self): - content_type = 'application/json' - # all string formats ignore booleans - with patch.object(urllib3.PoolManager, 'request') as mock_request: - payload = ( - False - ) - body = post.request_body.RequestBody.content["application/json"].schema.from_openapi_data_( - payload, - configuration_=self.schema_config - ) - mock_request.return_value = self.response( - self.json_bytes(self.response_body), - status=self.response_status - ) - api_response = self.api.post( - body=body, - content_type=content_type - ) - self.assert_pool_manager_request_called_with( - mock_request, - self.api_config.get_server_url('servers', None) + "/requestBody/postDateTimeFormatRequestBody", - method='post'.upper(), - body=self.json_bytes(payload), - content_type=content_type, - ) - - assert isinstance(api_response.response, urllib3.HTTPResponse) - assert isinstance(api_response.body, schemas.Unset) - - def test_all_string_formats_ignore_integers_passes(self): - content_type = 'application/json' - # all string formats ignore integers - with patch.object(urllib3.PoolManager, 'request') as mock_request: - payload = ( - 12 - ) - body = post.request_body.RequestBody.content["application/json"].schema.from_openapi_data_( - payload, - configuration_=self.schema_config - ) - mock_request.return_value = self.response( - self.json_bytes(self.response_body), - status=self.response_status - ) - api_response = self.api.post( - body=body, - content_type=content_type - ) - self.assert_pool_manager_request_called_with( - mock_request, - self.api_config.get_server_url('servers', None) + "/requestBody/postDateTimeFormatRequestBody", - method='post'.upper(), - body=self.json_bytes(payload), - content_type=content_type, - ) - - assert isinstance(api_response.response, urllib3.HTTPResponse) - assert isinstance(api_response.body, schemas.Unset) - - def test_all_string_formats_ignore_floats_passes(self): - content_type = 'application/json' - # all string formats ignore floats - with patch.object(urllib3.PoolManager, 'request') as mock_request: - payload = ( - 13.7 - ) - body = post.request_body.RequestBody.content["application/json"].schema.from_openapi_data_( - payload, - configuration_=self.schema_config - ) - mock_request.return_value = self.response( - self.json_bytes(self.response_body), - status=self.response_status - ) - api_response = self.api.post( - body=body, - content_type=content_type - ) - self.assert_pool_manager_request_called_with( - mock_request, - self.api_config.get_server_url('servers', None) + "/requestBody/postDateTimeFormatRequestBody", - method='post'.upper(), - body=self.json_bytes(payload), - content_type=content_type, - ) - - assert isinstance(api_response.response, urllib3.HTTPResponse) - assert isinstance(api_response.body, schemas.Unset) - - def test_all_string_formats_ignore_arrays_passes(self): - content_type = 'application/json' - # all string formats ignore arrays - with patch.object(urllib3.PoolManager, 'request') as mock_request: - payload = ( - [ - ] - ) - body = post.request_body.RequestBody.content["application/json"].schema.from_openapi_data_( - payload, - configuration_=self.schema_config - ) - mock_request.return_value = self.response( - self.json_bytes(self.response_body), - status=self.response_status - ) - api_response = self.api.post( - body=body, - content_type=content_type - ) - self.assert_pool_manager_request_called_with( - mock_request, - self.api_config.get_server_url('servers', None) + "/requestBody/postDateTimeFormatRequestBody", - method='post'.upper(), - body=self.json_bytes(payload), - content_type=content_type, - ) - - assert isinstance(api_response.response, urllib3.HTTPResponse) - assert isinstance(api_response.body, schemas.Unset) - - def test_all_string_formats_ignore_nulls_passes(self): - content_type = 'application/json' - # all string formats ignore nulls - with patch.object(urllib3.PoolManager, 'request') as mock_request: - payload = ( - None - ) - body = post.request_body.RequestBody.content["application/json"].schema.from_openapi_data_( - payload, - configuration_=self.schema_config - ) - mock_request.return_value = self.response( - self.json_bytes(self.response_body), - status=self.response_status - ) - api_response = self.api.post( - body=body, - content_type=content_type - ) - self.assert_pool_manager_request_called_with( - mock_request, - self.api_config.get_server_url('servers', None) + "/requestBody/postDateTimeFormatRequestBody", - method='post'.upper(), - body=self.json_bytes(payload), - content_type=content_type, - ) - - assert isinstance(api_response.response, urllib3.HTTPResponse) - assert isinstance(api_response.body, schemas.Unset) - -if __name__ == '__main__': - unittest.main() diff --git a/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_request_body_post_email_format_request_body/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_request_body_post_email_format_request_body/__init__.py index 03b32547c96..e69de29bb2d 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_request_body_post_email_format_request_body/__init__.py +++ b/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_request_body_post_email_format_request_body/__init__.py @@ -1,217 +0,0 @@ -# coding: utf-8 - -""" - - - Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator -""" - -import unittest -from unittest.mock import patch - -import urllib3 - -import unit_test_api -from unit_test_api.paths.request_body_post_email_format_request_body.post import operation as post # noqa: E501 -from unit_test_api import schemas, api_client -from unit_test_api.configurations import api_configuration, schema_configuration - -from .. import ApiTestMixin - - -class TestPost(ApiTestMixin, unittest.TestCase): - """ - Post unit test stubs - """ - api_config = api_configuration.ApiConfiguration() - schema_config = schema_configuration.SchemaConfiguration() - used_api_client = api_client.ApiClient(configuration=api_config, schema_config=schema_config) - api = post.ApiForPost(api_client=used_api_client) # noqa: E501 - - response_status = 200 - response_body = '' - - def test_all_string_formats_ignore_objects_passes(self): - content_type = 'application/json' - # all string formats ignore objects - with patch.object(urllib3.PoolManager, 'request') as mock_request: - payload = ( - { - } - ) - body = post.request_body.RequestBody.content["application/json"].schema.from_openapi_data_( - payload, - configuration_=self.schema_config - ) - mock_request.return_value = self.response( - self.json_bytes(self.response_body), - status=self.response_status - ) - api_response = self.api.post( - body=body, - content_type=content_type - ) - self.assert_pool_manager_request_called_with( - mock_request, - self.api_config.get_server_url('servers', None) + "/requestBody/postEmailFormatRequestBody", - method='post'.upper(), - body=self.json_bytes(payload), - content_type=content_type, - ) - - assert isinstance(api_response.response, urllib3.HTTPResponse) - assert isinstance(api_response.body, schemas.Unset) - - def test_all_string_formats_ignore_booleans_passes(self): - content_type = 'application/json' - # all string formats ignore booleans - with patch.object(urllib3.PoolManager, 'request') as mock_request: - payload = ( - False - ) - body = post.request_body.RequestBody.content["application/json"].schema.from_openapi_data_( - payload, - configuration_=self.schema_config - ) - mock_request.return_value = self.response( - self.json_bytes(self.response_body), - status=self.response_status - ) - api_response = self.api.post( - body=body, - content_type=content_type - ) - self.assert_pool_manager_request_called_with( - mock_request, - self.api_config.get_server_url('servers', None) + "/requestBody/postEmailFormatRequestBody", - method='post'.upper(), - body=self.json_bytes(payload), - content_type=content_type, - ) - - assert isinstance(api_response.response, urllib3.HTTPResponse) - assert isinstance(api_response.body, schemas.Unset) - - def test_all_string_formats_ignore_integers_passes(self): - content_type = 'application/json' - # all string formats ignore integers - with patch.object(urllib3.PoolManager, 'request') as mock_request: - payload = ( - 12 - ) - body = post.request_body.RequestBody.content["application/json"].schema.from_openapi_data_( - payload, - configuration_=self.schema_config - ) - mock_request.return_value = self.response( - self.json_bytes(self.response_body), - status=self.response_status - ) - api_response = self.api.post( - body=body, - content_type=content_type - ) - self.assert_pool_manager_request_called_with( - mock_request, - self.api_config.get_server_url('servers', None) + "/requestBody/postEmailFormatRequestBody", - method='post'.upper(), - body=self.json_bytes(payload), - content_type=content_type, - ) - - assert isinstance(api_response.response, urllib3.HTTPResponse) - assert isinstance(api_response.body, schemas.Unset) - - def test_all_string_formats_ignore_floats_passes(self): - content_type = 'application/json' - # all string formats ignore floats - with patch.object(urllib3.PoolManager, 'request') as mock_request: - payload = ( - 13.7 - ) - body = post.request_body.RequestBody.content["application/json"].schema.from_openapi_data_( - payload, - configuration_=self.schema_config - ) - mock_request.return_value = self.response( - self.json_bytes(self.response_body), - status=self.response_status - ) - api_response = self.api.post( - body=body, - content_type=content_type - ) - self.assert_pool_manager_request_called_with( - mock_request, - self.api_config.get_server_url('servers', None) + "/requestBody/postEmailFormatRequestBody", - method='post'.upper(), - body=self.json_bytes(payload), - content_type=content_type, - ) - - assert isinstance(api_response.response, urllib3.HTTPResponse) - assert isinstance(api_response.body, schemas.Unset) - - def test_all_string_formats_ignore_arrays_passes(self): - content_type = 'application/json' - # all string formats ignore arrays - with patch.object(urllib3.PoolManager, 'request') as mock_request: - payload = ( - [ - ] - ) - body = post.request_body.RequestBody.content["application/json"].schema.from_openapi_data_( - payload, - configuration_=self.schema_config - ) - mock_request.return_value = self.response( - self.json_bytes(self.response_body), - status=self.response_status - ) - api_response = self.api.post( - body=body, - content_type=content_type - ) - self.assert_pool_manager_request_called_with( - mock_request, - self.api_config.get_server_url('servers', None) + "/requestBody/postEmailFormatRequestBody", - method='post'.upper(), - body=self.json_bytes(payload), - content_type=content_type, - ) - - assert isinstance(api_response.response, urllib3.HTTPResponse) - assert isinstance(api_response.body, schemas.Unset) - - def test_all_string_formats_ignore_nulls_passes(self): - content_type = 'application/json' - # all string formats ignore nulls - with patch.object(urllib3.PoolManager, 'request') as mock_request: - payload = ( - None - ) - body = post.request_body.RequestBody.content["application/json"].schema.from_openapi_data_( - payload, - configuration_=self.schema_config - ) - mock_request.return_value = self.response( - self.json_bytes(self.response_body), - status=self.response_status - ) - api_response = self.api.post( - body=body, - content_type=content_type - ) - self.assert_pool_manager_request_called_with( - mock_request, - self.api_config.get_server_url('servers', None) + "/requestBody/postEmailFormatRequestBody", - method='post'.upper(), - body=self.json_bytes(payload), - content_type=content_type, - ) - - assert isinstance(api_response.response, urllib3.HTTPResponse) - assert isinstance(api_response.body, schemas.Unset) - -if __name__ == '__main__': - unittest.main() diff --git a/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_request_body_post_enum_with0_does_not_match_false_request_body/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_request_body_post_enum_with0_does_not_match_false_request_body/__init__.py index a55a58c64df..e69de29bb2d 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_request_body_post_enum_with0_does_not_match_false_request_body/__init__.py +++ b/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_request_body_post_enum_with0_does_not_match_false_request_body/__init__.py @@ -1,109 +0,0 @@ -# coding: utf-8 - -""" - - - Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator -""" - -import unittest -from unittest.mock import patch - -import urllib3 - -import unit_test_api -from unit_test_api.paths.request_body_post_enum_with0_does_not_match_false_request_body.post import operation as post # noqa: E501 -from unit_test_api import schemas, api_client -from unit_test_api.configurations import api_configuration, schema_configuration - -from .. import ApiTestMixin - - -class TestPost(ApiTestMixin, unittest.TestCase): - """ - Post unit test stubs - """ - api_config = api_configuration.ApiConfiguration() - schema_config = schema_configuration.SchemaConfiguration() - used_api_client = api_client.ApiClient(configuration=api_config, schema_config=schema_config) - api = post.ApiForPost(api_client=used_api_client) # noqa: E501 - - response_status = 200 - response_body = '' - - def test_integer_zero_is_valid_passes(self): - content_type = 'application/json' - # integer zero is valid - with patch.object(urllib3.PoolManager, 'request') as mock_request: - payload = ( - 0 - ) - body = post.request_body.RequestBody.content["application/json"].schema.from_openapi_data_( - payload, - configuration_=self.schema_config - ) - mock_request.return_value = self.response( - self.json_bytes(self.response_body), - status=self.response_status - ) - api_response = self.api.post( - body=body, - content_type=content_type - ) - self.assert_pool_manager_request_called_with( - mock_request, - self.api_config.get_server_url('servers', None) + "/requestBody/postEnumWith0DoesNotMatchFalseRequestBody", - method='post'.upper(), - body=self.json_bytes(payload), - content_type=content_type, - ) - - assert isinstance(api_response.response, urllib3.HTTPResponse) - assert isinstance(api_response.body, schemas.Unset) - - def test_float_zero_is_valid_passes(self): - content_type = 'application/json' - # float zero is valid - with patch.object(urllib3.PoolManager, 'request') as mock_request: - payload = ( - 0.0 - ) - body = post.request_body.RequestBody.content["application/json"].schema.from_openapi_data_( - payload, - configuration_=self.schema_config - ) - mock_request.return_value = self.response( - self.json_bytes(self.response_body), - status=self.response_status - ) - api_response = self.api.post( - body=body, - content_type=content_type - ) - self.assert_pool_manager_request_called_with( - mock_request, - self.api_config.get_server_url('servers', None) + "/requestBody/postEnumWith0DoesNotMatchFalseRequestBody", - method='post'.upper(), - body=self.json_bytes(payload), - content_type=content_type, - ) - - assert isinstance(api_response.response, urllib3.HTTPResponse) - assert isinstance(api_response.body, schemas.Unset) - - def test_false_is_invalid_fails(self): - content_type = 'application/json' - # false is invalid - with patch.object(urllib3.PoolManager, 'request') as mock_request: - payload = ( - False - ) - with self.assertRaises((unit_test_api.ApiValueError, unit_test_api.ApiTypeError)): - body = post.request_body.RequestBody.content["application/json"].schema.from_openapi_data_( - payload, - configuration_=self.schema_config - ) - self.api.post(body=body) - -if __name__ == '__main__': - unittest.main() diff --git a/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_request_body_post_enum_with1_does_not_match_true_request_body/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_request_body_post_enum_with1_does_not_match_true_request_body/__init__.py index 902e9722609..e69de29bb2d 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_request_body_post_enum_with1_does_not_match_true_request_body/__init__.py +++ b/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_request_body_post_enum_with1_does_not_match_true_request_body/__init__.py @@ -1,109 +0,0 @@ -# coding: utf-8 - -""" - - - Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator -""" - -import unittest -from unittest.mock import patch - -import urllib3 - -import unit_test_api -from unit_test_api.paths.request_body_post_enum_with1_does_not_match_true_request_body.post import operation as post # noqa: E501 -from unit_test_api import schemas, api_client -from unit_test_api.configurations import api_configuration, schema_configuration - -from .. import ApiTestMixin - - -class TestPost(ApiTestMixin, unittest.TestCase): - """ - Post unit test stubs - """ - api_config = api_configuration.ApiConfiguration() - schema_config = schema_configuration.SchemaConfiguration() - used_api_client = api_client.ApiClient(configuration=api_config, schema_config=schema_config) - api = post.ApiForPost(api_client=used_api_client) # noqa: E501 - - response_status = 200 - response_body = '' - - def test_true_is_invalid_fails(self): - content_type = 'application/json' - # true is invalid - with patch.object(urllib3.PoolManager, 'request') as mock_request: - payload = ( - True - ) - with self.assertRaises((unit_test_api.ApiValueError, unit_test_api.ApiTypeError)): - body = post.request_body.RequestBody.content["application/json"].schema.from_openapi_data_( - payload, - configuration_=self.schema_config - ) - self.api.post(body=body) - - def test_integer_one_is_valid_passes(self): - content_type = 'application/json' - # integer one is valid - with patch.object(urllib3.PoolManager, 'request') as mock_request: - payload = ( - 1 - ) - body = post.request_body.RequestBody.content["application/json"].schema.from_openapi_data_( - payload, - configuration_=self.schema_config - ) - mock_request.return_value = self.response( - self.json_bytes(self.response_body), - status=self.response_status - ) - api_response = self.api.post( - body=body, - content_type=content_type - ) - self.assert_pool_manager_request_called_with( - mock_request, - self.api_config.get_server_url('servers', None) + "/requestBody/postEnumWith1DoesNotMatchTrueRequestBody", - method='post'.upper(), - body=self.json_bytes(payload), - content_type=content_type, - ) - - assert isinstance(api_response.response, urllib3.HTTPResponse) - assert isinstance(api_response.body, schemas.Unset) - - def test_float_one_is_valid_passes(self): - content_type = 'application/json' - # float one is valid - with patch.object(urllib3.PoolManager, 'request') as mock_request: - payload = ( - 1.0 - ) - body = post.request_body.RequestBody.content["application/json"].schema.from_openapi_data_( - payload, - configuration_=self.schema_config - ) - mock_request.return_value = self.response( - self.json_bytes(self.response_body), - status=self.response_status - ) - api_response = self.api.post( - body=body, - content_type=content_type - ) - self.assert_pool_manager_request_called_with( - mock_request, - self.api_config.get_server_url('servers', None) + "/requestBody/postEnumWith1DoesNotMatchTrueRequestBody", - method='post'.upper(), - body=self.json_bytes(payload), - content_type=content_type, - ) - - assert isinstance(api_response.response, urllib3.HTTPResponse) - assert isinstance(api_response.body, schemas.Unset) - -if __name__ == '__main__': - unittest.main() diff --git a/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_request_body_post_enum_with_escaped_characters_request_body/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_request_body_post_enum_with_escaped_characters_request_body/__init__.py index d653736932c..e69de29bb2d 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_request_body_post_enum_with_escaped_characters_request_body/__init__.py +++ b/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_request_body_post_enum_with_escaped_characters_request_body/__init__.py @@ -1,109 +0,0 @@ -# coding: utf-8 - -""" - - - Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator -""" - -import unittest -from unittest.mock import patch - -import urllib3 - -import unit_test_api -from unit_test_api.paths.request_body_post_enum_with_escaped_characters_request_body.post import operation as post # noqa: E501 -from unit_test_api import schemas, api_client -from unit_test_api.configurations import api_configuration, schema_configuration - -from .. import ApiTestMixin - - -class TestPost(ApiTestMixin, unittest.TestCase): - """ - Post unit test stubs - """ - api_config = api_configuration.ApiConfiguration() - schema_config = schema_configuration.SchemaConfiguration() - used_api_client = api_client.ApiClient(configuration=api_config, schema_config=schema_config) - api = post.ApiForPost(api_client=used_api_client) # noqa: E501 - - response_status = 200 - response_body = '' - - def test_member2_is_valid_passes(self): - content_type = 'application/json' - # member 2 is valid - with patch.object(urllib3.PoolManager, 'request') as mock_request: - payload = ( - "foo\rbar" - ) - body = post.request_body.RequestBody.content["application/json"].schema.from_openapi_data_( - payload, - configuration_=self.schema_config - ) - mock_request.return_value = self.response( - self.json_bytes(self.response_body), - status=self.response_status - ) - api_response = self.api.post( - body=body, - content_type=content_type - ) - self.assert_pool_manager_request_called_with( - mock_request, - self.api_config.get_server_url('servers', None) + "/requestBody/postEnumWithEscapedCharactersRequestBody", - method='post'.upper(), - body=self.json_bytes(payload), - content_type=content_type, - ) - - assert isinstance(api_response.response, urllib3.HTTPResponse) - assert isinstance(api_response.body, schemas.Unset) - - def test_member1_is_valid_passes(self): - content_type = 'application/json' - # member 1 is valid - with patch.object(urllib3.PoolManager, 'request') as mock_request: - payload = ( - "foo\nbar" - ) - body = post.request_body.RequestBody.content["application/json"].schema.from_openapi_data_( - payload, - configuration_=self.schema_config - ) - mock_request.return_value = self.response( - self.json_bytes(self.response_body), - status=self.response_status - ) - api_response = self.api.post( - body=body, - content_type=content_type - ) - self.assert_pool_manager_request_called_with( - mock_request, - self.api_config.get_server_url('servers', None) + "/requestBody/postEnumWithEscapedCharactersRequestBody", - method='post'.upper(), - body=self.json_bytes(payload), - content_type=content_type, - ) - - assert isinstance(api_response.response, urllib3.HTTPResponse) - assert isinstance(api_response.body, schemas.Unset) - - def test_another_string_is_invalid_fails(self): - content_type = 'application/json' - # another string is invalid - with patch.object(urllib3.PoolManager, 'request') as mock_request: - payload = ( - "abc" - ) - with self.assertRaises((unit_test_api.ApiValueError, unit_test_api.ApiTypeError)): - body = post.request_body.RequestBody.content["application/json"].schema.from_openapi_data_( - payload, - configuration_=self.schema_config - ) - self.api.post(body=body) - -if __name__ == '__main__': - unittest.main() diff --git a/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_request_body_post_enum_with_false_does_not_match0_request_body/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_request_body_post_enum_with_false_does_not_match0_request_body/__init__.py index 35f67bf7381..e69de29bb2d 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_request_body_post_enum_with_false_does_not_match0_request_body/__init__.py +++ b/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_request_body_post_enum_with_false_does_not_match0_request_body/__init__.py @@ -1,93 +0,0 @@ -# coding: utf-8 - -""" - - - Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator -""" - -import unittest -from unittest.mock import patch - -import urllib3 - -import unit_test_api -from unit_test_api.paths.request_body_post_enum_with_false_does_not_match0_request_body.post import operation as post # noqa: E501 -from unit_test_api import schemas, api_client -from unit_test_api.configurations import api_configuration, schema_configuration - -from .. import ApiTestMixin - - -class TestPost(ApiTestMixin, unittest.TestCase): - """ - Post unit test stubs - """ - api_config = api_configuration.ApiConfiguration() - schema_config = schema_configuration.SchemaConfiguration() - used_api_client = api_client.ApiClient(configuration=api_config, schema_config=schema_config) - api = post.ApiForPost(api_client=used_api_client) # noqa: E501 - - response_status = 200 - response_body = '' - - def test_false_is_valid_passes(self): - content_type = 'application/json' - # false is valid - with patch.object(urllib3.PoolManager, 'request') as mock_request: - payload = ( - False - ) - body = post.request_body.RequestBody.content["application/json"].schema.from_openapi_data_( - payload, - configuration_=self.schema_config - ) - mock_request.return_value = self.response( - self.json_bytes(self.response_body), - status=self.response_status - ) - api_response = self.api.post( - body=body, - content_type=content_type - ) - self.assert_pool_manager_request_called_with( - mock_request, - self.api_config.get_server_url('servers', None) + "/requestBody/postEnumWithFalseDoesNotMatch0RequestBody", - method='post'.upper(), - body=self.json_bytes(payload), - content_type=content_type, - ) - - assert isinstance(api_response.response, urllib3.HTTPResponse) - assert isinstance(api_response.body, schemas.Unset) - - def test_float_zero_is_invalid_fails(self): - content_type = 'application/json' - # float zero is invalid - with patch.object(urllib3.PoolManager, 'request') as mock_request: - payload = ( - 0.0 - ) - with self.assertRaises((unit_test_api.ApiValueError, unit_test_api.ApiTypeError)): - body = post.request_body.RequestBody.content["application/json"].schema.from_openapi_data_( - payload, - configuration_=self.schema_config - ) - self.api.post(body=body) - - def test_integer_zero_is_invalid_fails(self): - content_type = 'application/json' - # integer zero is invalid - with patch.object(urllib3.PoolManager, 'request') as mock_request: - payload = ( - 0 - ) - with self.assertRaises((unit_test_api.ApiValueError, unit_test_api.ApiTypeError)): - body = post.request_body.RequestBody.content["application/json"].schema.from_openapi_data_( - payload, - configuration_=self.schema_config - ) - self.api.post(body=body) - -if __name__ == '__main__': - unittest.main() diff --git a/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_request_body_post_enum_with_true_does_not_match1_request_body/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_request_body_post_enum_with_true_does_not_match1_request_body/__init__.py index e80e1c48b35..e69de29bb2d 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_request_body_post_enum_with_true_does_not_match1_request_body/__init__.py +++ b/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_request_body_post_enum_with_true_does_not_match1_request_body/__init__.py @@ -1,93 +0,0 @@ -# coding: utf-8 - -""" - - - Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator -""" - -import unittest -from unittest.mock import patch - -import urllib3 - -import unit_test_api -from unit_test_api.paths.request_body_post_enum_with_true_does_not_match1_request_body.post import operation as post # noqa: E501 -from unit_test_api import schemas, api_client -from unit_test_api.configurations import api_configuration, schema_configuration - -from .. import ApiTestMixin - - -class TestPost(ApiTestMixin, unittest.TestCase): - """ - Post unit test stubs - """ - api_config = api_configuration.ApiConfiguration() - schema_config = schema_configuration.SchemaConfiguration() - used_api_client = api_client.ApiClient(configuration=api_config, schema_config=schema_config) - api = post.ApiForPost(api_client=used_api_client) # noqa: E501 - - response_status = 200 - response_body = '' - - def test_float_one_is_invalid_fails(self): - content_type = 'application/json' - # float one is invalid - with patch.object(urllib3.PoolManager, 'request') as mock_request: - payload = ( - 1.0 - ) - with self.assertRaises((unit_test_api.ApiValueError, unit_test_api.ApiTypeError)): - body = post.request_body.RequestBody.content["application/json"].schema.from_openapi_data_( - payload, - configuration_=self.schema_config - ) - self.api.post(body=body) - - def test_true_is_valid_passes(self): - content_type = 'application/json' - # true is valid - with patch.object(urllib3.PoolManager, 'request') as mock_request: - payload = ( - True - ) - body = post.request_body.RequestBody.content["application/json"].schema.from_openapi_data_( - payload, - configuration_=self.schema_config - ) - mock_request.return_value = self.response( - self.json_bytes(self.response_body), - status=self.response_status - ) - api_response = self.api.post( - body=body, - content_type=content_type - ) - self.assert_pool_manager_request_called_with( - mock_request, - self.api_config.get_server_url('servers', None) + "/requestBody/postEnumWithTrueDoesNotMatch1RequestBody", - method='post'.upper(), - body=self.json_bytes(payload), - content_type=content_type, - ) - - assert isinstance(api_response.response, urllib3.HTTPResponse) - assert isinstance(api_response.body, schemas.Unset) - - def test_integer_one_is_invalid_fails(self): - content_type = 'application/json' - # integer one is invalid - with patch.object(urllib3.PoolManager, 'request') as mock_request: - payload = ( - 1 - ) - with self.assertRaises((unit_test_api.ApiValueError, unit_test_api.ApiTypeError)): - body = post.request_body.RequestBody.content["application/json"].schema.from_openapi_data_( - payload, - configuration_=self.schema_config - ) - self.api.post(body=body) - -if __name__ == '__main__': - unittest.main() diff --git a/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_request_body_post_enums_in_properties_request_body/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_request_body_post_enums_in_properties_request_body/__init__.py index aed6495ca09..e69de29bb2d 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_request_body_post_enums_in_properties_request_body/__init__.py +++ b/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_request_body_post_enums_in_properties_request_body/__init__.py @@ -1,173 +0,0 @@ -# coding: utf-8 - -""" - - - Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator -""" - -import unittest -from unittest.mock import patch - -import urllib3 - -import unit_test_api -from unit_test_api.paths.request_body_post_enums_in_properties_request_body.post import operation as post # noqa: E501 -from unit_test_api import schemas, api_client -from unit_test_api.configurations import api_configuration, schema_configuration - -from .. import ApiTestMixin - - -class TestPost(ApiTestMixin, unittest.TestCase): - """ - Post unit test stubs - """ - api_config = api_configuration.ApiConfiguration() - schema_config = schema_configuration.SchemaConfiguration() - used_api_client = api_client.ApiClient(configuration=api_config, schema_config=schema_config) - api = post.ApiForPost(api_client=used_api_client) # noqa: E501 - - response_status = 200 - response_body = '' - - def test_missing_optional_property_is_valid_passes(self): - content_type = 'application/json' - # missing optional property is valid - with patch.object(urllib3.PoolManager, 'request') as mock_request: - payload = ( - { - "bar": - "bar", - } - ) - body = post.request_body.RequestBody.content["application/json"].schema.from_openapi_data_( - payload, - configuration_=self.schema_config - ) - mock_request.return_value = self.response( - self.json_bytes(self.response_body), - status=self.response_status - ) - api_response = self.api.post( - body=body, - content_type=content_type - ) - self.assert_pool_manager_request_called_with( - mock_request, - self.api_config.get_server_url('servers', None) + "/requestBody/postEnumsInPropertiesRequestBody", - method='post'.upper(), - body=self.json_bytes(payload), - content_type=content_type, - ) - - assert isinstance(api_response.response, urllib3.HTTPResponse) - assert isinstance(api_response.body, schemas.Unset) - - def test_wrong_foo_value_fails(self): - content_type = 'application/json' - # wrong foo value - with patch.object(urllib3.PoolManager, 'request') as mock_request: - payload = ( - { - "foo": - "foot", - "bar": - "bar", - } - ) - with self.assertRaises((unit_test_api.ApiValueError, unit_test_api.ApiTypeError)): - body = post.request_body.RequestBody.content["application/json"].schema.from_openapi_data_( - payload, - configuration_=self.schema_config - ) - self.api.post(body=body) - - def test_both_properties_are_valid_passes(self): - content_type = 'application/json' - # both properties are valid - with patch.object(urllib3.PoolManager, 'request') as mock_request: - payload = ( - { - "foo": - "foo", - "bar": - "bar", - } - ) - body = post.request_body.RequestBody.content["application/json"].schema.from_openapi_data_( - payload, - configuration_=self.schema_config - ) - mock_request.return_value = self.response( - self.json_bytes(self.response_body), - status=self.response_status - ) - api_response = self.api.post( - body=body, - content_type=content_type - ) - self.assert_pool_manager_request_called_with( - mock_request, - self.api_config.get_server_url('servers', None) + "/requestBody/postEnumsInPropertiesRequestBody", - method='post'.upper(), - body=self.json_bytes(payload), - content_type=content_type, - ) - - assert isinstance(api_response.response, urllib3.HTTPResponse) - assert isinstance(api_response.body, schemas.Unset) - - def test_wrong_bar_value_fails(self): - content_type = 'application/json' - # wrong bar value - with patch.object(urllib3.PoolManager, 'request') as mock_request: - payload = ( - { - "foo": - "foo", - "bar": - "bart", - } - ) - with self.assertRaises((unit_test_api.ApiValueError, unit_test_api.ApiTypeError)): - body = post.request_body.RequestBody.content["application/json"].schema.from_openapi_data_( - payload, - configuration_=self.schema_config - ) - self.api.post(body=body) - - def test_missing_all_properties_is_invalid_fails(self): - content_type = 'application/json' - # missing all properties is invalid - with patch.object(urllib3.PoolManager, 'request') as mock_request: - payload = ( - { - } - ) - with self.assertRaises((unit_test_api.ApiValueError, unit_test_api.ApiTypeError)): - body = post.request_body.RequestBody.content["application/json"].schema.from_openapi_data_( - payload, - configuration_=self.schema_config - ) - self.api.post(body=body) - - def test_missing_required_property_is_invalid_fails(self): - content_type = 'application/json' - # missing required property is invalid - with patch.object(urllib3.PoolManager, 'request') as mock_request: - payload = ( - { - "foo": - "foo", - } - ) - with self.assertRaises((unit_test_api.ApiValueError, unit_test_api.ApiTypeError)): - body = post.request_body.RequestBody.content["application/json"].schema.from_openapi_data_( - payload, - configuration_=self.schema_config - ) - self.api.post(body=body) - -if __name__ == '__main__': - unittest.main() diff --git a/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_request_body_post_forbidden_property_request_body/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_request_body_post_forbidden_property_request_body/__init__.py index e95c8daffc9..e69de29bb2d 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_request_body_post_forbidden_property_request_body/__init__.py +++ b/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_request_body_post_forbidden_property_request_body/__init__.py @@ -1,89 +0,0 @@ -# coding: utf-8 - -""" - - - Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator -""" - -import unittest -from unittest.mock import patch - -import urllib3 - -import unit_test_api -from unit_test_api.paths.request_body_post_forbidden_property_request_body.post import operation as post # noqa: E501 -from unit_test_api import schemas, api_client -from unit_test_api.configurations import api_configuration, schema_configuration - -from .. import ApiTestMixin - - -class TestPost(ApiTestMixin, unittest.TestCase): - """ - Post unit test stubs - """ - api_config = api_configuration.ApiConfiguration() - schema_config = schema_configuration.SchemaConfiguration() - used_api_client = api_client.ApiClient(configuration=api_config, schema_config=schema_config) - api = post.ApiForPost(api_client=used_api_client) # noqa: E501 - - response_status = 200 - response_body = '' - - def test_property_present_fails(self): - content_type = 'application/json' - # property present - with patch.object(urllib3.PoolManager, 'request') as mock_request: - payload = ( - { - "foo": - 1, - "bar": - 2, - } - ) - with self.assertRaises((unit_test_api.ApiValueError, unit_test_api.ApiTypeError)): - body = post.request_body.RequestBody.content["application/json"].schema.from_openapi_data_( - payload, - configuration_=self.schema_config - ) - self.api.post(body=body) - - def test_property_absent_passes(self): - content_type = 'application/json' - # property absent - with patch.object(urllib3.PoolManager, 'request') as mock_request: - payload = ( - { - "bar": - 1, - "baz": - 2, - } - ) - body = post.request_body.RequestBody.content["application/json"].schema.from_openapi_data_( - payload, - configuration_=self.schema_config - ) - mock_request.return_value = self.response( - self.json_bytes(self.response_body), - status=self.response_status - ) - api_response = self.api.post( - body=body, - content_type=content_type - ) - self.assert_pool_manager_request_called_with( - mock_request, - self.api_config.get_server_url('servers', None) + "/requestBody/postForbiddenPropertyRequestBody", - method='post'.upper(), - body=self.json_bytes(payload), - content_type=content_type, - ) - - assert isinstance(api_response.response, urllib3.HTTPResponse) - assert isinstance(api_response.body, schemas.Unset) - -if __name__ == '__main__': - unittest.main() diff --git a/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_request_body_post_hostname_format_request_body/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_request_body_post_hostname_format_request_body/__init__.py index 875c54070e1..e69de29bb2d 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_request_body_post_hostname_format_request_body/__init__.py +++ b/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_request_body_post_hostname_format_request_body/__init__.py @@ -1,217 +0,0 @@ -# coding: utf-8 - -""" - - - Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator -""" - -import unittest -from unittest.mock import patch - -import urllib3 - -import unit_test_api -from unit_test_api.paths.request_body_post_hostname_format_request_body.post import operation as post # noqa: E501 -from unit_test_api import schemas, api_client -from unit_test_api.configurations import api_configuration, schema_configuration - -from .. import ApiTestMixin - - -class TestPost(ApiTestMixin, unittest.TestCase): - """ - Post unit test stubs - """ - api_config = api_configuration.ApiConfiguration() - schema_config = schema_configuration.SchemaConfiguration() - used_api_client = api_client.ApiClient(configuration=api_config, schema_config=schema_config) - api = post.ApiForPost(api_client=used_api_client) # noqa: E501 - - response_status = 200 - response_body = '' - - def test_all_string_formats_ignore_objects_passes(self): - content_type = 'application/json' - # all string formats ignore objects - with patch.object(urllib3.PoolManager, 'request') as mock_request: - payload = ( - { - } - ) - body = post.request_body.RequestBody.content["application/json"].schema.from_openapi_data_( - payload, - configuration_=self.schema_config - ) - mock_request.return_value = self.response( - self.json_bytes(self.response_body), - status=self.response_status - ) - api_response = self.api.post( - body=body, - content_type=content_type - ) - self.assert_pool_manager_request_called_with( - mock_request, - self.api_config.get_server_url('servers', None) + "/requestBody/postHostnameFormatRequestBody", - method='post'.upper(), - body=self.json_bytes(payload), - content_type=content_type, - ) - - assert isinstance(api_response.response, urllib3.HTTPResponse) - assert isinstance(api_response.body, schemas.Unset) - - def test_all_string_formats_ignore_booleans_passes(self): - content_type = 'application/json' - # all string formats ignore booleans - with patch.object(urllib3.PoolManager, 'request') as mock_request: - payload = ( - False - ) - body = post.request_body.RequestBody.content["application/json"].schema.from_openapi_data_( - payload, - configuration_=self.schema_config - ) - mock_request.return_value = self.response( - self.json_bytes(self.response_body), - status=self.response_status - ) - api_response = self.api.post( - body=body, - content_type=content_type - ) - self.assert_pool_manager_request_called_with( - mock_request, - self.api_config.get_server_url('servers', None) + "/requestBody/postHostnameFormatRequestBody", - method='post'.upper(), - body=self.json_bytes(payload), - content_type=content_type, - ) - - assert isinstance(api_response.response, urllib3.HTTPResponse) - assert isinstance(api_response.body, schemas.Unset) - - def test_all_string_formats_ignore_integers_passes(self): - content_type = 'application/json' - # all string formats ignore integers - with patch.object(urllib3.PoolManager, 'request') as mock_request: - payload = ( - 12 - ) - body = post.request_body.RequestBody.content["application/json"].schema.from_openapi_data_( - payload, - configuration_=self.schema_config - ) - mock_request.return_value = self.response( - self.json_bytes(self.response_body), - status=self.response_status - ) - api_response = self.api.post( - body=body, - content_type=content_type - ) - self.assert_pool_manager_request_called_with( - mock_request, - self.api_config.get_server_url('servers', None) + "/requestBody/postHostnameFormatRequestBody", - method='post'.upper(), - body=self.json_bytes(payload), - content_type=content_type, - ) - - assert isinstance(api_response.response, urllib3.HTTPResponse) - assert isinstance(api_response.body, schemas.Unset) - - def test_all_string_formats_ignore_floats_passes(self): - content_type = 'application/json' - # all string formats ignore floats - with patch.object(urllib3.PoolManager, 'request') as mock_request: - payload = ( - 13.7 - ) - body = post.request_body.RequestBody.content["application/json"].schema.from_openapi_data_( - payload, - configuration_=self.schema_config - ) - mock_request.return_value = self.response( - self.json_bytes(self.response_body), - status=self.response_status - ) - api_response = self.api.post( - body=body, - content_type=content_type - ) - self.assert_pool_manager_request_called_with( - mock_request, - self.api_config.get_server_url('servers', None) + "/requestBody/postHostnameFormatRequestBody", - method='post'.upper(), - body=self.json_bytes(payload), - content_type=content_type, - ) - - assert isinstance(api_response.response, urllib3.HTTPResponse) - assert isinstance(api_response.body, schemas.Unset) - - def test_all_string_formats_ignore_arrays_passes(self): - content_type = 'application/json' - # all string formats ignore arrays - with patch.object(urllib3.PoolManager, 'request') as mock_request: - payload = ( - [ - ] - ) - body = post.request_body.RequestBody.content["application/json"].schema.from_openapi_data_( - payload, - configuration_=self.schema_config - ) - mock_request.return_value = self.response( - self.json_bytes(self.response_body), - status=self.response_status - ) - api_response = self.api.post( - body=body, - content_type=content_type - ) - self.assert_pool_manager_request_called_with( - mock_request, - self.api_config.get_server_url('servers', None) + "/requestBody/postHostnameFormatRequestBody", - method='post'.upper(), - body=self.json_bytes(payload), - content_type=content_type, - ) - - assert isinstance(api_response.response, urllib3.HTTPResponse) - assert isinstance(api_response.body, schemas.Unset) - - def test_all_string_formats_ignore_nulls_passes(self): - content_type = 'application/json' - # all string formats ignore nulls - with patch.object(urllib3.PoolManager, 'request') as mock_request: - payload = ( - None - ) - body = post.request_body.RequestBody.content["application/json"].schema.from_openapi_data_( - payload, - configuration_=self.schema_config - ) - mock_request.return_value = self.response( - self.json_bytes(self.response_body), - status=self.response_status - ) - api_response = self.api.post( - body=body, - content_type=content_type - ) - self.assert_pool_manager_request_called_with( - mock_request, - self.api_config.get_server_url('servers', None) + "/requestBody/postHostnameFormatRequestBody", - method='post'.upper(), - body=self.json_bytes(payload), - content_type=content_type, - ) - - assert isinstance(api_response.response, urllib3.HTTPResponse) - assert isinstance(api_response.body, schemas.Unset) - -if __name__ == '__main__': - unittest.main() diff --git a/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_request_body_post_integer_type_matches_integers_request_body/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_request_body_post_integer_type_matches_integers_request_body/__init__.py index 976a86a2448..e69de29bb2d 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_request_body_post_integer_type_matches_integers_request_body/__init__.py +++ b/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_request_body_post_integer_type_matches_integers_request_body/__init__.py @@ -1,195 +0,0 @@ -# coding: utf-8 - -""" - - - Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator -""" - -import unittest -from unittest.mock import patch - -import urllib3 - -import unit_test_api -from unit_test_api.paths.request_body_post_integer_type_matches_integers_request_body.post import operation as post # noqa: E501 -from unit_test_api import schemas, api_client -from unit_test_api.configurations import api_configuration, schema_configuration - -from .. import ApiTestMixin - - -class TestPost(ApiTestMixin, unittest.TestCase): - """ - Post unit test stubs - """ - api_config = api_configuration.ApiConfiguration() - schema_config = schema_configuration.SchemaConfiguration() - used_api_client = api_client.ApiClient(configuration=api_config, schema_config=schema_config) - api = post.ApiForPost(api_client=used_api_client) # noqa: E501 - - response_status = 200 - response_body = '' - - def test_an_object_is_not_an_integer_fails(self): - content_type = 'application/json' - # an object is not an integer - with patch.object(urllib3.PoolManager, 'request') as mock_request: - payload = ( - { - } - ) - with self.assertRaises((unit_test_api.ApiValueError, unit_test_api.ApiTypeError)): - body = post.request_body.RequestBody.content["application/json"].schema.from_openapi_data_( - payload, - configuration_=self.schema_config - ) - self.api.post(body=body) - - def test_a_string_is_not_an_integer_fails(self): - content_type = 'application/json' - # a string is not an integer - with patch.object(urllib3.PoolManager, 'request') as mock_request: - payload = ( - "foo" - ) - with self.assertRaises((unit_test_api.ApiValueError, unit_test_api.ApiTypeError)): - body = post.request_body.RequestBody.content["application/json"].schema.from_openapi_data_( - payload, - configuration_=self.schema_config - ) - self.api.post(body=body) - - def test_null_is_not_an_integer_fails(self): - content_type = 'application/json' - # null is not an integer - with patch.object(urllib3.PoolManager, 'request') as mock_request: - payload = ( - None - ) - with self.assertRaises((unit_test_api.ApiValueError, unit_test_api.ApiTypeError)): - body = post.request_body.RequestBody.content["application/json"].schema.from_openapi_data_( - payload, - configuration_=self.schema_config - ) - self.api.post(body=body) - - def test_a_float_with_zero_fractional_part_is_an_integer_passes(self): - content_type = 'application/json' - # a float with zero fractional part is an integer - with patch.object(urllib3.PoolManager, 'request') as mock_request: - payload = ( - 1.0 - ) - body = post.request_body.RequestBody.content["application/json"].schema.from_openapi_data_( - payload, - configuration_=self.schema_config - ) - mock_request.return_value = self.response( - self.json_bytes(self.response_body), - status=self.response_status - ) - api_response = self.api.post( - body=body, - content_type=content_type - ) - self.assert_pool_manager_request_called_with( - mock_request, - self.api_config.get_server_url('servers', None) + "/requestBody/postIntegerTypeMatchesIntegersRequestBody", - method='post'.upper(), - body=self.json_bytes(payload), - content_type=content_type, - ) - - assert isinstance(api_response.response, urllib3.HTTPResponse) - assert isinstance(api_response.body, schemas.Unset) - - def test_a_float_is_not_an_integer_fails(self): - content_type = 'application/json' - # a float is not an integer - with patch.object(urllib3.PoolManager, 'request') as mock_request: - payload = ( - 1.1 - ) - with self.assertRaises((unit_test_api.ApiValueError, unit_test_api.ApiTypeError)): - body = post.request_body.RequestBody.content["application/json"].schema.from_openapi_data_( - payload, - configuration_=self.schema_config - ) - self.api.post(body=body) - - def test_a_boolean_is_not_an_integer_fails(self): - content_type = 'application/json' - # a boolean is not an integer - with patch.object(urllib3.PoolManager, 'request') as mock_request: - payload = ( - True - ) - with self.assertRaises((unit_test_api.ApiValueError, unit_test_api.ApiTypeError)): - body = post.request_body.RequestBody.content["application/json"].schema.from_openapi_data_( - payload, - configuration_=self.schema_config - ) - self.api.post(body=body) - - def test_an_integer_is_an_integer_passes(self): - content_type = 'application/json' - # an integer is an integer - with patch.object(urllib3.PoolManager, 'request') as mock_request: - payload = ( - 1 - ) - body = post.request_body.RequestBody.content["application/json"].schema.from_openapi_data_( - payload, - configuration_=self.schema_config - ) - mock_request.return_value = self.response( - self.json_bytes(self.response_body), - status=self.response_status - ) - api_response = self.api.post( - body=body, - content_type=content_type - ) - self.assert_pool_manager_request_called_with( - mock_request, - self.api_config.get_server_url('servers', None) + "/requestBody/postIntegerTypeMatchesIntegersRequestBody", - method='post'.upper(), - body=self.json_bytes(payload), - content_type=content_type, - ) - - assert isinstance(api_response.response, urllib3.HTTPResponse) - assert isinstance(api_response.body, schemas.Unset) - - def test_a_string_is_still_not_an_integer_even_if_it_looks_like_one_fails(self): - content_type = 'application/json' - # a string is still not an integer, even if it looks like one - with patch.object(urllib3.PoolManager, 'request') as mock_request: - payload = ( - "1" - ) - with self.assertRaises((unit_test_api.ApiValueError, unit_test_api.ApiTypeError)): - body = post.request_body.RequestBody.content["application/json"].schema.from_openapi_data_( - payload, - configuration_=self.schema_config - ) - self.api.post(body=body) - - def test_an_array_is_not_an_integer_fails(self): - content_type = 'application/json' - # an array is not an integer - with patch.object(urllib3.PoolManager, 'request') as mock_request: - payload = ( - [ - ] - ) - with self.assertRaises((unit_test_api.ApiValueError, unit_test_api.ApiTypeError)): - body = post.request_body.RequestBody.content["application/json"].schema.from_openapi_data_( - payload, - configuration_=self.schema_config - ) - self.api.post(body=body) - -if __name__ == '__main__': - unittest.main() diff --git a/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_request_body_post_invalid_instance_should_not_raise_error_when_float_division_inf_request_body/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_request_body_post_invalid_instance_should_not_raise_error_when_float_division_inf_request_body/__init__.py index f1451275a0d..e69de29bb2d 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_request_body_post_invalid_instance_should_not_raise_error_when_float_division_inf_request_body/__init__.py +++ b/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_request_body_post_invalid_instance_should_not_raise_error_when_float_division_inf_request_body/__init__.py @@ -1,79 +0,0 @@ -# coding: utf-8 - -""" - - - Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator -""" - -import unittest -from unittest.mock import patch - -import urllib3 - -import unit_test_api -from unit_test_api.paths.request_body_post_invalid_instance_should_not_raise_error_when_float_division_inf_request_body.post import operation as post # noqa: E501 -from unit_test_api import schemas, api_client -from unit_test_api.configurations import api_configuration, schema_configuration - -from .. import ApiTestMixin - - -class TestPost(ApiTestMixin, unittest.TestCase): - """ - Post unit test stubs - """ - api_config = api_configuration.ApiConfiguration() - schema_config = schema_configuration.SchemaConfiguration() - used_api_client = api_client.ApiClient(configuration=api_config, schema_config=schema_config) - api = post.ApiForPost(api_client=used_api_client) # noqa: E501 - - response_status = 200 - response_body = '' - - def test_always_invalid_but_naive_implementations_may_raise_an_overflow_error_fails(self): - content_type = 'application/json' - # always invalid, but naive implementations may raise an overflow error - with patch.object(urllib3.PoolManager, 'request') as mock_request: - payload = ( - 1.0E308 - ) - with self.assertRaises((unit_test_api.ApiValueError, unit_test_api.ApiTypeError)): - body = post.request_body.RequestBody.content["application/json"].schema.from_openapi_data_( - payload, - configuration_=self.schema_config - ) - self.api.post(body=body) - - def test_valid_integer_with_multipleof_float_passes(self): - content_type = 'application/json' - # valid integer with multipleOf float - with patch.object(urllib3.PoolManager, 'request') as mock_request: - payload = ( - 123456789 - ) - body = post.request_body.RequestBody.content["application/json"].schema.from_openapi_data_( - payload, - configuration_=self.schema_config - ) - mock_request.return_value = self.response( - self.json_bytes(self.response_body), - status=self.response_status - ) - api_response = self.api.post( - body=body, - content_type=content_type - ) - self.assert_pool_manager_request_called_with( - mock_request, - self.api_config.get_server_url('servers', None) + "/requestBody/postInvalidInstanceShouldNotRaiseErrorWhenFloatDivisionInfRequestBody", - method='post'.upper(), - body=self.json_bytes(payload), - content_type=content_type, - ) - - assert isinstance(api_response.response, urllib3.HTTPResponse) - assert isinstance(api_response.body, schemas.Unset) - -if __name__ == '__main__': - unittest.main() diff --git a/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_request_body_post_invalid_string_value_for_default_request_body/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_request_body_post_invalid_string_value_for_default_request_body/__init__.py index c4a8e35c85c..e69de29bb2d 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_request_body_post_invalid_string_value_for_default_request_body/__init__.py +++ b/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_request_body_post_invalid_string_value_for_default_request_body/__init__.py @@ -1,99 +0,0 @@ -# coding: utf-8 - -""" - - - Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator -""" - -import unittest -from unittest.mock import patch - -import urllib3 - -import unit_test_api -from unit_test_api.paths.request_body_post_invalid_string_value_for_default_request_body.post import operation as post # noqa: E501 -from unit_test_api import schemas, api_client -from unit_test_api.configurations import api_configuration, schema_configuration - -from .. import ApiTestMixin - - -class TestPost(ApiTestMixin, unittest.TestCase): - """ - Post unit test stubs - """ - api_config = api_configuration.ApiConfiguration() - schema_config = schema_configuration.SchemaConfiguration() - used_api_client = api_client.ApiClient(configuration=api_config, schema_config=schema_config) - api = post.ApiForPost(api_client=used_api_client) # noqa: E501 - - response_status = 200 - response_body = '' - - def test_valid_when_property_is_specified_passes(self): - content_type = 'application/json' - # valid when property is specified - with patch.object(urllib3.PoolManager, 'request') as mock_request: - payload = ( - { - "bar": - "good", - } - ) - body = post.request_body.RequestBody.content["application/json"].schema.from_openapi_data_( - payload, - configuration_=self.schema_config - ) - mock_request.return_value = self.response( - self.json_bytes(self.response_body), - status=self.response_status - ) - api_response = self.api.post( - body=body, - content_type=content_type - ) - self.assert_pool_manager_request_called_with( - mock_request, - self.api_config.get_server_url('servers', None) + "/requestBody/postInvalidStringValueForDefaultRequestBody", - method='post'.upper(), - body=self.json_bytes(payload), - content_type=content_type, - ) - - assert isinstance(api_response.response, urllib3.HTTPResponse) - assert isinstance(api_response.body, schemas.Unset) - - def test_still_valid_when_the_invalid_default_is_used_passes(self): - content_type = 'application/json' - # still valid when the invalid default is used - with patch.object(urllib3.PoolManager, 'request') as mock_request: - payload = ( - { - } - ) - body = post.request_body.RequestBody.content["application/json"].schema.from_openapi_data_( - payload, - configuration_=self.schema_config - ) - mock_request.return_value = self.response( - self.json_bytes(self.response_body), - status=self.response_status - ) - api_response = self.api.post( - body=body, - content_type=content_type - ) - self.assert_pool_manager_request_called_with( - mock_request, - self.api_config.get_server_url('servers', None) + "/requestBody/postInvalidStringValueForDefaultRequestBody", - method='post'.upper(), - body=self.json_bytes(payload), - content_type=content_type, - ) - - assert isinstance(api_response.response, urllib3.HTTPResponse) - assert isinstance(api_response.body, schemas.Unset) - -if __name__ == '__main__': - unittest.main() diff --git a/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_request_body_post_ipv4_format_request_body/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_request_body_post_ipv4_format_request_body/__init__.py index 0c860b6b629..e69de29bb2d 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_request_body_post_ipv4_format_request_body/__init__.py +++ b/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_request_body_post_ipv4_format_request_body/__init__.py @@ -1,217 +0,0 @@ -# coding: utf-8 - -""" - - - Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator -""" - -import unittest -from unittest.mock import patch - -import urllib3 - -import unit_test_api -from unit_test_api.paths.request_body_post_ipv4_format_request_body.post import operation as post # noqa: E501 -from unit_test_api import schemas, api_client -from unit_test_api.configurations import api_configuration, schema_configuration - -from .. import ApiTestMixin - - -class TestPost(ApiTestMixin, unittest.TestCase): - """ - Post unit test stubs - """ - api_config = api_configuration.ApiConfiguration() - schema_config = schema_configuration.SchemaConfiguration() - used_api_client = api_client.ApiClient(configuration=api_config, schema_config=schema_config) - api = post.ApiForPost(api_client=used_api_client) # noqa: E501 - - response_status = 200 - response_body = '' - - def test_all_string_formats_ignore_objects_passes(self): - content_type = 'application/json' - # all string formats ignore objects - with patch.object(urllib3.PoolManager, 'request') as mock_request: - payload = ( - { - } - ) - body = post.request_body.RequestBody.content["application/json"].schema.from_openapi_data_( - payload, - configuration_=self.schema_config - ) - mock_request.return_value = self.response( - self.json_bytes(self.response_body), - status=self.response_status - ) - api_response = self.api.post( - body=body, - content_type=content_type - ) - self.assert_pool_manager_request_called_with( - mock_request, - self.api_config.get_server_url('servers', None) + "/requestBody/postIpv4FormatRequestBody", - method='post'.upper(), - body=self.json_bytes(payload), - content_type=content_type, - ) - - assert isinstance(api_response.response, urllib3.HTTPResponse) - assert isinstance(api_response.body, schemas.Unset) - - def test_all_string_formats_ignore_booleans_passes(self): - content_type = 'application/json' - # all string formats ignore booleans - with patch.object(urllib3.PoolManager, 'request') as mock_request: - payload = ( - False - ) - body = post.request_body.RequestBody.content["application/json"].schema.from_openapi_data_( - payload, - configuration_=self.schema_config - ) - mock_request.return_value = self.response( - self.json_bytes(self.response_body), - status=self.response_status - ) - api_response = self.api.post( - body=body, - content_type=content_type - ) - self.assert_pool_manager_request_called_with( - mock_request, - self.api_config.get_server_url('servers', None) + "/requestBody/postIpv4FormatRequestBody", - method='post'.upper(), - body=self.json_bytes(payload), - content_type=content_type, - ) - - assert isinstance(api_response.response, urllib3.HTTPResponse) - assert isinstance(api_response.body, schemas.Unset) - - def test_all_string_formats_ignore_integers_passes(self): - content_type = 'application/json' - # all string formats ignore integers - with patch.object(urllib3.PoolManager, 'request') as mock_request: - payload = ( - 12 - ) - body = post.request_body.RequestBody.content["application/json"].schema.from_openapi_data_( - payload, - configuration_=self.schema_config - ) - mock_request.return_value = self.response( - self.json_bytes(self.response_body), - status=self.response_status - ) - api_response = self.api.post( - body=body, - content_type=content_type - ) - self.assert_pool_manager_request_called_with( - mock_request, - self.api_config.get_server_url('servers', None) + "/requestBody/postIpv4FormatRequestBody", - method='post'.upper(), - body=self.json_bytes(payload), - content_type=content_type, - ) - - assert isinstance(api_response.response, urllib3.HTTPResponse) - assert isinstance(api_response.body, schemas.Unset) - - def test_all_string_formats_ignore_floats_passes(self): - content_type = 'application/json' - # all string formats ignore floats - with patch.object(urllib3.PoolManager, 'request') as mock_request: - payload = ( - 13.7 - ) - body = post.request_body.RequestBody.content["application/json"].schema.from_openapi_data_( - payload, - configuration_=self.schema_config - ) - mock_request.return_value = self.response( - self.json_bytes(self.response_body), - status=self.response_status - ) - api_response = self.api.post( - body=body, - content_type=content_type - ) - self.assert_pool_manager_request_called_with( - mock_request, - self.api_config.get_server_url('servers', None) + "/requestBody/postIpv4FormatRequestBody", - method='post'.upper(), - body=self.json_bytes(payload), - content_type=content_type, - ) - - assert isinstance(api_response.response, urllib3.HTTPResponse) - assert isinstance(api_response.body, schemas.Unset) - - def test_all_string_formats_ignore_arrays_passes(self): - content_type = 'application/json' - # all string formats ignore arrays - with patch.object(urllib3.PoolManager, 'request') as mock_request: - payload = ( - [ - ] - ) - body = post.request_body.RequestBody.content["application/json"].schema.from_openapi_data_( - payload, - configuration_=self.schema_config - ) - mock_request.return_value = self.response( - self.json_bytes(self.response_body), - status=self.response_status - ) - api_response = self.api.post( - body=body, - content_type=content_type - ) - self.assert_pool_manager_request_called_with( - mock_request, - self.api_config.get_server_url('servers', None) + "/requestBody/postIpv4FormatRequestBody", - method='post'.upper(), - body=self.json_bytes(payload), - content_type=content_type, - ) - - assert isinstance(api_response.response, urllib3.HTTPResponse) - assert isinstance(api_response.body, schemas.Unset) - - def test_all_string_formats_ignore_nulls_passes(self): - content_type = 'application/json' - # all string formats ignore nulls - with patch.object(urllib3.PoolManager, 'request') as mock_request: - payload = ( - None - ) - body = post.request_body.RequestBody.content["application/json"].schema.from_openapi_data_( - payload, - configuration_=self.schema_config - ) - mock_request.return_value = self.response( - self.json_bytes(self.response_body), - status=self.response_status - ) - api_response = self.api.post( - body=body, - content_type=content_type - ) - self.assert_pool_manager_request_called_with( - mock_request, - self.api_config.get_server_url('servers', None) + "/requestBody/postIpv4FormatRequestBody", - method='post'.upper(), - body=self.json_bytes(payload), - content_type=content_type, - ) - - assert isinstance(api_response.response, urllib3.HTTPResponse) - assert isinstance(api_response.body, schemas.Unset) - -if __name__ == '__main__': - unittest.main() diff --git a/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_request_body_post_ipv6_format_request_body/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_request_body_post_ipv6_format_request_body/__init__.py index 2d501e37cfc..e69de29bb2d 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_request_body_post_ipv6_format_request_body/__init__.py +++ b/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_request_body_post_ipv6_format_request_body/__init__.py @@ -1,217 +0,0 @@ -# coding: utf-8 - -""" - - - Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator -""" - -import unittest -from unittest.mock import patch - -import urllib3 - -import unit_test_api -from unit_test_api.paths.request_body_post_ipv6_format_request_body.post import operation as post # noqa: E501 -from unit_test_api import schemas, api_client -from unit_test_api.configurations import api_configuration, schema_configuration - -from .. import ApiTestMixin - - -class TestPost(ApiTestMixin, unittest.TestCase): - """ - Post unit test stubs - """ - api_config = api_configuration.ApiConfiguration() - schema_config = schema_configuration.SchemaConfiguration() - used_api_client = api_client.ApiClient(configuration=api_config, schema_config=schema_config) - api = post.ApiForPost(api_client=used_api_client) # noqa: E501 - - response_status = 200 - response_body = '' - - def test_all_string_formats_ignore_objects_passes(self): - content_type = 'application/json' - # all string formats ignore objects - with patch.object(urllib3.PoolManager, 'request') as mock_request: - payload = ( - { - } - ) - body = post.request_body.RequestBody.content["application/json"].schema.from_openapi_data_( - payload, - configuration_=self.schema_config - ) - mock_request.return_value = self.response( - self.json_bytes(self.response_body), - status=self.response_status - ) - api_response = self.api.post( - body=body, - content_type=content_type - ) - self.assert_pool_manager_request_called_with( - mock_request, - self.api_config.get_server_url('servers', None) + "/requestBody/postIpv6FormatRequestBody", - method='post'.upper(), - body=self.json_bytes(payload), - content_type=content_type, - ) - - assert isinstance(api_response.response, urllib3.HTTPResponse) - assert isinstance(api_response.body, schemas.Unset) - - def test_all_string_formats_ignore_booleans_passes(self): - content_type = 'application/json' - # all string formats ignore booleans - with patch.object(urllib3.PoolManager, 'request') as mock_request: - payload = ( - False - ) - body = post.request_body.RequestBody.content["application/json"].schema.from_openapi_data_( - payload, - configuration_=self.schema_config - ) - mock_request.return_value = self.response( - self.json_bytes(self.response_body), - status=self.response_status - ) - api_response = self.api.post( - body=body, - content_type=content_type - ) - self.assert_pool_manager_request_called_with( - mock_request, - self.api_config.get_server_url('servers', None) + "/requestBody/postIpv6FormatRequestBody", - method='post'.upper(), - body=self.json_bytes(payload), - content_type=content_type, - ) - - assert isinstance(api_response.response, urllib3.HTTPResponse) - assert isinstance(api_response.body, schemas.Unset) - - def test_all_string_formats_ignore_integers_passes(self): - content_type = 'application/json' - # all string formats ignore integers - with patch.object(urllib3.PoolManager, 'request') as mock_request: - payload = ( - 12 - ) - body = post.request_body.RequestBody.content["application/json"].schema.from_openapi_data_( - payload, - configuration_=self.schema_config - ) - mock_request.return_value = self.response( - self.json_bytes(self.response_body), - status=self.response_status - ) - api_response = self.api.post( - body=body, - content_type=content_type - ) - self.assert_pool_manager_request_called_with( - mock_request, - self.api_config.get_server_url('servers', None) + "/requestBody/postIpv6FormatRequestBody", - method='post'.upper(), - body=self.json_bytes(payload), - content_type=content_type, - ) - - assert isinstance(api_response.response, urllib3.HTTPResponse) - assert isinstance(api_response.body, schemas.Unset) - - def test_all_string_formats_ignore_floats_passes(self): - content_type = 'application/json' - # all string formats ignore floats - with patch.object(urllib3.PoolManager, 'request') as mock_request: - payload = ( - 13.7 - ) - body = post.request_body.RequestBody.content["application/json"].schema.from_openapi_data_( - payload, - configuration_=self.schema_config - ) - mock_request.return_value = self.response( - self.json_bytes(self.response_body), - status=self.response_status - ) - api_response = self.api.post( - body=body, - content_type=content_type - ) - self.assert_pool_manager_request_called_with( - mock_request, - self.api_config.get_server_url('servers', None) + "/requestBody/postIpv6FormatRequestBody", - method='post'.upper(), - body=self.json_bytes(payload), - content_type=content_type, - ) - - assert isinstance(api_response.response, urllib3.HTTPResponse) - assert isinstance(api_response.body, schemas.Unset) - - def test_all_string_formats_ignore_arrays_passes(self): - content_type = 'application/json' - # all string formats ignore arrays - with patch.object(urllib3.PoolManager, 'request') as mock_request: - payload = ( - [ - ] - ) - body = post.request_body.RequestBody.content["application/json"].schema.from_openapi_data_( - payload, - configuration_=self.schema_config - ) - mock_request.return_value = self.response( - self.json_bytes(self.response_body), - status=self.response_status - ) - api_response = self.api.post( - body=body, - content_type=content_type - ) - self.assert_pool_manager_request_called_with( - mock_request, - self.api_config.get_server_url('servers', None) + "/requestBody/postIpv6FormatRequestBody", - method='post'.upper(), - body=self.json_bytes(payload), - content_type=content_type, - ) - - assert isinstance(api_response.response, urllib3.HTTPResponse) - assert isinstance(api_response.body, schemas.Unset) - - def test_all_string_formats_ignore_nulls_passes(self): - content_type = 'application/json' - # all string formats ignore nulls - with patch.object(urllib3.PoolManager, 'request') as mock_request: - payload = ( - None - ) - body = post.request_body.RequestBody.content["application/json"].schema.from_openapi_data_( - payload, - configuration_=self.schema_config - ) - mock_request.return_value = self.response( - self.json_bytes(self.response_body), - status=self.response_status - ) - api_response = self.api.post( - body=body, - content_type=content_type - ) - self.assert_pool_manager_request_called_with( - mock_request, - self.api_config.get_server_url('servers', None) + "/requestBody/postIpv6FormatRequestBody", - method='post'.upper(), - body=self.json_bytes(payload), - content_type=content_type, - ) - - assert isinstance(api_response.response, urllib3.HTTPResponse) - assert isinstance(api_response.body, schemas.Unset) - -if __name__ == '__main__': - unittest.main() diff --git a/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_request_body_post_json_pointer_format_request_body/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_request_body_post_json_pointer_format_request_body/__init__.py index cf19b512f61..e69de29bb2d 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_request_body_post_json_pointer_format_request_body/__init__.py +++ b/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_request_body_post_json_pointer_format_request_body/__init__.py @@ -1,217 +0,0 @@ -# coding: utf-8 - -""" - - - Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator -""" - -import unittest -from unittest.mock import patch - -import urllib3 - -import unit_test_api -from unit_test_api.paths.request_body_post_json_pointer_format_request_body.post import operation as post # noqa: E501 -from unit_test_api import schemas, api_client -from unit_test_api.configurations import api_configuration, schema_configuration - -from .. import ApiTestMixin - - -class TestPost(ApiTestMixin, unittest.TestCase): - """ - Post unit test stubs - """ - api_config = api_configuration.ApiConfiguration() - schema_config = schema_configuration.SchemaConfiguration() - used_api_client = api_client.ApiClient(configuration=api_config, schema_config=schema_config) - api = post.ApiForPost(api_client=used_api_client) # noqa: E501 - - response_status = 200 - response_body = '' - - def test_all_string_formats_ignore_objects_passes(self): - content_type = 'application/json' - # all string formats ignore objects - with patch.object(urllib3.PoolManager, 'request') as mock_request: - payload = ( - { - } - ) - body = post.request_body.RequestBody.content["application/json"].schema.from_openapi_data_( - payload, - configuration_=self.schema_config - ) - mock_request.return_value = self.response( - self.json_bytes(self.response_body), - status=self.response_status - ) - api_response = self.api.post( - body=body, - content_type=content_type - ) - self.assert_pool_manager_request_called_with( - mock_request, - self.api_config.get_server_url('servers', None) + "/requestBody/postJsonPointerFormatRequestBody", - method='post'.upper(), - body=self.json_bytes(payload), - content_type=content_type, - ) - - assert isinstance(api_response.response, urllib3.HTTPResponse) - assert isinstance(api_response.body, schemas.Unset) - - def test_all_string_formats_ignore_booleans_passes(self): - content_type = 'application/json' - # all string formats ignore booleans - with patch.object(urllib3.PoolManager, 'request') as mock_request: - payload = ( - False - ) - body = post.request_body.RequestBody.content["application/json"].schema.from_openapi_data_( - payload, - configuration_=self.schema_config - ) - mock_request.return_value = self.response( - self.json_bytes(self.response_body), - status=self.response_status - ) - api_response = self.api.post( - body=body, - content_type=content_type - ) - self.assert_pool_manager_request_called_with( - mock_request, - self.api_config.get_server_url('servers', None) + "/requestBody/postJsonPointerFormatRequestBody", - method='post'.upper(), - body=self.json_bytes(payload), - content_type=content_type, - ) - - assert isinstance(api_response.response, urllib3.HTTPResponse) - assert isinstance(api_response.body, schemas.Unset) - - def test_all_string_formats_ignore_integers_passes(self): - content_type = 'application/json' - # all string formats ignore integers - with patch.object(urllib3.PoolManager, 'request') as mock_request: - payload = ( - 12 - ) - body = post.request_body.RequestBody.content["application/json"].schema.from_openapi_data_( - payload, - configuration_=self.schema_config - ) - mock_request.return_value = self.response( - self.json_bytes(self.response_body), - status=self.response_status - ) - api_response = self.api.post( - body=body, - content_type=content_type - ) - self.assert_pool_manager_request_called_with( - mock_request, - self.api_config.get_server_url('servers', None) + "/requestBody/postJsonPointerFormatRequestBody", - method='post'.upper(), - body=self.json_bytes(payload), - content_type=content_type, - ) - - assert isinstance(api_response.response, urllib3.HTTPResponse) - assert isinstance(api_response.body, schemas.Unset) - - def test_all_string_formats_ignore_floats_passes(self): - content_type = 'application/json' - # all string formats ignore floats - with patch.object(urllib3.PoolManager, 'request') as mock_request: - payload = ( - 13.7 - ) - body = post.request_body.RequestBody.content["application/json"].schema.from_openapi_data_( - payload, - configuration_=self.schema_config - ) - mock_request.return_value = self.response( - self.json_bytes(self.response_body), - status=self.response_status - ) - api_response = self.api.post( - body=body, - content_type=content_type - ) - self.assert_pool_manager_request_called_with( - mock_request, - self.api_config.get_server_url('servers', None) + "/requestBody/postJsonPointerFormatRequestBody", - method='post'.upper(), - body=self.json_bytes(payload), - content_type=content_type, - ) - - assert isinstance(api_response.response, urllib3.HTTPResponse) - assert isinstance(api_response.body, schemas.Unset) - - def test_all_string_formats_ignore_arrays_passes(self): - content_type = 'application/json' - # all string formats ignore arrays - with patch.object(urllib3.PoolManager, 'request') as mock_request: - payload = ( - [ - ] - ) - body = post.request_body.RequestBody.content["application/json"].schema.from_openapi_data_( - payload, - configuration_=self.schema_config - ) - mock_request.return_value = self.response( - self.json_bytes(self.response_body), - status=self.response_status - ) - api_response = self.api.post( - body=body, - content_type=content_type - ) - self.assert_pool_manager_request_called_with( - mock_request, - self.api_config.get_server_url('servers', None) + "/requestBody/postJsonPointerFormatRequestBody", - method='post'.upper(), - body=self.json_bytes(payload), - content_type=content_type, - ) - - assert isinstance(api_response.response, urllib3.HTTPResponse) - assert isinstance(api_response.body, schemas.Unset) - - def test_all_string_formats_ignore_nulls_passes(self): - content_type = 'application/json' - # all string formats ignore nulls - with patch.object(urllib3.PoolManager, 'request') as mock_request: - payload = ( - None - ) - body = post.request_body.RequestBody.content["application/json"].schema.from_openapi_data_( - payload, - configuration_=self.schema_config - ) - mock_request.return_value = self.response( - self.json_bytes(self.response_body), - status=self.response_status - ) - api_response = self.api.post( - body=body, - content_type=content_type - ) - self.assert_pool_manager_request_called_with( - mock_request, - self.api_config.get_server_url('servers', None) + "/requestBody/postJsonPointerFormatRequestBody", - method='post'.upper(), - body=self.json_bytes(payload), - content_type=content_type, - ) - - assert isinstance(api_response.response, urllib3.HTTPResponse) - assert isinstance(api_response.body, schemas.Unset) - -if __name__ == '__main__': - unittest.main() diff --git a/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_request_body_post_maximum_validation_request_body/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_request_body_post_maximum_validation_request_body/__init__.py index 0881e61ce17..e69de29bb2d 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_request_body_post_maximum_validation_request_body/__init__.py +++ b/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_request_body_post_maximum_validation_request_body/__init__.py @@ -1,139 +0,0 @@ -# coding: utf-8 - -""" - - - Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator -""" - -import unittest -from unittest.mock import patch - -import urllib3 - -import unit_test_api -from unit_test_api.paths.request_body_post_maximum_validation_request_body.post import operation as post # noqa: E501 -from unit_test_api import schemas, api_client -from unit_test_api.configurations import api_configuration, schema_configuration - -from .. import ApiTestMixin - - -class TestPost(ApiTestMixin, unittest.TestCase): - """ - Post unit test stubs - """ - api_config = api_configuration.ApiConfiguration() - schema_config = schema_configuration.SchemaConfiguration() - used_api_client = api_client.ApiClient(configuration=api_config, schema_config=schema_config) - api = post.ApiForPost(api_client=used_api_client) # noqa: E501 - - response_status = 200 - response_body = '' - - def test_below_the_maximum_is_valid_passes(self): - content_type = 'application/json' - # below the maximum is valid - with patch.object(urllib3.PoolManager, 'request') as mock_request: - payload = ( - 2.6 - ) - body = post.request_body.RequestBody.content["application/json"].schema.from_openapi_data_( - payload, - configuration_=self.schema_config - ) - mock_request.return_value = self.response( - self.json_bytes(self.response_body), - status=self.response_status - ) - api_response = self.api.post( - body=body, - content_type=content_type - ) - self.assert_pool_manager_request_called_with( - mock_request, - self.api_config.get_server_url('servers', None) + "/requestBody/postMaximumValidationRequestBody", - method='post'.upper(), - body=self.json_bytes(payload), - content_type=content_type, - ) - - assert isinstance(api_response.response, urllib3.HTTPResponse) - assert isinstance(api_response.body, schemas.Unset) - - def test_boundary_point_is_valid_passes(self): - content_type = 'application/json' - # boundary point is valid - with patch.object(urllib3.PoolManager, 'request') as mock_request: - payload = ( - 3.0 - ) - body = post.request_body.RequestBody.content["application/json"].schema.from_openapi_data_( - payload, - configuration_=self.schema_config - ) - mock_request.return_value = self.response( - self.json_bytes(self.response_body), - status=self.response_status - ) - api_response = self.api.post( - body=body, - content_type=content_type - ) - self.assert_pool_manager_request_called_with( - mock_request, - self.api_config.get_server_url('servers', None) + "/requestBody/postMaximumValidationRequestBody", - method='post'.upper(), - body=self.json_bytes(payload), - content_type=content_type, - ) - - assert isinstance(api_response.response, urllib3.HTTPResponse) - assert isinstance(api_response.body, schemas.Unset) - - def test_above_the_maximum_is_invalid_fails(self): - content_type = 'application/json' - # above the maximum is invalid - with patch.object(urllib3.PoolManager, 'request') as mock_request: - payload = ( - 3.5 - ) - with self.assertRaises((unit_test_api.ApiValueError, unit_test_api.ApiTypeError)): - body = post.request_body.RequestBody.content["application/json"].schema.from_openapi_data_( - payload, - configuration_=self.schema_config - ) - self.api.post(body=body) - - def test_ignores_non_numbers_passes(self): - content_type = 'application/json' - # ignores non-numbers - with patch.object(urllib3.PoolManager, 'request') as mock_request: - payload = ( - "x" - ) - body = post.request_body.RequestBody.content["application/json"].schema.from_openapi_data_( - payload, - configuration_=self.schema_config - ) - mock_request.return_value = self.response( - self.json_bytes(self.response_body), - status=self.response_status - ) - api_response = self.api.post( - body=body, - content_type=content_type - ) - self.assert_pool_manager_request_called_with( - mock_request, - self.api_config.get_server_url('servers', None) + "/requestBody/postMaximumValidationRequestBody", - method='post'.upper(), - body=self.json_bytes(payload), - content_type=content_type, - ) - - assert isinstance(api_response.response, urllib3.HTTPResponse) - assert isinstance(api_response.body, schemas.Unset) - -if __name__ == '__main__': - unittest.main() diff --git a/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_request_body_post_maximum_validation_with_unsigned_integer_request_body/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_request_body_post_maximum_validation_with_unsigned_integer_request_body/__init__.py index 328c3ad8cc2..e69de29bb2d 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_request_body_post_maximum_validation_with_unsigned_integer_request_body/__init__.py +++ b/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_request_body_post_maximum_validation_with_unsigned_integer_request_body/__init__.py @@ -1,139 +0,0 @@ -# coding: utf-8 - -""" - - - Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator -""" - -import unittest -from unittest.mock import patch - -import urllib3 - -import unit_test_api -from unit_test_api.paths.request_body_post_maximum_validation_with_unsigned_integer_request_body.post import operation as post # noqa: E501 -from unit_test_api import schemas, api_client -from unit_test_api.configurations import api_configuration, schema_configuration - -from .. import ApiTestMixin - - -class TestPost(ApiTestMixin, unittest.TestCase): - """ - Post unit test stubs - """ - api_config = api_configuration.ApiConfiguration() - schema_config = schema_configuration.SchemaConfiguration() - used_api_client = api_client.ApiClient(configuration=api_config, schema_config=schema_config) - api = post.ApiForPost(api_client=used_api_client) # noqa: E501 - - response_status = 200 - response_body = '' - - def test_below_the_maximum_is_invalid_passes(self): - content_type = 'application/json' - # below the maximum is invalid - with patch.object(urllib3.PoolManager, 'request') as mock_request: - payload = ( - 299.97 - ) - body = post.request_body.RequestBody.content["application/json"].schema.from_openapi_data_( - payload, - configuration_=self.schema_config - ) - mock_request.return_value = self.response( - self.json_bytes(self.response_body), - status=self.response_status - ) - api_response = self.api.post( - body=body, - content_type=content_type - ) - self.assert_pool_manager_request_called_with( - mock_request, - self.api_config.get_server_url('servers', None) + "/requestBody/postMaximumValidationWithUnsignedIntegerRequestBody", - method='post'.upper(), - body=self.json_bytes(payload), - content_type=content_type, - ) - - assert isinstance(api_response.response, urllib3.HTTPResponse) - assert isinstance(api_response.body, schemas.Unset) - - def test_above_the_maximum_is_invalid_fails(self): - content_type = 'application/json' - # above the maximum is invalid - with patch.object(urllib3.PoolManager, 'request') as mock_request: - payload = ( - 300.5 - ) - with self.assertRaises((unit_test_api.ApiValueError, unit_test_api.ApiTypeError)): - body = post.request_body.RequestBody.content["application/json"].schema.from_openapi_data_( - payload, - configuration_=self.schema_config - ) - self.api.post(body=body) - - def test_boundary_point_integer_is_valid_passes(self): - content_type = 'application/json' - # boundary point integer is valid - with patch.object(urllib3.PoolManager, 'request') as mock_request: - payload = ( - 300 - ) - body = post.request_body.RequestBody.content["application/json"].schema.from_openapi_data_( - payload, - configuration_=self.schema_config - ) - mock_request.return_value = self.response( - self.json_bytes(self.response_body), - status=self.response_status - ) - api_response = self.api.post( - body=body, - content_type=content_type - ) - self.assert_pool_manager_request_called_with( - mock_request, - self.api_config.get_server_url('servers', None) + "/requestBody/postMaximumValidationWithUnsignedIntegerRequestBody", - method='post'.upper(), - body=self.json_bytes(payload), - content_type=content_type, - ) - - assert isinstance(api_response.response, urllib3.HTTPResponse) - assert isinstance(api_response.body, schemas.Unset) - - def test_boundary_point_float_is_valid_passes(self): - content_type = 'application/json' - # boundary point float is valid - with patch.object(urllib3.PoolManager, 'request') as mock_request: - payload = ( - 300.0 - ) - body = post.request_body.RequestBody.content["application/json"].schema.from_openapi_data_( - payload, - configuration_=self.schema_config - ) - mock_request.return_value = self.response( - self.json_bytes(self.response_body), - status=self.response_status - ) - api_response = self.api.post( - body=body, - content_type=content_type - ) - self.assert_pool_manager_request_called_with( - mock_request, - self.api_config.get_server_url('servers', None) + "/requestBody/postMaximumValidationWithUnsignedIntegerRequestBody", - method='post'.upper(), - body=self.json_bytes(payload), - content_type=content_type, - ) - - assert isinstance(api_response.response, urllib3.HTTPResponse) - assert isinstance(api_response.body, schemas.Unset) - -if __name__ == '__main__': - unittest.main() diff --git a/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_request_body_post_maxitems_validation_request_body/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_request_body_post_maxitems_validation_request_body/__init__.py index c58023aa31c..e69de29bb2d 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_request_body_post_maxitems_validation_request_body/__init__.py +++ b/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_request_body_post_maxitems_validation_request_body/__init__.py @@ -1,148 +0,0 @@ -# coding: utf-8 - -""" - - - Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator -""" - -import unittest -from unittest.mock import patch - -import urllib3 - -import unit_test_api -from unit_test_api.paths.request_body_post_maxitems_validation_request_body.post import operation as post # noqa: E501 -from unit_test_api import schemas, api_client -from unit_test_api.configurations import api_configuration, schema_configuration - -from .. import ApiTestMixin - - -class TestPost(ApiTestMixin, unittest.TestCase): - """ - Post unit test stubs - """ - api_config = api_configuration.ApiConfiguration() - schema_config = schema_configuration.SchemaConfiguration() - used_api_client = api_client.ApiClient(configuration=api_config, schema_config=schema_config) - api = post.ApiForPost(api_client=used_api_client) # noqa: E501 - - response_status = 200 - response_body = '' - - def test_too_long_is_invalid_fails(self): - content_type = 'application/json' - # too long is invalid - with patch.object(urllib3.PoolManager, 'request') as mock_request: - payload = ( - [ - 1, - 2, - 3, - ] - ) - with self.assertRaises((unit_test_api.ApiValueError, unit_test_api.ApiTypeError)): - body = post.request_body.RequestBody.content["application/json"].schema.from_openapi_data_( - payload, - configuration_=self.schema_config - ) - self.api.post(body=body) - - def test_ignores_non_arrays_passes(self): - content_type = 'application/json' - # ignores non-arrays - with patch.object(urllib3.PoolManager, 'request') as mock_request: - payload = ( - "foobar" - ) - body = post.request_body.RequestBody.content["application/json"].schema.from_openapi_data_( - payload, - configuration_=self.schema_config - ) - mock_request.return_value = self.response( - self.json_bytes(self.response_body), - status=self.response_status - ) - api_response = self.api.post( - body=body, - content_type=content_type - ) - self.assert_pool_manager_request_called_with( - mock_request, - self.api_config.get_server_url('servers', None) + "/requestBody/postMaxitemsValidationRequestBody", - method='post'.upper(), - body=self.json_bytes(payload), - content_type=content_type, - ) - - assert isinstance(api_response.response, urllib3.HTTPResponse) - assert isinstance(api_response.body, schemas.Unset) - - def test_shorter_is_valid_passes(self): - content_type = 'application/json' - # shorter is valid - with patch.object(urllib3.PoolManager, 'request') as mock_request: - payload = ( - [ - 1, - ] - ) - body = post.request_body.RequestBody.content["application/json"].schema.from_openapi_data_( - payload, - configuration_=self.schema_config - ) - mock_request.return_value = self.response( - self.json_bytes(self.response_body), - status=self.response_status - ) - api_response = self.api.post( - body=body, - content_type=content_type - ) - self.assert_pool_manager_request_called_with( - mock_request, - self.api_config.get_server_url('servers', None) + "/requestBody/postMaxitemsValidationRequestBody", - method='post'.upper(), - body=self.json_bytes(payload), - content_type=content_type, - ) - - assert isinstance(api_response.response, urllib3.HTTPResponse) - assert isinstance(api_response.body, schemas.Unset) - - def test_exact_length_is_valid_passes(self): - content_type = 'application/json' - # exact length is valid - with patch.object(urllib3.PoolManager, 'request') as mock_request: - payload = ( - [ - 1, - 2, - ] - ) - body = post.request_body.RequestBody.content["application/json"].schema.from_openapi_data_( - payload, - configuration_=self.schema_config - ) - mock_request.return_value = self.response( - self.json_bytes(self.response_body), - status=self.response_status - ) - api_response = self.api.post( - body=body, - content_type=content_type - ) - self.assert_pool_manager_request_called_with( - mock_request, - self.api_config.get_server_url('servers', None) + "/requestBody/postMaxitemsValidationRequestBody", - method='post'.upper(), - body=self.json_bytes(payload), - content_type=content_type, - ) - - assert isinstance(api_response.response, urllib3.HTTPResponse) - assert isinstance(api_response.body, schemas.Unset) - -if __name__ == '__main__': - unittest.main() diff --git a/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_request_body_post_maxlength_validation_request_body/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_request_body_post_maxlength_validation_request_body/__init__.py index bd65c249d48..e69de29bb2d 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_request_body_post_maxlength_validation_request_body/__init__.py +++ b/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_request_body_post_maxlength_validation_request_body/__init__.py @@ -1,169 +0,0 @@ -# coding: utf-8 - -""" - - - Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator -""" - -import unittest -from unittest.mock import patch - -import urllib3 - -import unit_test_api -from unit_test_api.paths.request_body_post_maxlength_validation_request_body.post import operation as post # noqa: E501 -from unit_test_api import schemas, api_client -from unit_test_api.configurations import api_configuration, schema_configuration - -from .. import ApiTestMixin - - -class TestPost(ApiTestMixin, unittest.TestCase): - """ - Post unit test stubs - """ - api_config = api_configuration.ApiConfiguration() - schema_config = schema_configuration.SchemaConfiguration() - used_api_client = api_client.ApiClient(configuration=api_config, schema_config=schema_config) - api = post.ApiForPost(api_client=used_api_client) # noqa: E501 - - response_status = 200 - response_body = '' - - def test_too_long_is_invalid_fails(self): - content_type = 'application/json' - # too long is invalid - with patch.object(urllib3.PoolManager, 'request') as mock_request: - payload = ( - "foo" - ) - with self.assertRaises((unit_test_api.ApiValueError, unit_test_api.ApiTypeError)): - body = post.request_body.RequestBody.content["application/json"].schema.from_openapi_data_( - payload, - configuration_=self.schema_config - ) - self.api.post(body=body) - - def test_ignores_non_strings_passes(self): - content_type = 'application/json' - # ignores non-strings - with patch.object(urllib3.PoolManager, 'request') as mock_request: - payload = ( - 100 - ) - body = post.request_body.RequestBody.content["application/json"].schema.from_openapi_data_( - payload, - configuration_=self.schema_config - ) - mock_request.return_value = self.response( - self.json_bytes(self.response_body), - status=self.response_status - ) - api_response = self.api.post( - body=body, - content_type=content_type - ) - self.assert_pool_manager_request_called_with( - mock_request, - self.api_config.get_server_url('servers', None) + "/requestBody/postMaxlengthValidationRequestBody", - method='post'.upper(), - body=self.json_bytes(payload), - content_type=content_type, - ) - - assert isinstance(api_response.response, urllib3.HTTPResponse) - assert isinstance(api_response.body, schemas.Unset) - - def test_shorter_is_valid_passes(self): - content_type = 'application/json' - # shorter is valid - with patch.object(urllib3.PoolManager, 'request') as mock_request: - payload = ( - "f" - ) - body = post.request_body.RequestBody.content["application/json"].schema.from_openapi_data_( - payload, - configuration_=self.schema_config - ) - mock_request.return_value = self.response( - self.json_bytes(self.response_body), - status=self.response_status - ) - api_response = self.api.post( - body=body, - content_type=content_type - ) - self.assert_pool_manager_request_called_with( - mock_request, - self.api_config.get_server_url('servers', None) + "/requestBody/postMaxlengthValidationRequestBody", - method='post'.upper(), - body=self.json_bytes(payload), - content_type=content_type, - ) - - assert isinstance(api_response.response, urllib3.HTTPResponse) - assert isinstance(api_response.body, schemas.Unset) - - def test_two_supplementary_unicode_code_points_is_long_enough_passes(self): - content_type = 'application/json' - # two supplementary Unicode code points is long enough - with patch.object(urllib3.PoolManager, 'request') as mock_request: - payload = ( - "💩💩" - ) - body = post.request_body.RequestBody.content["application/json"].schema.from_openapi_data_( - payload, - configuration_=self.schema_config - ) - mock_request.return_value = self.response( - self.json_bytes(self.response_body), - status=self.response_status - ) - api_response = self.api.post( - body=body, - content_type=content_type - ) - self.assert_pool_manager_request_called_with( - mock_request, - self.api_config.get_server_url('servers', None) + "/requestBody/postMaxlengthValidationRequestBody", - method='post'.upper(), - body=self.json_bytes(payload), - content_type=content_type, - ) - - assert isinstance(api_response.response, urllib3.HTTPResponse) - assert isinstance(api_response.body, schemas.Unset) - - def test_exact_length_is_valid_passes(self): - content_type = 'application/json' - # exact length is valid - with patch.object(urllib3.PoolManager, 'request') as mock_request: - payload = ( - "fo" - ) - body = post.request_body.RequestBody.content["application/json"].schema.from_openapi_data_( - payload, - configuration_=self.schema_config - ) - mock_request.return_value = self.response( - self.json_bytes(self.response_body), - status=self.response_status - ) - api_response = self.api.post( - body=body, - content_type=content_type - ) - self.assert_pool_manager_request_called_with( - mock_request, - self.api_config.get_server_url('servers', None) + "/requestBody/postMaxlengthValidationRequestBody", - method='post'.upper(), - body=self.json_bytes(payload), - content_type=content_type, - ) - - assert isinstance(api_response.response, urllib3.HTTPResponse) - assert isinstance(api_response.body, schemas.Unset) - -if __name__ == '__main__': - unittest.main() diff --git a/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_request_body_post_maxproperties0_means_the_object_is_empty_request_body/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_request_body_post_maxproperties0_means_the_object_is_empty_request_body/__init__.py index e229dbe27d9..e69de29bb2d 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_request_body_post_maxproperties0_means_the_object_is_empty_request_body/__init__.py +++ b/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_request_body_post_maxproperties0_means_the_object_is_empty_request_body/__init__.py @@ -1,83 +0,0 @@ -# coding: utf-8 - -""" - - - Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator -""" - -import unittest -from unittest.mock import patch - -import urllib3 - -import unit_test_api -from unit_test_api.paths.request_body_post_maxproperties0_means_the_object_is_empty_request_body.post import operation as post # noqa: E501 -from unit_test_api import schemas, api_client -from unit_test_api.configurations import api_configuration, schema_configuration - -from .. import ApiTestMixin - - -class TestPost(ApiTestMixin, unittest.TestCase): - """ - Post unit test stubs - """ - api_config = api_configuration.ApiConfiguration() - schema_config = schema_configuration.SchemaConfiguration() - used_api_client = api_client.ApiClient(configuration=api_config, schema_config=schema_config) - api = post.ApiForPost(api_client=used_api_client) # noqa: E501 - - response_status = 200 - response_body = '' - - def test_no_properties_is_valid_passes(self): - content_type = 'application/json' - # no properties is valid - with patch.object(urllib3.PoolManager, 'request') as mock_request: - payload = ( - { - } - ) - body = post.request_body.RequestBody.content["application/json"].schema.from_openapi_data_( - payload, - configuration_=self.schema_config - ) - mock_request.return_value = self.response( - self.json_bytes(self.response_body), - status=self.response_status - ) - api_response = self.api.post( - body=body, - content_type=content_type - ) - self.assert_pool_manager_request_called_with( - mock_request, - self.api_config.get_server_url('servers', None) + "/requestBody/postMaxproperties0MeansTheObjectIsEmptyRequestBody", - method='post'.upper(), - body=self.json_bytes(payload), - content_type=content_type, - ) - - assert isinstance(api_response.response, urllib3.HTTPResponse) - assert isinstance(api_response.body, schemas.Unset) - - def test_one_property_is_invalid_fails(self): - content_type = 'application/json' - # one property is invalid - with patch.object(urllib3.PoolManager, 'request') as mock_request: - payload = ( - { - "foo": - 1, - } - ) - with self.assertRaises((unit_test_api.ApiValueError, unit_test_api.ApiTypeError)): - body = post.request_body.RequestBody.content["application/json"].schema.from_openapi_data_( - payload, - configuration_=self.schema_config - ) - self.api.post(body=body) - -if __name__ == '__main__': - unittest.main() diff --git a/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_request_body_post_maxproperties_validation_request_body/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_request_body_post_maxproperties_validation_request_body/__init__.py index 4403e3735d3..e69de29bb2d 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_request_body_post_maxproperties_validation_request_body/__init__.py +++ b/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_request_body_post_maxproperties_validation_request_body/__init__.py @@ -1,218 +0,0 @@ -# coding: utf-8 - -""" - - - Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator -""" - -import unittest -from unittest.mock import patch - -import urllib3 - -import unit_test_api -from unit_test_api.paths.request_body_post_maxproperties_validation_request_body.post import operation as post # noqa: E501 -from unit_test_api import schemas, api_client -from unit_test_api.configurations import api_configuration, schema_configuration - -from .. import ApiTestMixin - - -class TestPost(ApiTestMixin, unittest.TestCase): - """ - Post unit test stubs - """ - api_config = api_configuration.ApiConfiguration() - schema_config = schema_configuration.SchemaConfiguration() - used_api_client = api_client.ApiClient(configuration=api_config, schema_config=schema_config) - api = post.ApiForPost(api_client=used_api_client) # noqa: E501 - - response_status = 200 - response_body = '' - - def test_too_long_is_invalid_fails(self): - content_type = 'application/json' - # too long is invalid - with patch.object(urllib3.PoolManager, 'request') as mock_request: - payload = ( - { - "foo": - 1, - "bar": - 2, - "baz": - 3, - } - ) - with self.assertRaises((unit_test_api.ApiValueError, unit_test_api.ApiTypeError)): - body = post.request_body.RequestBody.content["application/json"].schema.from_openapi_data_( - payload, - configuration_=self.schema_config - ) - self.api.post(body=body) - - def test_ignores_arrays_passes(self): - content_type = 'application/json' - # ignores arrays - with patch.object(urllib3.PoolManager, 'request') as mock_request: - payload = ( - [ - 1, - 2, - 3, - ] - ) - body = post.request_body.RequestBody.content["application/json"].schema.from_openapi_data_( - payload, - configuration_=self.schema_config - ) - mock_request.return_value = self.response( - self.json_bytes(self.response_body), - status=self.response_status - ) - api_response = self.api.post( - body=body, - content_type=content_type - ) - self.assert_pool_manager_request_called_with( - mock_request, - self.api_config.get_server_url('servers', None) + "/requestBody/postMaxpropertiesValidationRequestBody", - method='post'.upper(), - body=self.json_bytes(payload), - content_type=content_type, - ) - - assert isinstance(api_response.response, urllib3.HTTPResponse) - assert isinstance(api_response.body, schemas.Unset) - - def test_ignores_other_non_objects_passes(self): - content_type = 'application/json' - # ignores other non-objects - with patch.object(urllib3.PoolManager, 'request') as mock_request: - payload = ( - 12 - ) - body = post.request_body.RequestBody.content["application/json"].schema.from_openapi_data_( - payload, - configuration_=self.schema_config - ) - mock_request.return_value = self.response( - self.json_bytes(self.response_body), - status=self.response_status - ) - api_response = self.api.post( - body=body, - content_type=content_type - ) - self.assert_pool_manager_request_called_with( - mock_request, - self.api_config.get_server_url('servers', None) + "/requestBody/postMaxpropertiesValidationRequestBody", - method='post'.upper(), - body=self.json_bytes(payload), - content_type=content_type, - ) - - assert isinstance(api_response.response, urllib3.HTTPResponse) - assert isinstance(api_response.body, schemas.Unset) - - def test_ignores_strings_passes(self): - content_type = 'application/json' - # ignores strings - with patch.object(urllib3.PoolManager, 'request') as mock_request: - payload = ( - "foobar" - ) - body = post.request_body.RequestBody.content["application/json"].schema.from_openapi_data_( - payload, - configuration_=self.schema_config - ) - mock_request.return_value = self.response( - self.json_bytes(self.response_body), - status=self.response_status - ) - api_response = self.api.post( - body=body, - content_type=content_type - ) - self.assert_pool_manager_request_called_with( - mock_request, - self.api_config.get_server_url('servers', None) + "/requestBody/postMaxpropertiesValidationRequestBody", - method='post'.upper(), - body=self.json_bytes(payload), - content_type=content_type, - ) - - assert isinstance(api_response.response, urllib3.HTTPResponse) - assert isinstance(api_response.body, schemas.Unset) - - def test_shorter_is_valid_passes(self): - content_type = 'application/json' - # shorter is valid - with patch.object(urllib3.PoolManager, 'request') as mock_request: - payload = ( - { - "foo": - 1, - } - ) - body = post.request_body.RequestBody.content["application/json"].schema.from_openapi_data_( - payload, - configuration_=self.schema_config - ) - mock_request.return_value = self.response( - self.json_bytes(self.response_body), - status=self.response_status - ) - api_response = self.api.post( - body=body, - content_type=content_type - ) - self.assert_pool_manager_request_called_with( - mock_request, - self.api_config.get_server_url('servers', None) + "/requestBody/postMaxpropertiesValidationRequestBody", - method='post'.upper(), - body=self.json_bytes(payload), - content_type=content_type, - ) - - assert isinstance(api_response.response, urllib3.HTTPResponse) - assert isinstance(api_response.body, schemas.Unset) - - def test_exact_length_is_valid_passes(self): - content_type = 'application/json' - # exact length is valid - with patch.object(urllib3.PoolManager, 'request') as mock_request: - payload = ( - { - "foo": - 1, - "bar": - 2, - } - ) - body = post.request_body.RequestBody.content["application/json"].schema.from_openapi_data_( - payload, - configuration_=self.schema_config - ) - mock_request.return_value = self.response( - self.json_bytes(self.response_body), - status=self.response_status - ) - api_response = self.api.post( - body=body, - content_type=content_type - ) - self.assert_pool_manager_request_called_with( - mock_request, - self.api_config.get_server_url('servers', None) + "/requestBody/postMaxpropertiesValidationRequestBody", - method='post'.upper(), - body=self.json_bytes(payload), - content_type=content_type, - ) - - assert isinstance(api_response.response, urllib3.HTTPResponse) - assert isinstance(api_response.body, schemas.Unset) - -if __name__ == '__main__': - unittest.main() diff --git a/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_request_body_post_minimum_validation_request_body/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_request_body_post_minimum_validation_request_body/__init__.py index 252f2955c6e..e69de29bb2d 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_request_body_post_minimum_validation_request_body/__init__.py +++ b/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_request_body_post_minimum_validation_request_body/__init__.py @@ -1,139 +0,0 @@ -# coding: utf-8 - -""" - - - Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator -""" - -import unittest -from unittest.mock import patch - -import urllib3 - -import unit_test_api -from unit_test_api.paths.request_body_post_minimum_validation_request_body.post import operation as post # noqa: E501 -from unit_test_api import schemas, api_client -from unit_test_api.configurations import api_configuration, schema_configuration - -from .. import ApiTestMixin - - -class TestPost(ApiTestMixin, unittest.TestCase): - """ - Post unit test stubs - """ - api_config = api_configuration.ApiConfiguration() - schema_config = schema_configuration.SchemaConfiguration() - used_api_client = api_client.ApiClient(configuration=api_config, schema_config=schema_config) - api = post.ApiForPost(api_client=used_api_client) # noqa: E501 - - response_status = 200 - response_body = '' - - def test_boundary_point_is_valid_passes(self): - content_type = 'application/json' - # boundary point is valid - with patch.object(urllib3.PoolManager, 'request') as mock_request: - payload = ( - 1.1 - ) - body = post.request_body.RequestBody.content["application/json"].schema.from_openapi_data_( - payload, - configuration_=self.schema_config - ) - mock_request.return_value = self.response( - self.json_bytes(self.response_body), - status=self.response_status - ) - api_response = self.api.post( - body=body, - content_type=content_type - ) - self.assert_pool_manager_request_called_with( - mock_request, - self.api_config.get_server_url('servers', None) + "/requestBody/postMinimumValidationRequestBody", - method='post'.upper(), - body=self.json_bytes(payload), - content_type=content_type, - ) - - assert isinstance(api_response.response, urllib3.HTTPResponse) - assert isinstance(api_response.body, schemas.Unset) - - def test_below_the_minimum_is_invalid_fails(self): - content_type = 'application/json' - # below the minimum is invalid - with patch.object(urllib3.PoolManager, 'request') as mock_request: - payload = ( - 0.6 - ) - with self.assertRaises((unit_test_api.ApiValueError, unit_test_api.ApiTypeError)): - body = post.request_body.RequestBody.content["application/json"].schema.from_openapi_data_( - payload, - configuration_=self.schema_config - ) - self.api.post(body=body) - - def test_above_the_minimum_is_valid_passes(self): - content_type = 'application/json' - # above the minimum is valid - with patch.object(urllib3.PoolManager, 'request') as mock_request: - payload = ( - 2.6 - ) - body = post.request_body.RequestBody.content["application/json"].schema.from_openapi_data_( - payload, - configuration_=self.schema_config - ) - mock_request.return_value = self.response( - self.json_bytes(self.response_body), - status=self.response_status - ) - api_response = self.api.post( - body=body, - content_type=content_type - ) - self.assert_pool_manager_request_called_with( - mock_request, - self.api_config.get_server_url('servers', None) + "/requestBody/postMinimumValidationRequestBody", - method='post'.upper(), - body=self.json_bytes(payload), - content_type=content_type, - ) - - assert isinstance(api_response.response, urllib3.HTTPResponse) - assert isinstance(api_response.body, schemas.Unset) - - def test_ignores_non_numbers_passes(self): - content_type = 'application/json' - # ignores non-numbers - with patch.object(urllib3.PoolManager, 'request') as mock_request: - payload = ( - "x" - ) - body = post.request_body.RequestBody.content["application/json"].schema.from_openapi_data_( - payload, - configuration_=self.schema_config - ) - mock_request.return_value = self.response( - self.json_bytes(self.response_body), - status=self.response_status - ) - api_response = self.api.post( - body=body, - content_type=content_type - ) - self.assert_pool_manager_request_called_with( - mock_request, - self.api_config.get_server_url('servers', None) + "/requestBody/postMinimumValidationRequestBody", - method='post'.upper(), - body=self.json_bytes(payload), - content_type=content_type, - ) - - assert isinstance(api_response.response, urllib3.HTTPResponse) - assert isinstance(api_response.body, schemas.Unset) - -if __name__ == '__main__': - unittest.main() diff --git a/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_request_body_post_minimum_validation_with_signed_integer_request_body/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_request_body_post_minimum_validation_with_signed_integer_request_body/__init__.py index 08a2bc5470e..e69de29bb2d 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_request_body_post_minimum_validation_with_signed_integer_request_body/__init__.py +++ b/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_request_body_post_minimum_validation_with_signed_integer_request_body/__init__.py @@ -1,213 +0,0 @@ -# coding: utf-8 - -""" - - - Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator -""" - -import unittest -from unittest.mock import patch - -import urllib3 - -import unit_test_api -from unit_test_api.paths.request_body_post_minimum_validation_with_signed_integer_request_body.post import operation as post # noqa: E501 -from unit_test_api import schemas, api_client -from unit_test_api.configurations import api_configuration, schema_configuration - -from .. import ApiTestMixin - - -class TestPost(ApiTestMixin, unittest.TestCase): - """ - Post unit test stubs - """ - api_config = api_configuration.ApiConfiguration() - schema_config = schema_configuration.SchemaConfiguration() - used_api_client = api_client.ApiClient(configuration=api_config, schema_config=schema_config) - api = post.ApiForPost(api_client=used_api_client) # noqa: E501 - - response_status = 200 - response_body = '' - - def test_boundary_point_is_valid_passes(self): - content_type = 'application/json' - # boundary point is valid - with patch.object(urllib3.PoolManager, 'request') as mock_request: - payload = ( - -2 - ) - body = post.request_body.RequestBody.content["application/json"].schema.from_openapi_data_( - payload, - configuration_=self.schema_config - ) - mock_request.return_value = self.response( - self.json_bytes(self.response_body), - status=self.response_status - ) - api_response = self.api.post( - body=body, - content_type=content_type - ) - self.assert_pool_manager_request_called_with( - mock_request, - self.api_config.get_server_url('servers', None) + "/requestBody/postMinimumValidationWithSignedIntegerRequestBody", - method='post'.upper(), - body=self.json_bytes(payload), - content_type=content_type, - ) - - assert isinstance(api_response.response, urllib3.HTTPResponse) - assert isinstance(api_response.body, schemas.Unset) - - def test_positive_above_the_minimum_is_valid_passes(self): - content_type = 'application/json' - # positive above the minimum is valid - with patch.object(urllib3.PoolManager, 'request') as mock_request: - payload = ( - 0 - ) - body = post.request_body.RequestBody.content["application/json"].schema.from_openapi_data_( - payload, - configuration_=self.schema_config - ) - mock_request.return_value = self.response( - self.json_bytes(self.response_body), - status=self.response_status - ) - api_response = self.api.post( - body=body, - content_type=content_type - ) - self.assert_pool_manager_request_called_with( - mock_request, - self.api_config.get_server_url('servers', None) + "/requestBody/postMinimumValidationWithSignedIntegerRequestBody", - method='post'.upper(), - body=self.json_bytes(payload), - content_type=content_type, - ) - - assert isinstance(api_response.response, urllib3.HTTPResponse) - assert isinstance(api_response.body, schemas.Unset) - - def test_int_below_the_minimum_is_invalid_fails(self): - content_type = 'application/json' - # int below the minimum is invalid - with patch.object(urllib3.PoolManager, 'request') as mock_request: - payload = ( - -3 - ) - with self.assertRaises((unit_test_api.ApiValueError, unit_test_api.ApiTypeError)): - body = post.request_body.RequestBody.content["application/json"].schema.from_openapi_data_( - payload, - configuration_=self.schema_config - ) - self.api.post(body=body) - - def test_float_below_the_minimum_is_invalid_fails(self): - content_type = 'application/json' - # float below the minimum is invalid - with patch.object(urllib3.PoolManager, 'request') as mock_request: - payload = ( - -2.0001 - ) - with self.assertRaises((unit_test_api.ApiValueError, unit_test_api.ApiTypeError)): - body = post.request_body.RequestBody.content["application/json"].schema.from_openapi_data_( - payload, - configuration_=self.schema_config - ) - self.api.post(body=body) - - def test_boundary_point_with_float_is_valid_passes(self): - content_type = 'application/json' - # boundary point with float is valid - with patch.object(urllib3.PoolManager, 'request') as mock_request: - payload = ( - -2.0 - ) - body = post.request_body.RequestBody.content["application/json"].schema.from_openapi_data_( - payload, - configuration_=self.schema_config - ) - mock_request.return_value = self.response( - self.json_bytes(self.response_body), - status=self.response_status - ) - api_response = self.api.post( - body=body, - content_type=content_type - ) - self.assert_pool_manager_request_called_with( - mock_request, - self.api_config.get_server_url('servers', None) + "/requestBody/postMinimumValidationWithSignedIntegerRequestBody", - method='post'.upper(), - body=self.json_bytes(payload), - content_type=content_type, - ) - - assert isinstance(api_response.response, urllib3.HTTPResponse) - assert isinstance(api_response.body, schemas.Unset) - - def test_negative_above_the_minimum_is_valid_passes(self): - content_type = 'application/json' - # negative above the minimum is valid - with patch.object(urllib3.PoolManager, 'request') as mock_request: - payload = ( - -1 - ) - body = post.request_body.RequestBody.content["application/json"].schema.from_openapi_data_( - payload, - configuration_=self.schema_config - ) - mock_request.return_value = self.response( - self.json_bytes(self.response_body), - status=self.response_status - ) - api_response = self.api.post( - body=body, - content_type=content_type - ) - self.assert_pool_manager_request_called_with( - mock_request, - self.api_config.get_server_url('servers', None) + "/requestBody/postMinimumValidationWithSignedIntegerRequestBody", - method='post'.upper(), - body=self.json_bytes(payload), - content_type=content_type, - ) - - assert isinstance(api_response.response, urllib3.HTTPResponse) - assert isinstance(api_response.body, schemas.Unset) - - def test_ignores_non_numbers_passes(self): - content_type = 'application/json' - # ignores non-numbers - with patch.object(urllib3.PoolManager, 'request') as mock_request: - payload = ( - "x" - ) - body = post.request_body.RequestBody.content["application/json"].schema.from_openapi_data_( - payload, - configuration_=self.schema_config - ) - mock_request.return_value = self.response( - self.json_bytes(self.response_body), - status=self.response_status - ) - api_response = self.api.post( - body=body, - content_type=content_type - ) - self.assert_pool_manager_request_called_with( - mock_request, - self.api_config.get_server_url('servers', None) + "/requestBody/postMinimumValidationWithSignedIntegerRequestBody", - method='post'.upper(), - body=self.json_bytes(payload), - content_type=content_type, - ) - - assert isinstance(api_response.response, urllib3.HTTPResponse) - assert isinstance(api_response.body, schemas.Unset) - -if __name__ == '__main__': - unittest.main() diff --git a/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_request_body_post_minitems_validation_request_body/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_request_body_post_minitems_validation_request_body/__init__.py index e251d8722cc..e69de29bb2d 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_request_body_post_minitems_validation_request_body/__init__.py +++ b/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_request_body_post_minitems_validation_request_body/__init__.py @@ -1,145 +0,0 @@ -# coding: utf-8 - -""" - - - Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator -""" - -import unittest -from unittest.mock import patch - -import urllib3 - -import unit_test_api -from unit_test_api.paths.request_body_post_minitems_validation_request_body.post import operation as post # noqa: E501 -from unit_test_api import schemas, api_client -from unit_test_api.configurations import api_configuration, schema_configuration - -from .. import ApiTestMixin - - -class TestPost(ApiTestMixin, unittest.TestCase): - """ - Post unit test stubs - """ - api_config = api_configuration.ApiConfiguration() - schema_config = schema_configuration.SchemaConfiguration() - used_api_client = api_client.ApiClient(configuration=api_config, schema_config=schema_config) - api = post.ApiForPost(api_client=used_api_client) # noqa: E501 - - response_status = 200 - response_body = '' - - def test_too_short_is_invalid_fails(self): - content_type = 'application/json' - # too short is invalid - with patch.object(urllib3.PoolManager, 'request') as mock_request: - payload = ( - [ - ] - ) - with self.assertRaises((unit_test_api.ApiValueError, unit_test_api.ApiTypeError)): - body = post.request_body.RequestBody.content["application/json"].schema.from_openapi_data_( - payload, - configuration_=self.schema_config - ) - self.api.post(body=body) - - def test_ignores_non_arrays_passes(self): - content_type = 'application/json' - # ignores non-arrays - with patch.object(urllib3.PoolManager, 'request') as mock_request: - payload = ( - "" - ) - body = post.request_body.RequestBody.content["application/json"].schema.from_openapi_data_( - payload, - configuration_=self.schema_config - ) - mock_request.return_value = self.response( - self.json_bytes(self.response_body), - status=self.response_status - ) - api_response = self.api.post( - body=body, - content_type=content_type - ) - self.assert_pool_manager_request_called_with( - mock_request, - self.api_config.get_server_url('servers', None) + "/requestBody/postMinitemsValidationRequestBody", - method='post'.upper(), - body=self.json_bytes(payload), - content_type=content_type, - ) - - assert isinstance(api_response.response, urllib3.HTTPResponse) - assert isinstance(api_response.body, schemas.Unset) - - def test_longer_is_valid_passes(self): - content_type = 'application/json' - # longer is valid - with patch.object(urllib3.PoolManager, 'request') as mock_request: - payload = ( - [ - 1, - 2, - ] - ) - body = post.request_body.RequestBody.content["application/json"].schema.from_openapi_data_( - payload, - configuration_=self.schema_config - ) - mock_request.return_value = self.response( - self.json_bytes(self.response_body), - status=self.response_status - ) - api_response = self.api.post( - body=body, - content_type=content_type - ) - self.assert_pool_manager_request_called_with( - mock_request, - self.api_config.get_server_url('servers', None) + "/requestBody/postMinitemsValidationRequestBody", - method='post'.upper(), - body=self.json_bytes(payload), - content_type=content_type, - ) - - assert isinstance(api_response.response, urllib3.HTTPResponse) - assert isinstance(api_response.body, schemas.Unset) - - def test_exact_length_is_valid_passes(self): - content_type = 'application/json' - # exact length is valid - with patch.object(urllib3.PoolManager, 'request') as mock_request: - payload = ( - [ - 1, - ] - ) - body = post.request_body.RequestBody.content["application/json"].schema.from_openapi_data_( - payload, - configuration_=self.schema_config - ) - mock_request.return_value = self.response( - self.json_bytes(self.response_body), - status=self.response_status - ) - api_response = self.api.post( - body=body, - content_type=content_type - ) - self.assert_pool_manager_request_called_with( - mock_request, - self.api_config.get_server_url('servers', None) + "/requestBody/postMinitemsValidationRequestBody", - method='post'.upper(), - body=self.json_bytes(payload), - content_type=content_type, - ) - - assert isinstance(api_response.response, urllib3.HTTPResponse) - assert isinstance(api_response.body, schemas.Unset) - -if __name__ == '__main__': - unittest.main() diff --git a/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_request_body_post_minlength_validation_request_body/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_request_body_post_minlength_validation_request_body/__init__.py index c95cd608f3f..e69de29bb2d 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_request_body_post_minlength_validation_request_body/__init__.py +++ b/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_request_body_post_minlength_validation_request_body/__init__.py @@ -1,153 +0,0 @@ -# coding: utf-8 - -""" - - - Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator -""" - -import unittest -from unittest.mock import patch - -import urllib3 - -import unit_test_api -from unit_test_api.paths.request_body_post_minlength_validation_request_body.post import operation as post # noqa: E501 -from unit_test_api import schemas, api_client -from unit_test_api.configurations import api_configuration, schema_configuration - -from .. import ApiTestMixin - - -class TestPost(ApiTestMixin, unittest.TestCase): - """ - Post unit test stubs - """ - api_config = api_configuration.ApiConfiguration() - schema_config = schema_configuration.SchemaConfiguration() - used_api_client = api_client.ApiClient(configuration=api_config, schema_config=schema_config) - api = post.ApiForPost(api_client=used_api_client) # noqa: E501 - - response_status = 200 - response_body = '' - - def test_too_short_is_invalid_fails(self): - content_type = 'application/json' - # too short is invalid - with patch.object(urllib3.PoolManager, 'request') as mock_request: - payload = ( - "f" - ) - with self.assertRaises((unit_test_api.ApiValueError, unit_test_api.ApiTypeError)): - body = post.request_body.RequestBody.content["application/json"].schema.from_openapi_data_( - payload, - configuration_=self.schema_config - ) - self.api.post(body=body) - - def test_one_supplementary_unicode_code_point_is_not_long_enough_fails(self): - content_type = 'application/json' - # one supplementary Unicode code point is not long enough - with patch.object(urllib3.PoolManager, 'request') as mock_request: - payload = ( - "💩" - ) - with self.assertRaises((unit_test_api.ApiValueError, unit_test_api.ApiTypeError)): - body = post.request_body.RequestBody.content["application/json"].schema.from_openapi_data_( - payload, - configuration_=self.schema_config - ) - self.api.post(body=body) - - def test_longer_is_valid_passes(self): - content_type = 'application/json' - # longer is valid - with patch.object(urllib3.PoolManager, 'request') as mock_request: - payload = ( - "foo" - ) - body = post.request_body.RequestBody.content["application/json"].schema.from_openapi_data_( - payload, - configuration_=self.schema_config - ) - mock_request.return_value = self.response( - self.json_bytes(self.response_body), - status=self.response_status - ) - api_response = self.api.post( - body=body, - content_type=content_type - ) - self.assert_pool_manager_request_called_with( - mock_request, - self.api_config.get_server_url('servers', None) + "/requestBody/postMinlengthValidationRequestBody", - method='post'.upper(), - body=self.json_bytes(payload), - content_type=content_type, - ) - - assert isinstance(api_response.response, urllib3.HTTPResponse) - assert isinstance(api_response.body, schemas.Unset) - - def test_ignores_non_strings_passes(self): - content_type = 'application/json' - # ignores non-strings - with patch.object(urllib3.PoolManager, 'request') as mock_request: - payload = ( - 1 - ) - body = post.request_body.RequestBody.content["application/json"].schema.from_openapi_data_( - payload, - configuration_=self.schema_config - ) - mock_request.return_value = self.response( - self.json_bytes(self.response_body), - status=self.response_status - ) - api_response = self.api.post( - body=body, - content_type=content_type - ) - self.assert_pool_manager_request_called_with( - mock_request, - self.api_config.get_server_url('servers', None) + "/requestBody/postMinlengthValidationRequestBody", - method='post'.upper(), - body=self.json_bytes(payload), - content_type=content_type, - ) - - assert isinstance(api_response.response, urllib3.HTTPResponse) - assert isinstance(api_response.body, schemas.Unset) - - def test_exact_length_is_valid_passes(self): - content_type = 'application/json' - # exact length is valid - with patch.object(urllib3.PoolManager, 'request') as mock_request: - payload = ( - "fo" - ) - body = post.request_body.RequestBody.content["application/json"].schema.from_openapi_data_( - payload, - configuration_=self.schema_config - ) - mock_request.return_value = self.response( - self.json_bytes(self.response_body), - status=self.response_status - ) - api_response = self.api.post( - body=body, - content_type=content_type - ) - self.assert_pool_manager_request_called_with( - mock_request, - self.api_config.get_server_url('servers', None) + "/requestBody/postMinlengthValidationRequestBody", - method='post'.upper(), - body=self.json_bytes(payload), - content_type=content_type, - ) - - assert isinstance(api_response.response, urllib3.HTTPResponse) - assert isinstance(api_response.body, schemas.Unset) - -if __name__ == '__main__': - unittest.main() diff --git a/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_request_body_post_minproperties_validation_request_body/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_request_body_post_minproperties_validation_request_body/__init__.py index a6eacb68584..e69de29bb2d 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_request_body_post_minproperties_validation_request_body/__init__.py +++ b/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_request_body_post_minproperties_validation_request_body/__init__.py @@ -1,209 +0,0 @@ -# coding: utf-8 - -""" - - - Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator -""" - -import unittest -from unittest.mock import patch - -import urllib3 - -import unit_test_api -from unit_test_api.paths.request_body_post_minproperties_validation_request_body.post import operation as post # noqa: E501 -from unit_test_api import schemas, api_client -from unit_test_api.configurations import api_configuration, schema_configuration - -from .. import ApiTestMixin - - -class TestPost(ApiTestMixin, unittest.TestCase): - """ - Post unit test stubs - """ - api_config = api_configuration.ApiConfiguration() - schema_config = schema_configuration.SchemaConfiguration() - used_api_client = api_client.ApiClient(configuration=api_config, schema_config=schema_config) - api = post.ApiForPost(api_client=used_api_client) # noqa: E501 - - response_status = 200 - response_body = '' - - def test_ignores_arrays_passes(self): - content_type = 'application/json' - # ignores arrays - with patch.object(urllib3.PoolManager, 'request') as mock_request: - payload = ( - [ - ] - ) - body = post.request_body.RequestBody.content["application/json"].schema.from_openapi_data_( - payload, - configuration_=self.schema_config - ) - mock_request.return_value = self.response( - self.json_bytes(self.response_body), - status=self.response_status - ) - api_response = self.api.post( - body=body, - content_type=content_type - ) - self.assert_pool_manager_request_called_with( - mock_request, - self.api_config.get_server_url('servers', None) + "/requestBody/postMinpropertiesValidationRequestBody", - method='post'.upper(), - body=self.json_bytes(payload), - content_type=content_type, - ) - - assert isinstance(api_response.response, urllib3.HTTPResponse) - assert isinstance(api_response.body, schemas.Unset) - - def test_ignores_other_non_objects_passes(self): - content_type = 'application/json' - # ignores other non-objects - with patch.object(urllib3.PoolManager, 'request') as mock_request: - payload = ( - 12 - ) - body = post.request_body.RequestBody.content["application/json"].schema.from_openapi_data_( - payload, - configuration_=self.schema_config - ) - mock_request.return_value = self.response( - self.json_bytes(self.response_body), - status=self.response_status - ) - api_response = self.api.post( - body=body, - content_type=content_type - ) - self.assert_pool_manager_request_called_with( - mock_request, - self.api_config.get_server_url('servers', None) + "/requestBody/postMinpropertiesValidationRequestBody", - method='post'.upper(), - body=self.json_bytes(payload), - content_type=content_type, - ) - - assert isinstance(api_response.response, urllib3.HTTPResponse) - assert isinstance(api_response.body, schemas.Unset) - - def test_too_short_is_invalid_fails(self): - content_type = 'application/json' - # too short is invalid - with patch.object(urllib3.PoolManager, 'request') as mock_request: - payload = ( - { - } - ) - with self.assertRaises((unit_test_api.ApiValueError, unit_test_api.ApiTypeError)): - body = post.request_body.RequestBody.content["application/json"].schema.from_openapi_data_( - payload, - configuration_=self.schema_config - ) - self.api.post(body=body) - - def test_ignores_strings_passes(self): - content_type = 'application/json' - # ignores strings - with patch.object(urllib3.PoolManager, 'request') as mock_request: - payload = ( - "" - ) - body = post.request_body.RequestBody.content["application/json"].schema.from_openapi_data_( - payload, - configuration_=self.schema_config - ) - mock_request.return_value = self.response( - self.json_bytes(self.response_body), - status=self.response_status - ) - api_response = self.api.post( - body=body, - content_type=content_type - ) - self.assert_pool_manager_request_called_with( - mock_request, - self.api_config.get_server_url('servers', None) + "/requestBody/postMinpropertiesValidationRequestBody", - method='post'.upper(), - body=self.json_bytes(payload), - content_type=content_type, - ) - - assert isinstance(api_response.response, urllib3.HTTPResponse) - assert isinstance(api_response.body, schemas.Unset) - - def test_longer_is_valid_passes(self): - content_type = 'application/json' - # longer is valid - with patch.object(urllib3.PoolManager, 'request') as mock_request: - payload = ( - { - "foo": - 1, - "bar": - 2, - } - ) - body = post.request_body.RequestBody.content["application/json"].schema.from_openapi_data_( - payload, - configuration_=self.schema_config - ) - mock_request.return_value = self.response( - self.json_bytes(self.response_body), - status=self.response_status - ) - api_response = self.api.post( - body=body, - content_type=content_type - ) - self.assert_pool_manager_request_called_with( - mock_request, - self.api_config.get_server_url('servers', None) + "/requestBody/postMinpropertiesValidationRequestBody", - method='post'.upper(), - body=self.json_bytes(payload), - content_type=content_type, - ) - - assert isinstance(api_response.response, urllib3.HTTPResponse) - assert isinstance(api_response.body, schemas.Unset) - - def test_exact_length_is_valid_passes(self): - content_type = 'application/json' - # exact length is valid - with patch.object(urllib3.PoolManager, 'request') as mock_request: - payload = ( - { - "foo": - 1, - } - ) - body = post.request_body.RequestBody.content["application/json"].schema.from_openapi_data_( - payload, - configuration_=self.schema_config - ) - mock_request.return_value = self.response( - self.json_bytes(self.response_body), - status=self.response_status - ) - api_response = self.api.post( - body=body, - content_type=content_type - ) - self.assert_pool_manager_request_called_with( - mock_request, - self.api_config.get_server_url('servers', None) + "/requestBody/postMinpropertiesValidationRequestBody", - method='post'.upper(), - body=self.json_bytes(payload), - content_type=content_type, - ) - - assert isinstance(api_response.response, urllib3.HTTPResponse) - assert isinstance(api_response.body, schemas.Unset) - -if __name__ == '__main__': - unittest.main() diff --git a/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_request_body_post_nested_allof_to_check_validation_semantics_request_body/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_request_body_post_nested_allof_to_check_validation_semantics_request_body/__init__.py index 551793716af..e69de29bb2d 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_request_body_post_nested_allof_to_check_validation_semantics_request_body/__init__.py +++ b/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_request_body_post_nested_allof_to_check_validation_semantics_request_body/__init__.py @@ -1,79 +0,0 @@ -# coding: utf-8 - -""" - - - Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator -""" - -import unittest -from unittest.mock import patch - -import urllib3 - -import unit_test_api -from unit_test_api.paths.request_body_post_nested_allof_to_check_validation_semantics_request_body.post import operation as post # noqa: E501 -from unit_test_api import schemas, api_client -from unit_test_api.configurations import api_configuration, schema_configuration - -from .. import ApiTestMixin - - -class TestPost(ApiTestMixin, unittest.TestCase): - """ - Post unit test stubs - """ - api_config = api_configuration.ApiConfiguration() - schema_config = schema_configuration.SchemaConfiguration() - used_api_client = api_client.ApiClient(configuration=api_config, schema_config=schema_config) - api = post.ApiForPost(api_client=used_api_client) # noqa: E501 - - response_status = 200 - response_body = '' - - def test_anything_non_null_is_invalid_fails(self): - content_type = 'application/json' - # anything non-null is invalid - with patch.object(urllib3.PoolManager, 'request') as mock_request: - payload = ( - 123 - ) - with self.assertRaises((unit_test_api.ApiValueError, unit_test_api.ApiTypeError)): - body = post.request_body.RequestBody.content["application/json"].schema.from_openapi_data_( - payload, - configuration_=self.schema_config - ) - self.api.post(body=body) - - def test_null_is_valid_passes(self): - content_type = 'application/json' - # null is valid - with patch.object(urllib3.PoolManager, 'request') as mock_request: - payload = ( - None - ) - body = post.request_body.RequestBody.content["application/json"].schema.from_openapi_data_( - payload, - configuration_=self.schema_config - ) - mock_request.return_value = self.response( - self.json_bytes(self.response_body), - status=self.response_status - ) - api_response = self.api.post( - body=body, - content_type=content_type - ) - self.assert_pool_manager_request_called_with( - mock_request, - self.api_config.get_server_url('servers', None) + "/requestBody/postNestedAllofToCheckValidationSemanticsRequestBody", - method='post'.upper(), - body=self.json_bytes(payload), - content_type=content_type, - ) - - assert isinstance(api_response.response, urllib3.HTTPResponse) - assert isinstance(api_response.body, schemas.Unset) - -if __name__ == '__main__': - unittest.main() diff --git a/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_request_body_post_nested_anyof_to_check_validation_semantics_request_body/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_request_body_post_nested_anyof_to_check_validation_semantics_request_body/__init__.py index b894c81c879..e69de29bb2d 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_request_body_post_nested_anyof_to_check_validation_semantics_request_body/__init__.py +++ b/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_request_body_post_nested_anyof_to_check_validation_semantics_request_body/__init__.py @@ -1,79 +0,0 @@ -# coding: utf-8 - -""" - - - Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator -""" - -import unittest -from unittest.mock import patch - -import urllib3 - -import unit_test_api -from unit_test_api.paths.request_body_post_nested_anyof_to_check_validation_semantics_request_body.post import operation as post # noqa: E501 -from unit_test_api import schemas, api_client -from unit_test_api.configurations import api_configuration, schema_configuration - -from .. import ApiTestMixin - - -class TestPost(ApiTestMixin, unittest.TestCase): - """ - Post unit test stubs - """ - api_config = api_configuration.ApiConfiguration() - schema_config = schema_configuration.SchemaConfiguration() - used_api_client = api_client.ApiClient(configuration=api_config, schema_config=schema_config) - api = post.ApiForPost(api_client=used_api_client) # noqa: E501 - - response_status = 200 - response_body = '' - - def test_anything_non_null_is_invalid_fails(self): - content_type = 'application/json' - # anything non-null is invalid - with patch.object(urllib3.PoolManager, 'request') as mock_request: - payload = ( - 123 - ) - with self.assertRaises((unit_test_api.ApiValueError, unit_test_api.ApiTypeError)): - body = post.request_body.RequestBody.content["application/json"].schema.from_openapi_data_( - payload, - configuration_=self.schema_config - ) - self.api.post(body=body) - - def test_null_is_valid_passes(self): - content_type = 'application/json' - # null is valid - with patch.object(urllib3.PoolManager, 'request') as mock_request: - payload = ( - None - ) - body = post.request_body.RequestBody.content["application/json"].schema.from_openapi_data_( - payload, - configuration_=self.schema_config - ) - mock_request.return_value = self.response( - self.json_bytes(self.response_body), - status=self.response_status - ) - api_response = self.api.post( - body=body, - content_type=content_type - ) - self.assert_pool_manager_request_called_with( - mock_request, - self.api_config.get_server_url('servers', None) + "/requestBody/postNestedAnyofToCheckValidationSemanticsRequestBody", - method='post'.upper(), - body=self.json_bytes(payload), - content_type=content_type, - ) - - assert isinstance(api_response.response, urllib3.HTTPResponse) - assert isinstance(api_response.body, schemas.Unset) - -if __name__ == '__main__': - unittest.main() diff --git a/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_request_body_post_nested_items_request_body/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_request_body_post_nested_items_request_body/__init__.py index 321b97ba3ef..e69de29bb2d 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_request_body_post_nested_items_request_body/__init__.py +++ b/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_request_body_post_nested_items_request_body/__init__.py @@ -1,174 +0,0 @@ -# coding: utf-8 - -""" - - - Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator -""" - -import unittest -from unittest.mock import patch - -import urllib3 - -import unit_test_api -from unit_test_api.paths.request_body_post_nested_items_request_body.post import operation as post # noqa: E501 -from unit_test_api import schemas, api_client -from unit_test_api.configurations import api_configuration, schema_configuration - -from .. import ApiTestMixin - - -class TestPost(ApiTestMixin, unittest.TestCase): - """ - Post unit test stubs - """ - api_config = api_configuration.ApiConfiguration() - schema_config = schema_configuration.SchemaConfiguration() - used_api_client = api_client.ApiClient(configuration=api_config, schema_config=schema_config) - api = post.ApiForPost(api_client=used_api_client) # noqa: E501 - - response_status = 200 - response_body = '' - - def test_valid_nested_array_passes(self): - content_type = 'application/json' - # valid nested array - with patch.object(urllib3.PoolManager, 'request') as mock_request: - payload = ( - [ - [ - [ - [ - 1, - ], - ], - [ - [ - 2, - ], - [ - 3, - ], - ], - ], - [ - [ - [ - 4, - ], - [ - 5, - ], - [ - 6, - ], - ], - ], - ] - ) - body = post.request_body.RequestBody.content["application/json"].schema.from_openapi_data_( - payload, - configuration_=self.schema_config - ) - mock_request.return_value = self.response( - self.json_bytes(self.response_body), - status=self.response_status - ) - api_response = self.api.post( - body=body, - content_type=content_type - ) - self.assert_pool_manager_request_called_with( - mock_request, - self.api_config.get_server_url('servers', None) + "/requestBody/postNestedItemsRequestBody", - method='post'.upper(), - body=self.json_bytes(payload), - content_type=content_type, - ) - - assert isinstance(api_response.response, urllib3.HTTPResponse) - assert isinstance(api_response.body, schemas.Unset) - - def test_nested_array_with_invalid_type_fails(self): - content_type = 'application/json' - # nested array with invalid type - with patch.object(urllib3.PoolManager, 'request') as mock_request: - payload = ( - [ - [ - [ - [ - "1", - ], - ], - [ - [ - 2, - ], - [ - 3, - ], - ], - ], - [ - [ - [ - 4, - ], - [ - 5, - ], - [ - 6, - ], - ], - ], - ] - ) - with self.assertRaises((unit_test_api.ApiValueError, unit_test_api.ApiTypeError)): - body = post.request_body.RequestBody.content["application/json"].schema.from_openapi_data_( - payload, - configuration_=self.schema_config - ) - self.api.post(body=body) - - def test_not_deep_enough_fails(self): - content_type = 'application/json' - # not deep enough - with patch.object(urllib3.PoolManager, 'request') as mock_request: - payload = ( - [ - [ - [ - 1, - ], - [ - 2, - ], - [ - 3, - ], - ], - [ - [ - 4, - ], - [ - 5, - ], - [ - 6, - ], - ], - ] - ) - with self.assertRaises((unit_test_api.ApiValueError, unit_test_api.ApiTypeError)): - body = post.request_body.RequestBody.content["application/json"].schema.from_openapi_data_( - payload, - configuration_=self.schema_config - ) - self.api.post(body=body) - -if __name__ == '__main__': - unittest.main() diff --git a/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_request_body_post_nested_oneof_to_check_validation_semantics_request_body/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_request_body_post_nested_oneof_to_check_validation_semantics_request_body/__init__.py index 8cfc905d8f0..e69de29bb2d 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_request_body_post_nested_oneof_to_check_validation_semantics_request_body/__init__.py +++ b/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_request_body_post_nested_oneof_to_check_validation_semantics_request_body/__init__.py @@ -1,79 +0,0 @@ -# coding: utf-8 - -""" - - - Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator -""" - -import unittest -from unittest.mock import patch - -import urllib3 - -import unit_test_api -from unit_test_api.paths.request_body_post_nested_oneof_to_check_validation_semantics_request_body.post import operation as post # noqa: E501 -from unit_test_api import schemas, api_client -from unit_test_api.configurations import api_configuration, schema_configuration - -from .. import ApiTestMixin - - -class TestPost(ApiTestMixin, unittest.TestCase): - """ - Post unit test stubs - """ - api_config = api_configuration.ApiConfiguration() - schema_config = schema_configuration.SchemaConfiguration() - used_api_client = api_client.ApiClient(configuration=api_config, schema_config=schema_config) - api = post.ApiForPost(api_client=used_api_client) # noqa: E501 - - response_status = 200 - response_body = '' - - def test_anything_non_null_is_invalid_fails(self): - content_type = 'application/json' - # anything non-null is invalid - with patch.object(urllib3.PoolManager, 'request') as mock_request: - payload = ( - 123 - ) - with self.assertRaises((unit_test_api.ApiValueError, unit_test_api.ApiTypeError)): - body = post.request_body.RequestBody.content["application/json"].schema.from_openapi_data_( - payload, - configuration_=self.schema_config - ) - self.api.post(body=body) - - def test_null_is_valid_passes(self): - content_type = 'application/json' - # null is valid - with patch.object(urllib3.PoolManager, 'request') as mock_request: - payload = ( - None - ) - body = post.request_body.RequestBody.content["application/json"].schema.from_openapi_data_( - payload, - configuration_=self.schema_config - ) - mock_request.return_value = self.response( - self.json_bytes(self.response_body), - status=self.response_status - ) - api_response = self.api.post( - body=body, - content_type=content_type - ) - self.assert_pool_manager_request_called_with( - mock_request, - self.api_config.get_server_url('servers', None) + "/requestBody/postNestedOneofToCheckValidationSemanticsRequestBody", - method='post'.upper(), - body=self.json_bytes(payload), - content_type=content_type, - ) - - assert isinstance(api_response.response, urllib3.HTTPResponse) - assert isinstance(api_response.body, schemas.Unset) - -if __name__ == '__main__': - unittest.main() diff --git a/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_request_body_post_not_more_complex_schema_request_body/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_request_body_post_not_more_complex_schema_request_body/__init__.py index 82fbcb4e31f..e69de29bb2d 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_request_body_post_not_more_complex_schema_request_body/__init__.py +++ b/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_request_body_post_not_more_complex_schema_request_body/__init__.py @@ -1,115 +0,0 @@ -# coding: utf-8 - -""" - - - Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator -""" - -import unittest -from unittest.mock import patch - -import urllib3 - -import unit_test_api -from unit_test_api.paths.request_body_post_not_more_complex_schema_request_body.post import operation as post # noqa: E501 -from unit_test_api import schemas, api_client -from unit_test_api.configurations import api_configuration, schema_configuration - -from .. import ApiTestMixin - - -class TestPost(ApiTestMixin, unittest.TestCase): - """ - Post unit test stubs - """ - api_config = api_configuration.ApiConfiguration() - schema_config = schema_configuration.SchemaConfiguration() - used_api_client = api_client.ApiClient(configuration=api_config, schema_config=schema_config) - api = post.ApiForPost(api_client=used_api_client) # noqa: E501 - - response_status = 200 - response_body = '' - - def test_other_match_passes(self): - content_type = 'application/json' - # other match - with patch.object(urllib3.PoolManager, 'request') as mock_request: - payload = ( - { - "foo": - 1, - } - ) - body = post.request_body.RequestBody.content["application/json"].schema.from_openapi_data_( - payload, - configuration_=self.schema_config - ) - mock_request.return_value = self.response( - self.json_bytes(self.response_body), - status=self.response_status - ) - api_response = self.api.post( - body=body, - content_type=content_type - ) - self.assert_pool_manager_request_called_with( - mock_request, - self.api_config.get_server_url('servers', None) + "/requestBody/postNotMoreComplexSchemaRequestBody", - method='post'.upper(), - body=self.json_bytes(payload), - content_type=content_type, - ) - - assert isinstance(api_response.response, urllib3.HTTPResponse) - assert isinstance(api_response.body, schemas.Unset) - - def test_mismatch_fails(self): - content_type = 'application/json' - # mismatch - with patch.object(urllib3.PoolManager, 'request') as mock_request: - payload = ( - { - "foo": - "bar", - } - ) - with self.assertRaises((unit_test_api.ApiValueError, unit_test_api.ApiTypeError)): - body = post.request_body.RequestBody.content["application/json"].schema.from_openapi_data_( - payload, - configuration_=self.schema_config - ) - self.api.post(body=body) - - def test_match_passes(self): - content_type = 'application/json' - # match - with patch.object(urllib3.PoolManager, 'request') as mock_request: - payload = ( - 1 - ) - body = post.request_body.RequestBody.content["application/json"].schema.from_openapi_data_( - payload, - configuration_=self.schema_config - ) - mock_request.return_value = self.response( - self.json_bytes(self.response_body), - status=self.response_status - ) - api_response = self.api.post( - body=body, - content_type=content_type - ) - self.assert_pool_manager_request_called_with( - mock_request, - self.api_config.get_server_url('servers', None) + "/requestBody/postNotMoreComplexSchemaRequestBody", - method='post'.upper(), - body=self.json_bytes(payload), - content_type=content_type, - ) - - assert isinstance(api_response.response, urllib3.HTTPResponse) - assert isinstance(api_response.body, schemas.Unset) - -if __name__ == '__main__': - unittest.main() diff --git a/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_request_body_post_not_request_body/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_request_body_post_not_request_body/__init__.py index aa0b135c843..e69de29bb2d 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_request_body_post_not_request_body/__init__.py +++ b/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_request_body_post_not_request_body/__init__.py @@ -1,79 +0,0 @@ -# coding: utf-8 - -""" - - - Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator -""" - -import unittest -from unittest.mock import patch - -import urllib3 - -import unit_test_api -from unit_test_api.paths.request_body_post_not_request_body.post import operation as post # noqa: E501 -from unit_test_api import schemas, api_client -from unit_test_api.configurations import api_configuration, schema_configuration - -from .. import ApiTestMixin - - -class TestPost(ApiTestMixin, unittest.TestCase): - """ - Post unit test stubs - """ - api_config = api_configuration.ApiConfiguration() - schema_config = schema_configuration.SchemaConfiguration() - used_api_client = api_client.ApiClient(configuration=api_config, schema_config=schema_config) - api = post.ApiForPost(api_client=used_api_client) # noqa: E501 - - response_status = 200 - response_body = '' - - def test_allowed_passes(self): - content_type = 'application/json' - # allowed - with patch.object(urllib3.PoolManager, 'request') as mock_request: - payload = ( - "foo" - ) - body = post.request_body.RequestBody.content["application/json"].schema.from_openapi_data_( - payload, - configuration_=self.schema_config - ) - mock_request.return_value = self.response( - self.json_bytes(self.response_body), - status=self.response_status - ) - api_response = self.api.post( - body=body, - content_type=content_type - ) - self.assert_pool_manager_request_called_with( - mock_request, - self.api_config.get_server_url('servers', None) + "/requestBody/postNotRequestBody", - method='post'.upper(), - body=self.json_bytes(payload), - content_type=content_type, - ) - - assert isinstance(api_response.response, urllib3.HTTPResponse) - assert isinstance(api_response.body, schemas.Unset) - - def test_disallowed_fails(self): - content_type = 'application/json' - # disallowed - with patch.object(urllib3.PoolManager, 'request') as mock_request: - payload = ( - 1 - ) - with self.assertRaises((unit_test_api.ApiValueError, unit_test_api.ApiTypeError)): - body = post.request_body.RequestBody.content["application/json"].schema.from_openapi_data_( - payload, - configuration_=self.schema_config - ) - self.api.post(body=body) - -if __name__ == '__main__': - unittest.main() diff --git a/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_request_body_post_nul_characters_in_strings_request_body/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_request_body_post_nul_characters_in_strings_request_body/__init__.py index d1ae9835f99..e69de29bb2d 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_request_body_post_nul_characters_in_strings_request_body/__init__.py +++ b/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_request_body_post_nul_characters_in_strings_request_body/__init__.py @@ -1,79 +0,0 @@ -# coding: utf-8 - -""" - - - Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator -""" - -import unittest -from unittest.mock import patch - -import urllib3 - -import unit_test_api -from unit_test_api.paths.request_body_post_nul_characters_in_strings_request_body.post import operation as post # noqa: E501 -from unit_test_api import schemas, api_client -from unit_test_api.configurations import api_configuration, schema_configuration - -from .. import ApiTestMixin - - -class TestPost(ApiTestMixin, unittest.TestCase): - """ - Post unit test stubs - """ - api_config = api_configuration.ApiConfiguration() - schema_config = schema_configuration.SchemaConfiguration() - used_api_client = api_client.ApiClient(configuration=api_config, schema_config=schema_config) - api = post.ApiForPost(api_client=used_api_client) # noqa: E501 - - response_status = 200 - response_body = '' - - def test_match_string_with_nul_passes(self): - content_type = 'application/json' - # match string with nul - with patch.object(urllib3.PoolManager, 'request') as mock_request: - payload = ( - "hello\x00there" - ) - body = post.request_body.RequestBody.content["application/json"].schema.from_openapi_data_( - payload, - configuration_=self.schema_config - ) - mock_request.return_value = self.response( - self.json_bytes(self.response_body), - status=self.response_status - ) - api_response = self.api.post( - body=body, - content_type=content_type - ) - self.assert_pool_manager_request_called_with( - mock_request, - self.api_config.get_server_url('servers', None) + "/requestBody/postNulCharactersInStringsRequestBody", - method='post'.upper(), - body=self.json_bytes(payload), - content_type=content_type, - ) - - assert isinstance(api_response.response, urllib3.HTTPResponse) - assert isinstance(api_response.body, schemas.Unset) - - def test_do_not_match_string_lacking_nul_fails(self): - content_type = 'application/json' - # do not match string lacking nul - with patch.object(urllib3.PoolManager, 'request') as mock_request: - payload = ( - "hellothere" - ) - with self.assertRaises((unit_test_api.ApiValueError, unit_test_api.ApiTypeError)): - body = post.request_body.RequestBody.content["application/json"].schema.from_openapi_data_( - payload, - configuration_=self.schema_config - ) - self.api.post(body=body) - -if __name__ == '__main__': - unittest.main() diff --git a/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_request_body_post_null_type_matches_only_the_null_object_request_body/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_request_body_post_null_type_matches_only_the_null_object_request_body/__init__.py index a51e9146f53..e69de29bb2d 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_request_body_post_null_type_matches_only_the_null_object_request_body/__init__.py +++ b/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_request_body_post_null_type_matches_only_the_null_object_request_body/__init__.py @@ -1,193 +0,0 @@ -# coding: utf-8 - -""" - - - Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator -""" - -import unittest -from unittest.mock import patch - -import urllib3 - -import unit_test_api -from unit_test_api.paths.request_body_post_null_type_matches_only_the_null_object_request_body.post import operation as post # noqa: E501 -from unit_test_api import schemas, api_client -from unit_test_api.configurations import api_configuration, schema_configuration - -from .. import ApiTestMixin - - -class TestPost(ApiTestMixin, unittest.TestCase): - """ - Post unit test stubs - """ - api_config = api_configuration.ApiConfiguration() - schema_config = schema_configuration.SchemaConfiguration() - used_api_client = api_client.ApiClient(configuration=api_config, schema_config=schema_config) - api = post.ApiForPost(api_client=used_api_client) # noqa: E501 - - response_status = 200 - response_body = '' - - def test_a_float_is_not_null_fails(self): - content_type = 'application/json' - # a float is not null - with patch.object(urllib3.PoolManager, 'request') as mock_request: - payload = ( - 1.1 - ) - with self.assertRaises((unit_test_api.ApiValueError, unit_test_api.ApiTypeError)): - body = post.request_body.RequestBody.content["application/json"].schema.from_openapi_data_( - payload, - configuration_=self.schema_config - ) - self.api.post(body=body) - - def test_an_object_is_not_null_fails(self): - content_type = 'application/json' - # an object is not null - with patch.object(urllib3.PoolManager, 'request') as mock_request: - payload = ( - { - } - ) - with self.assertRaises((unit_test_api.ApiValueError, unit_test_api.ApiTypeError)): - body = post.request_body.RequestBody.content["application/json"].schema.from_openapi_data_( - payload, - configuration_=self.schema_config - ) - self.api.post(body=body) - - def test_false_is_not_null_fails(self): - content_type = 'application/json' - # false is not null - with patch.object(urllib3.PoolManager, 'request') as mock_request: - payload = ( - False - ) - with self.assertRaises((unit_test_api.ApiValueError, unit_test_api.ApiTypeError)): - body = post.request_body.RequestBody.content["application/json"].schema.from_openapi_data_( - payload, - configuration_=self.schema_config - ) - self.api.post(body=body) - - def test_an_integer_is_not_null_fails(self): - content_type = 'application/json' - # an integer is not null - with patch.object(urllib3.PoolManager, 'request') as mock_request: - payload = ( - 1 - ) - with self.assertRaises((unit_test_api.ApiValueError, unit_test_api.ApiTypeError)): - body = post.request_body.RequestBody.content["application/json"].schema.from_openapi_data_( - payload, - configuration_=self.schema_config - ) - self.api.post(body=body) - - def test_true_is_not_null_fails(self): - content_type = 'application/json' - # true is not null - with patch.object(urllib3.PoolManager, 'request') as mock_request: - payload = ( - True - ) - with self.assertRaises((unit_test_api.ApiValueError, unit_test_api.ApiTypeError)): - body = post.request_body.RequestBody.content["application/json"].schema.from_openapi_data_( - payload, - configuration_=self.schema_config - ) - self.api.post(body=body) - - def test_zero_is_not_null_fails(self): - content_type = 'application/json' - # zero is not null - with patch.object(urllib3.PoolManager, 'request') as mock_request: - payload = ( - 0 - ) - with self.assertRaises((unit_test_api.ApiValueError, unit_test_api.ApiTypeError)): - body = post.request_body.RequestBody.content["application/json"].schema.from_openapi_data_( - payload, - configuration_=self.schema_config - ) - self.api.post(body=body) - - def test_an_empty_string_is_not_null_fails(self): - content_type = 'application/json' - # an empty string is not null - with patch.object(urllib3.PoolManager, 'request') as mock_request: - payload = ( - "" - ) - with self.assertRaises((unit_test_api.ApiValueError, unit_test_api.ApiTypeError)): - body = post.request_body.RequestBody.content["application/json"].schema.from_openapi_data_( - payload, - configuration_=self.schema_config - ) - self.api.post(body=body) - - def test_null_is_null_passes(self): - content_type = 'application/json' - # null is null - with patch.object(urllib3.PoolManager, 'request') as mock_request: - payload = ( - None - ) - body = post.request_body.RequestBody.content["application/json"].schema.from_openapi_data_( - payload, - configuration_=self.schema_config - ) - mock_request.return_value = self.response( - self.json_bytes(self.response_body), - status=self.response_status - ) - api_response = self.api.post( - body=body, - content_type=content_type - ) - self.assert_pool_manager_request_called_with( - mock_request, - self.api_config.get_server_url('servers', None) + "/requestBody/postNullTypeMatchesOnlyTheNullObjectRequestBody", - method='post'.upper(), - body=self.json_bytes(payload), - content_type=content_type, - ) - - assert isinstance(api_response.response, urllib3.HTTPResponse) - assert isinstance(api_response.body, schemas.Unset) - - def test_an_array_is_not_null_fails(self): - content_type = 'application/json' - # an array is not null - with patch.object(urllib3.PoolManager, 'request') as mock_request: - payload = ( - [ - ] - ) - with self.assertRaises((unit_test_api.ApiValueError, unit_test_api.ApiTypeError)): - body = post.request_body.RequestBody.content["application/json"].schema.from_openapi_data_( - payload, - configuration_=self.schema_config - ) - self.api.post(body=body) - - def test_a_string_is_not_null_fails(self): - content_type = 'application/json' - # a string is not null - with patch.object(urllib3.PoolManager, 'request') as mock_request: - payload = ( - "foo" - ) - with self.assertRaises((unit_test_api.ApiValueError, unit_test_api.ApiTypeError)): - body = post.request_body.RequestBody.content["application/json"].schema.from_openapi_data_( - payload, - configuration_=self.schema_config - ) - self.api.post(body=body) - -if __name__ == '__main__': - unittest.main() diff --git a/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_request_body_post_number_type_matches_numbers_request_body/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_request_body_post_number_type_matches_numbers_request_body/__init__.py index ab8d4e80563..e69de29bb2d 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_request_body_post_number_type_matches_numbers_request_body/__init__.py +++ b/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_request_body_post_number_type_matches_numbers_request_body/__init__.py @@ -1,211 +0,0 @@ -# coding: utf-8 - -""" - - - Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator -""" - -import unittest -from unittest.mock import patch - -import urllib3 - -import unit_test_api -from unit_test_api.paths.request_body_post_number_type_matches_numbers_request_body.post import operation as post # noqa: E501 -from unit_test_api import schemas, api_client -from unit_test_api.configurations import api_configuration, schema_configuration - -from .. import ApiTestMixin - - -class TestPost(ApiTestMixin, unittest.TestCase): - """ - Post unit test stubs - """ - api_config = api_configuration.ApiConfiguration() - schema_config = schema_configuration.SchemaConfiguration() - used_api_client = api_client.ApiClient(configuration=api_config, schema_config=schema_config) - api = post.ApiForPost(api_client=used_api_client) # noqa: E501 - - response_status = 200 - response_body = '' - - def test_an_array_is_not_a_number_fails(self): - content_type = 'application/json' - # an array is not a number - with patch.object(urllib3.PoolManager, 'request') as mock_request: - payload = ( - [ - ] - ) - with self.assertRaises((unit_test_api.ApiValueError, unit_test_api.ApiTypeError)): - body = post.request_body.RequestBody.content["application/json"].schema.from_openapi_data_( - payload, - configuration_=self.schema_config - ) - self.api.post(body=body) - - def test_null_is_not_a_number_fails(self): - content_type = 'application/json' - # null is not a number - with patch.object(urllib3.PoolManager, 'request') as mock_request: - payload = ( - None - ) - with self.assertRaises((unit_test_api.ApiValueError, unit_test_api.ApiTypeError)): - body = post.request_body.RequestBody.content["application/json"].schema.from_openapi_data_( - payload, - configuration_=self.schema_config - ) - self.api.post(body=body) - - def test_an_object_is_not_a_number_fails(self): - content_type = 'application/json' - # an object is not a number - with patch.object(urllib3.PoolManager, 'request') as mock_request: - payload = ( - { - } - ) - with self.assertRaises((unit_test_api.ApiValueError, unit_test_api.ApiTypeError)): - body = post.request_body.RequestBody.content["application/json"].schema.from_openapi_data_( - payload, - configuration_=self.schema_config - ) - self.api.post(body=body) - - def test_a_boolean_is_not_a_number_fails(self): - content_type = 'application/json' - # a boolean is not a number - with patch.object(urllib3.PoolManager, 'request') as mock_request: - payload = ( - True - ) - with self.assertRaises((unit_test_api.ApiValueError, unit_test_api.ApiTypeError)): - body = post.request_body.RequestBody.content["application/json"].schema.from_openapi_data_( - payload, - configuration_=self.schema_config - ) - self.api.post(body=body) - - def test_a_float_is_a_number_passes(self): - content_type = 'application/json' - # a float is a number - with patch.object(urllib3.PoolManager, 'request') as mock_request: - payload = ( - 1.1 - ) - body = post.request_body.RequestBody.content["application/json"].schema.from_openapi_data_( - payload, - configuration_=self.schema_config - ) - mock_request.return_value = self.response( - self.json_bytes(self.response_body), - status=self.response_status - ) - api_response = self.api.post( - body=body, - content_type=content_type - ) - self.assert_pool_manager_request_called_with( - mock_request, - self.api_config.get_server_url('servers', None) + "/requestBody/postNumberTypeMatchesNumbersRequestBody", - method='post'.upper(), - body=self.json_bytes(payload), - content_type=content_type, - ) - - assert isinstance(api_response.response, urllib3.HTTPResponse) - assert isinstance(api_response.body, schemas.Unset) - - def test_a_string_is_still_not_a_number_even_if_it_looks_like_one_fails(self): - content_type = 'application/json' - # a string is still not a number, even if it looks like one - with patch.object(urllib3.PoolManager, 'request') as mock_request: - payload = ( - "1" - ) - with self.assertRaises((unit_test_api.ApiValueError, unit_test_api.ApiTypeError)): - body = post.request_body.RequestBody.content["application/json"].schema.from_openapi_data_( - payload, - configuration_=self.schema_config - ) - self.api.post(body=body) - - def test_a_string_is_not_a_number_fails(self): - content_type = 'application/json' - # a string is not a number - with patch.object(urllib3.PoolManager, 'request') as mock_request: - payload = ( - "foo" - ) - with self.assertRaises((unit_test_api.ApiValueError, unit_test_api.ApiTypeError)): - body = post.request_body.RequestBody.content["application/json"].schema.from_openapi_data_( - payload, - configuration_=self.schema_config - ) - self.api.post(body=body) - - def test_an_integer_is_a_number_passes(self): - content_type = 'application/json' - # an integer is a number - with patch.object(urllib3.PoolManager, 'request') as mock_request: - payload = ( - 1 - ) - body = post.request_body.RequestBody.content["application/json"].schema.from_openapi_data_( - payload, - configuration_=self.schema_config - ) - mock_request.return_value = self.response( - self.json_bytes(self.response_body), - status=self.response_status - ) - api_response = self.api.post( - body=body, - content_type=content_type - ) - self.assert_pool_manager_request_called_with( - mock_request, - self.api_config.get_server_url('servers', None) + "/requestBody/postNumberTypeMatchesNumbersRequestBody", - method='post'.upper(), - body=self.json_bytes(payload), - content_type=content_type, - ) - - assert isinstance(api_response.response, urllib3.HTTPResponse) - assert isinstance(api_response.body, schemas.Unset) - - def test_a_float_with_zero_fractional_part_is_a_number_and_an_integer_passes(self): - content_type = 'application/json' - # a float with zero fractional part is a number (and an integer) - with patch.object(urllib3.PoolManager, 'request') as mock_request: - payload = ( - 1.0 - ) - body = post.request_body.RequestBody.content["application/json"].schema.from_openapi_data_( - payload, - configuration_=self.schema_config - ) - mock_request.return_value = self.response( - self.json_bytes(self.response_body), - status=self.response_status - ) - api_response = self.api.post( - body=body, - content_type=content_type - ) - self.assert_pool_manager_request_called_with( - mock_request, - self.api_config.get_server_url('servers', None) + "/requestBody/postNumberTypeMatchesNumbersRequestBody", - method='post'.upper(), - body=self.json_bytes(payload), - content_type=content_type, - ) - - assert isinstance(api_response.response, urllib3.HTTPResponse) - assert isinstance(api_response.body, schemas.Unset) - -if __name__ == '__main__': - unittest.main() diff --git a/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_request_body_post_object_properties_validation_request_body/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_request_body_post_object_properties_validation_request_body/__init__.py index 85c601775d3..e69de29bb2d 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_request_body_post_object_properties_validation_request_body/__init__.py +++ b/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_request_body_post_object_properties_validation_request_body/__init__.py @@ -1,206 +0,0 @@ -# coding: utf-8 - -""" - - - Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator -""" - -import unittest -from unittest.mock import patch - -import urllib3 - -import unit_test_api -from unit_test_api.paths.request_body_post_object_properties_validation_request_body.post import operation as post # noqa: E501 -from unit_test_api import schemas, api_client -from unit_test_api.configurations import api_configuration, schema_configuration - -from .. import ApiTestMixin - - -class TestPost(ApiTestMixin, unittest.TestCase): - """ - Post unit test stubs - """ - api_config = api_configuration.ApiConfiguration() - schema_config = schema_configuration.SchemaConfiguration() - used_api_client = api_client.ApiClient(configuration=api_config, schema_config=schema_config) - api = post.ApiForPost(api_client=used_api_client) # noqa: E501 - - response_status = 200 - response_body = '' - - def test_ignores_arrays_passes(self): - content_type = 'application/json' - # ignores arrays - with patch.object(urllib3.PoolManager, 'request') as mock_request: - payload = ( - [ - ] - ) - body = post.request_body.RequestBody.content["application/json"].schema.from_openapi_data_( - payload, - configuration_=self.schema_config - ) - mock_request.return_value = self.response( - self.json_bytes(self.response_body), - status=self.response_status - ) - api_response = self.api.post( - body=body, - content_type=content_type - ) - self.assert_pool_manager_request_called_with( - mock_request, - self.api_config.get_server_url('servers', None) + "/requestBody/postObjectPropertiesValidationRequestBody", - method='post'.upper(), - body=self.json_bytes(payload), - content_type=content_type, - ) - - assert isinstance(api_response.response, urllib3.HTTPResponse) - assert isinstance(api_response.body, schemas.Unset) - - def test_ignores_other_non_objects_passes(self): - content_type = 'application/json' - # ignores other non-objects - with patch.object(urllib3.PoolManager, 'request') as mock_request: - payload = ( - 12 - ) - body = post.request_body.RequestBody.content["application/json"].schema.from_openapi_data_( - payload, - configuration_=self.schema_config - ) - mock_request.return_value = self.response( - self.json_bytes(self.response_body), - status=self.response_status - ) - api_response = self.api.post( - body=body, - content_type=content_type - ) - self.assert_pool_manager_request_called_with( - mock_request, - self.api_config.get_server_url('servers', None) + "/requestBody/postObjectPropertiesValidationRequestBody", - method='post'.upper(), - body=self.json_bytes(payload), - content_type=content_type, - ) - - assert isinstance(api_response.response, urllib3.HTTPResponse) - assert isinstance(api_response.body, schemas.Unset) - - def test_one_property_invalid_is_invalid_fails(self): - content_type = 'application/json' - # one property invalid is invalid - with patch.object(urllib3.PoolManager, 'request') as mock_request: - payload = ( - { - "foo": - 1, - "bar": - { - }, - } - ) - with self.assertRaises((unit_test_api.ApiValueError, unit_test_api.ApiTypeError)): - body = post.request_body.RequestBody.content["application/json"].schema.from_openapi_data_( - payload, - configuration_=self.schema_config - ) - self.api.post(body=body) - - def test_both_properties_present_and_valid_is_valid_passes(self): - content_type = 'application/json' - # both properties present and valid is valid - with patch.object(urllib3.PoolManager, 'request') as mock_request: - payload = ( - { - "foo": - 1, - "bar": - "baz", - } - ) - body = post.request_body.RequestBody.content["application/json"].schema.from_openapi_data_( - payload, - configuration_=self.schema_config - ) - mock_request.return_value = self.response( - self.json_bytes(self.response_body), - status=self.response_status - ) - api_response = self.api.post( - body=body, - content_type=content_type - ) - self.assert_pool_manager_request_called_with( - mock_request, - self.api_config.get_server_url('servers', None) + "/requestBody/postObjectPropertiesValidationRequestBody", - method='post'.upper(), - body=self.json_bytes(payload), - content_type=content_type, - ) - - assert isinstance(api_response.response, urllib3.HTTPResponse) - assert isinstance(api_response.body, schemas.Unset) - - def test_doesn_t_invalidate_other_properties_passes(self): - content_type = 'application/json' - # doesn't invalidate other properties - with patch.object(urllib3.PoolManager, 'request') as mock_request: - payload = ( - { - "quux": - [ - ], - } - ) - body = post.request_body.RequestBody.content["application/json"].schema.from_openapi_data_( - payload, - configuration_=self.schema_config - ) - mock_request.return_value = self.response( - self.json_bytes(self.response_body), - status=self.response_status - ) - api_response = self.api.post( - body=body, - content_type=content_type - ) - self.assert_pool_manager_request_called_with( - mock_request, - self.api_config.get_server_url('servers', None) + "/requestBody/postObjectPropertiesValidationRequestBody", - method='post'.upper(), - body=self.json_bytes(payload), - content_type=content_type, - ) - - assert isinstance(api_response.response, urllib3.HTTPResponse) - assert isinstance(api_response.body, schemas.Unset) - - def test_both_properties_invalid_is_invalid_fails(self): - content_type = 'application/json' - # both properties invalid is invalid - with patch.object(urllib3.PoolManager, 'request') as mock_request: - payload = ( - { - "foo": - [ - ], - "bar": - { - }, - } - ) - with self.assertRaises((unit_test_api.ApiValueError, unit_test_api.ApiTypeError)): - body = post.request_body.RequestBody.content["application/json"].schema.from_openapi_data_( - payload, - configuration_=self.schema_config - ) - self.api.post(body=body) - -if __name__ == '__main__': - unittest.main() diff --git a/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_request_body_post_object_type_matches_objects_request_body/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_request_body_post_object_type_matches_objects_request_body/__init__.py index bffd99f7771..e69de29bb2d 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_request_body_post_object_type_matches_objects_request_body/__init__.py +++ b/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_request_body_post_object_type_matches_objects_request_body/__init__.py @@ -1,151 +0,0 @@ -# coding: utf-8 - -""" - - - Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator -""" - -import unittest -from unittest.mock import patch - -import urllib3 - -import unit_test_api -from unit_test_api.paths.request_body_post_object_type_matches_objects_request_body.post import operation as post # noqa: E501 -from unit_test_api import schemas, api_client -from unit_test_api.configurations import api_configuration, schema_configuration - -from .. import ApiTestMixin - - -class TestPost(ApiTestMixin, unittest.TestCase): - """ - Post unit test stubs - """ - api_config = api_configuration.ApiConfiguration() - schema_config = schema_configuration.SchemaConfiguration() - used_api_client = api_client.ApiClient(configuration=api_config, schema_config=schema_config) - api = post.ApiForPost(api_client=used_api_client) # noqa: E501 - - response_status = 200 - response_body = '' - - def test_a_float_is_not_an_object_fails(self): - content_type = 'application/json' - # a float is not an object - with patch.object(urllib3.PoolManager, 'request') as mock_request: - payload = ( - 1.1 - ) - with self.assertRaises((unit_test_api.ApiValueError, unit_test_api.ApiTypeError)): - body = post.request_body.RequestBody.content["application/json"].schema.from_openapi_data_( - payload, - configuration_=self.schema_config - ) - self.api.post(body=body) - - def test_null_is_not_an_object_fails(self): - content_type = 'application/json' - # null is not an object - with patch.object(urllib3.PoolManager, 'request') as mock_request: - payload = ( - None - ) - with self.assertRaises((unit_test_api.ApiValueError, unit_test_api.ApiTypeError)): - body = post.request_body.RequestBody.content["application/json"].schema.from_openapi_data_( - payload, - configuration_=self.schema_config - ) - self.api.post(body=body) - - def test_an_array_is_not_an_object_fails(self): - content_type = 'application/json' - # an array is not an object - with patch.object(urllib3.PoolManager, 'request') as mock_request: - payload = ( - [ - ] - ) - with self.assertRaises((unit_test_api.ApiValueError, unit_test_api.ApiTypeError)): - body = post.request_body.RequestBody.content["application/json"].schema.from_openapi_data_( - payload, - configuration_=self.schema_config - ) - self.api.post(body=body) - - def test_an_object_is_an_object_passes(self): - content_type = 'application/json' - # an object is an object - with patch.object(urllib3.PoolManager, 'request') as mock_request: - payload = ( - { - } - ) - body = post.request_body.RequestBody.content["application/json"].schema.from_openapi_data_( - payload, - configuration_=self.schema_config - ) - mock_request.return_value = self.response( - self.json_bytes(self.response_body), - status=self.response_status - ) - api_response = self.api.post( - body=body, - content_type=content_type - ) - self.assert_pool_manager_request_called_with( - mock_request, - self.api_config.get_server_url('servers', None) + "/requestBody/postObjectTypeMatchesObjectsRequestBody", - method='post'.upper(), - body=self.json_bytes(payload), - content_type=content_type, - ) - - assert isinstance(api_response.response, urllib3.HTTPResponse) - assert isinstance(api_response.body, schemas.Unset) - - def test_a_string_is_not_an_object_fails(self): - content_type = 'application/json' - # a string is not an object - with patch.object(urllib3.PoolManager, 'request') as mock_request: - payload = ( - "foo" - ) - with self.assertRaises((unit_test_api.ApiValueError, unit_test_api.ApiTypeError)): - body = post.request_body.RequestBody.content["application/json"].schema.from_openapi_data_( - payload, - configuration_=self.schema_config - ) - self.api.post(body=body) - - def test_an_integer_is_not_an_object_fails(self): - content_type = 'application/json' - # an integer is not an object - with patch.object(urllib3.PoolManager, 'request') as mock_request: - payload = ( - 1 - ) - with self.assertRaises((unit_test_api.ApiValueError, unit_test_api.ApiTypeError)): - body = post.request_body.RequestBody.content["application/json"].schema.from_openapi_data_( - payload, - configuration_=self.schema_config - ) - self.api.post(body=body) - - def test_a_boolean_is_not_an_object_fails(self): - content_type = 'application/json' - # a boolean is not an object - with patch.object(urllib3.PoolManager, 'request') as mock_request: - payload = ( - True - ) - with self.assertRaises((unit_test_api.ApiValueError, unit_test_api.ApiTypeError)): - body = post.request_body.RequestBody.content["application/json"].schema.from_openapi_data_( - payload, - configuration_=self.schema_config - ) - self.api.post(body=body) - -if __name__ == '__main__': - unittest.main() diff --git a/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_request_body_post_oneof_complex_types_request_body/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_request_body_post_oneof_complex_types_request_body/__init__.py index c923ccd46d6..e69de29bb2d 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_request_body_post_oneof_complex_types_request_body/__init__.py +++ b/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_request_body_post_oneof_complex_types_request_body/__init__.py @@ -1,139 +0,0 @@ -# coding: utf-8 - -""" - - - Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator -""" - -import unittest -from unittest.mock import patch - -import urllib3 - -import unit_test_api -from unit_test_api.paths.request_body_post_oneof_complex_types_request_body.post import operation as post # noqa: E501 -from unit_test_api import schemas, api_client -from unit_test_api.configurations import api_configuration, schema_configuration - -from .. import ApiTestMixin - - -class TestPost(ApiTestMixin, unittest.TestCase): - """ - Post unit test stubs - """ - api_config = api_configuration.ApiConfiguration() - schema_config = schema_configuration.SchemaConfiguration() - used_api_client = api_client.ApiClient(configuration=api_config, schema_config=schema_config) - api = post.ApiForPost(api_client=used_api_client) # noqa: E501 - - response_status = 200 - response_body = '' - - def test_first_oneof_valid_complex_passes(self): - content_type = 'application/json' - # first oneOf valid (complex) - with patch.object(urllib3.PoolManager, 'request') as mock_request: - payload = ( - { - "bar": - 2, - } - ) - body = post.request_body.RequestBody.content["application/json"].schema.from_openapi_data_( - payload, - configuration_=self.schema_config - ) - mock_request.return_value = self.response( - self.json_bytes(self.response_body), - status=self.response_status - ) - api_response = self.api.post( - body=body, - content_type=content_type - ) - self.assert_pool_manager_request_called_with( - mock_request, - self.api_config.get_server_url('servers', None) + "/requestBody/postOneofComplexTypesRequestBody", - method='post'.upper(), - body=self.json_bytes(payload), - content_type=content_type, - ) - - assert isinstance(api_response.response, urllib3.HTTPResponse) - assert isinstance(api_response.body, schemas.Unset) - - def test_neither_oneof_valid_complex_fails(self): - content_type = 'application/json' - # neither oneOf valid (complex) - with patch.object(urllib3.PoolManager, 'request') as mock_request: - payload = ( - { - "foo": - 2, - "bar": - "quux", - } - ) - with self.assertRaises((unit_test_api.ApiValueError, unit_test_api.ApiTypeError)): - body = post.request_body.RequestBody.content["application/json"].schema.from_openapi_data_( - payload, - configuration_=self.schema_config - ) - self.api.post(body=body) - - def test_both_oneof_valid_complex_fails(self): - content_type = 'application/json' - # both oneOf valid (complex) - with patch.object(urllib3.PoolManager, 'request') as mock_request: - payload = ( - { - "foo": - "baz", - "bar": - 2, - } - ) - with self.assertRaises((unit_test_api.ApiValueError, unit_test_api.ApiTypeError)): - body = post.request_body.RequestBody.content["application/json"].schema.from_openapi_data_( - payload, - configuration_=self.schema_config - ) - self.api.post(body=body) - - def test_second_oneof_valid_complex_passes(self): - content_type = 'application/json' - # second oneOf valid (complex) - with patch.object(urllib3.PoolManager, 'request') as mock_request: - payload = ( - { - "foo": - "baz", - } - ) - body = post.request_body.RequestBody.content["application/json"].schema.from_openapi_data_( - payload, - configuration_=self.schema_config - ) - mock_request.return_value = self.response( - self.json_bytes(self.response_body), - status=self.response_status - ) - api_response = self.api.post( - body=body, - content_type=content_type - ) - self.assert_pool_manager_request_called_with( - mock_request, - self.api_config.get_server_url('servers', None) + "/requestBody/postOneofComplexTypesRequestBody", - method='post'.upper(), - body=self.json_bytes(payload), - content_type=content_type, - ) - - assert isinstance(api_response.response, urllib3.HTTPResponse) - assert isinstance(api_response.body, schemas.Unset) - -if __name__ == '__main__': - unittest.main() diff --git a/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_request_body_post_oneof_request_body/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_request_body_post_oneof_request_body/__init__.py index adc2596a6b9..e69de29bb2d 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_request_body_post_oneof_request_body/__init__.py +++ b/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_request_body_post_oneof_request_body/__init__.py @@ -1,123 +0,0 @@ -# coding: utf-8 - -""" - - - Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator -""" - -import unittest -from unittest.mock import patch - -import urllib3 - -import unit_test_api -from unit_test_api.paths.request_body_post_oneof_request_body.post import operation as post # noqa: E501 -from unit_test_api import schemas, api_client -from unit_test_api.configurations import api_configuration, schema_configuration - -from .. import ApiTestMixin - - -class TestPost(ApiTestMixin, unittest.TestCase): - """ - Post unit test stubs - """ - api_config = api_configuration.ApiConfiguration() - schema_config = schema_configuration.SchemaConfiguration() - used_api_client = api_client.ApiClient(configuration=api_config, schema_config=schema_config) - api = post.ApiForPost(api_client=used_api_client) # noqa: E501 - - response_status = 200 - response_body = '' - - def test_second_oneof_valid_passes(self): - content_type = 'application/json' - # second oneOf valid - with patch.object(urllib3.PoolManager, 'request') as mock_request: - payload = ( - 2.5 - ) - body = post.request_body.RequestBody.content["application/json"].schema.from_openapi_data_( - payload, - configuration_=self.schema_config - ) - mock_request.return_value = self.response( - self.json_bytes(self.response_body), - status=self.response_status - ) - api_response = self.api.post( - body=body, - content_type=content_type - ) - self.assert_pool_manager_request_called_with( - mock_request, - self.api_config.get_server_url('servers', None) + "/requestBody/postOneofRequestBody", - method='post'.upper(), - body=self.json_bytes(payload), - content_type=content_type, - ) - - assert isinstance(api_response.response, urllib3.HTTPResponse) - assert isinstance(api_response.body, schemas.Unset) - - def test_both_oneof_valid_fails(self): - content_type = 'application/json' - # both oneOf valid - with patch.object(urllib3.PoolManager, 'request') as mock_request: - payload = ( - 3 - ) - with self.assertRaises((unit_test_api.ApiValueError, unit_test_api.ApiTypeError)): - body = post.request_body.RequestBody.content["application/json"].schema.from_openapi_data_( - payload, - configuration_=self.schema_config - ) - self.api.post(body=body) - - def test_first_oneof_valid_passes(self): - content_type = 'application/json' - # first oneOf valid - with patch.object(urllib3.PoolManager, 'request') as mock_request: - payload = ( - 1 - ) - body = post.request_body.RequestBody.content["application/json"].schema.from_openapi_data_( - payload, - configuration_=self.schema_config - ) - mock_request.return_value = self.response( - self.json_bytes(self.response_body), - status=self.response_status - ) - api_response = self.api.post( - body=body, - content_type=content_type - ) - self.assert_pool_manager_request_called_with( - mock_request, - self.api_config.get_server_url('servers', None) + "/requestBody/postOneofRequestBody", - method='post'.upper(), - body=self.json_bytes(payload), - content_type=content_type, - ) - - assert isinstance(api_response.response, urllib3.HTTPResponse) - assert isinstance(api_response.body, schemas.Unset) - - def test_neither_oneof_valid_fails(self): - content_type = 'application/json' - # neither oneOf valid - with patch.object(urllib3.PoolManager, 'request') as mock_request: - payload = ( - 1.5 - ) - with self.assertRaises((unit_test_api.ApiValueError, unit_test_api.ApiTypeError)): - body = post.request_body.RequestBody.content["application/json"].schema.from_openapi_data_( - payload, - configuration_=self.schema_config - ) - self.api.post(body=body) - -if __name__ == '__main__': - unittest.main() diff --git a/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_request_body_post_oneof_with_base_schema_request_body/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_request_body_post_oneof_with_base_schema_request_body/__init__.py index 4a739ec9ae3..e69de29bb2d 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_request_body_post_oneof_with_base_schema_request_body/__init__.py +++ b/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_request_body_post_oneof_with_base_schema_request_body/__init__.py @@ -1,93 +0,0 @@ -# coding: utf-8 - -""" - - - Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator -""" - -import unittest -from unittest.mock import patch - -import urllib3 - -import unit_test_api -from unit_test_api.paths.request_body_post_oneof_with_base_schema_request_body.post import operation as post # noqa: E501 -from unit_test_api import schemas, api_client -from unit_test_api.configurations import api_configuration, schema_configuration - -from .. import ApiTestMixin - - -class TestPost(ApiTestMixin, unittest.TestCase): - """ - Post unit test stubs - """ - api_config = api_configuration.ApiConfiguration() - schema_config = schema_configuration.SchemaConfiguration() - used_api_client = api_client.ApiClient(configuration=api_config, schema_config=schema_config) - api = post.ApiForPost(api_client=used_api_client) # noqa: E501 - - response_status = 200 - response_body = '' - - def test_both_oneof_valid_fails(self): - content_type = 'application/json' - # both oneOf valid - with patch.object(urllib3.PoolManager, 'request') as mock_request: - payload = ( - "foo" - ) - with self.assertRaises((unit_test_api.ApiValueError, unit_test_api.ApiTypeError)): - body = post.request_body.RequestBody.content["application/json"].schema.from_openapi_data_( - payload, - configuration_=self.schema_config - ) - self.api.post(body=body) - - def test_mismatch_base_schema_fails(self): - content_type = 'application/json' - # mismatch base schema - with patch.object(urllib3.PoolManager, 'request') as mock_request: - payload = ( - 3 - ) - with self.assertRaises((unit_test_api.ApiValueError, unit_test_api.ApiTypeError)): - body = post.request_body.RequestBody.content["application/json"].schema.from_openapi_data_( - payload, - configuration_=self.schema_config - ) - self.api.post(body=body) - - def test_one_oneof_valid_passes(self): - content_type = 'application/json' - # one oneOf valid - with patch.object(urllib3.PoolManager, 'request') as mock_request: - payload = ( - "foobar" - ) - body = post.request_body.RequestBody.content["application/json"].schema.from_openapi_data_( - payload, - configuration_=self.schema_config - ) - mock_request.return_value = self.response( - self.json_bytes(self.response_body), - status=self.response_status - ) - api_response = self.api.post( - body=body, - content_type=content_type - ) - self.assert_pool_manager_request_called_with( - mock_request, - self.api_config.get_server_url('servers', None) + "/requestBody/postOneofWithBaseSchemaRequestBody", - method='post'.upper(), - body=self.json_bytes(payload), - content_type=content_type, - ) - - assert isinstance(api_response.response, urllib3.HTTPResponse) - assert isinstance(api_response.body, schemas.Unset) - -if __name__ == '__main__': - unittest.main() diff --git a/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_request_body_post_oneof_with_empty_schema_request_body/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_request_body_post_oneof_with_empty_schema_request_body/__init__.py index 04dcf7ceb66..e69de29bb2d 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_request_body_post_oneof_with_empty_schema_request_body/__init__.py +++ b/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_request_body_post_oneof_with_empty_schema_request_body/__init__.py @@ -1,79 +0,0 @@ -# coding: utf-8 - -""" - - - Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator -""" - -import unittest -from unittest.mock import patch - -import urllib3 - -import unit_test_api -from unit_test_api.paths.request_body_post_oneof_with_empty_schema_request_body.post import operation as post # noqa: E501 -from unit_test_api import schemas, api_client -from unit_test_api.configurations import api_configuration, schema_configuration - -from .. import ApiTestMixin - - -class TestPost(ApiTestMixin, unittest.TestCase): - """ - Post unit test stubs - """ - api_config = api_configuration.ApiConfiguration() - schema_config = schema_configuration.SchemaConfiguration() - used_api_client = api_client.ApiClient(configuration=api_config, schema_config=schema_config) - api = post.ApiForPost(api_client=used_api_client) # noqa: E501 - - response_status = 200 - response_body = '' - - def test_both_valid_invalid_fails(self): - content_type = 'application/json' - # both valid - invalid - with patch.object(urllib3.PoolManager, 'request') as mock_request: - payload = ( - 123 - ) - with self.assertRaises((unit_test_api.ApiValueError, unit_test_api.ApiTypeError)): - body = post.request_body.RequestBody.content["application/json"].schema.from_openapi_data_( - payload, - configuration_=self.schema_config - ) - self.api.post(body=body) - - def test_one_valid_valid_passes(self): - content_type = 'application/json' - # one valid - valid - with patch.object(urllib3.PoolManager, 'request') as mock_request: - payload = ( - "foo" - ) - body = post.request_body.RequestBody.content["application/json"].schema.from_openapi_data_( - payload, - configuration_=self.schema_config - ) - mock_request.return_value = self.response( - self.json_bytes(self.response_body), - status=self.response_status - ) - api_response = self.api.post( - body=body, - content_type=content_type - ) - self.assert_pool_manager_request_called_with( - mock_request, - self.api_config.get_server_url('servers', None) + "/requestBody/postOneofWithEmptySchemaRequestBody", - method='post'.upper(), - body=self.json_bytes(payload), - content_type=content_type, - ) - - assert isinstance(api_response.response, urllib3.HTTPResponse) - assert isinstance(api_response.body, schemas.Unset) - -if __name__ == '__main__': - unittest.main() diff --git a/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_request_body_post_oneof_with_required_request_body/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_request_body_post_oneof_with_required_request_body/__init__.py index 402910fcf67..e69de29bb2d 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_request_body_post_oneof_with_required_request_body/__init__.py +++ b/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_request_body_post_oneof_with_required_request_body/__init__.py @@ -1,143 +0,0 @@ -# coding: utf-8 - -""" - - - Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator -""" - -import unittest -from unittest.mock import patch - -import urllib3 - -import unit_test_api -from unit_test_api.paths.request_body_post_oneof_with_required_request_body.post import operation as post # noqa: E501 -from unit_test_api import schemas, api_client -from unit_test_api.configurations import api_configuration, schema_configuration - -from .. import ApiTestMixin - - -class TestPost(ApiTestMixin, unittest.TestCase): - """ - Post unit test stubs - """ - api_config = api_configuration.ApiConfiguration() - schema_config = schema_configuration.SchemaConfiguration() - used_api_client = api_client.ApiClient(configuration=api_config, schema_config=schema_config) - api = post.ApiForPost(api_client=used_api_client) # noqa: E501 - - response_status = 200 - response_body = '' - - def test_both_valid_invalid_fails(self): - content_type = 'application/json' - # both valid - invalid - with patch.object(urllib3.PoolManager, 'request') as mock_request: - payload = ( - { - "foo": - 1, - "bar": - 2, - "baz": - 3, - } - ) - with self.assertRaises((unit_test_api.ApiValueError, unit_test_api.ApiTypeError)): - body = post.request_body.RequestBody.content["application/json"].schema.from_openapi_data_( - payload, - configuration_=self.schema_config - ) - self.api.post(body=body) - - def test_both_invalid_invalid_fails(self): - content_type = 'application/json' - # both invalid - invalid - with patch.object(urllib3.PoolManager, 'request') as mock_request: - payload = ( - { - "bar": - 2, - } - ) - with self.assertRaises((unit_test_api.ApiValueError, unit_test_api.ApiTypeError)): - body = post.request_body.RequestBody.content["application/json"].schema.from_openapi_data_( - payload, - configuration_=self.schema_config - ) - self.api.post(body=body) - - def test_first_valid_valid_passes(self): - content_type = 'application/json' - # first valid - valid - with patch.object(urllib3.PoolManager, 'request') as mock_request: - payload = ( - { - "foo": - 1, - "bar": - 2, - } - ) - body = post.request_body.RequestBody.content["application/json"].schema.from_openapi_data_( - payload, - configuration_=self.schema_config - ) - mock_request.return_value = self.response( - self.json_bytes(self.response_body), - status=self.response_status - ) - api_response = self.api.post( - body=body, - content_type=content_type - ) - self.assert_pool_manager_request_called_with( - mock_request, - self.api_config.get_server_url('servers', None) + "/requestBody/postOneofWithRequiredRequestBody", - method='post'.upper(), - body=self.json_bytes(payload), - content_type=content_type, - ) - - assert isinstance(api_response.response, urllib3.HTTPResponse) - assert isinstance(api_response.body, schemas.Unset) - - def test_second_valid_valid_passes(self): - content_type = 'application/json' - # second valid - valid - with patch.object(urllib3.PoolManager, 'request') as mock_request: - payload = ( - { - "foo": - 1, - "baz": - 3, - } - ) - body = post.request_body.RequestBody.content["application/json"].schema.from_openapi_data_( - payload, - configuration_=self.schema_config - ) - mock_request.return_value = self.response( - self.json_bytes(self.response_body), - status=self.response_status - ) - api_response = self.api.post( - body=body, - content_type=content_type - ) - self.assert_pool_manager_request_called_with( - mock_request, - self.api_config.get_server_url('servers', None) + "/requestBody/postOneofWithRequiredRequestBody", - method='post'.upper(), - body=self.json_bytes(payload), - content_type=content_type, - ) - - assert isinstance(api_response.response, urllib3.HTTPResponse) - assert isinstance(api_response.body, schemas.Unset) - -if __name__ == '__main__': - unittest.main() diff --git a/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_request_body_post_pattern_is_not_anchored_request_body/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_request_body_post_pattern_is_not_anchored_request_body/__init__.py index 709f2678ee3..e69de29bb2d 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_request_body_post_pattern_is_not_anchored_request_body/__init__.py +++ b/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_request_body_post_pattern_is_not_anchored_request_body/__init__.py @@ -1,65 +0,0 @@ -# coding: utf-8 - -""" - - - Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator -""" - -import unittest -from unittest.mock import patch - -import urllib3 - -import unit_test_api -from unit_test_api.paths.request_body_post_pattern_is_not_anchored_request_body.post import operation as post # noqa: E501 -from unit_test_api import schemas, api_client -from unit_test_api.configurations import api_configuration, schema_configuration - -from .. import ApiTestMixin - - -class TestPost(ApiTestMixin, unittest.TestCase): - """ - Post unit test stubs - """ - api_config = api_configuration.ApiConfiguration() - schema_config = schema_configuration.SchemaConfiguration() - used_api_client = api_client.ApiClient(configuration=api_config, schema_config=schema_config) - api = post.ApiForPost(api_client=used_api_client) # noqa: E501 - - response_status = 200 - response_body = '' - - def test_matches_a_substring_passes(self): - content_type = 'application/json' - # matches a substring - with patch.object(urllib3.PoolManager, 'request') as mock_request: - payload = ( - "xxaayy" - ) - body = post.request_body.RequestBody.content["application/json"].schema.from_openapi_data_( - payload, - configuration_=self.schema_config - ) - mock_request.return_value = self.response( - self.json_bytes(self.response_body), - status=self.response_status - ) - api_response = self.api.post( - body=body, - content_type=content_type - ) - self.assert_pool_manager_request_called_with( - mock_request, - self.api_config.get_server_url('servers', None) + "/requestBody/postPatternIsNotAnchoredRequestBody", - method='post'.upper(), - body=self.json_bytes(payload), - content_type=content_type, - ) - - assert isinstance(api_response.response, urllib3.HTTPResponse) - assert isinstance(api_response.body, schemas.Unset) - -if __name__ == '__main__': - unittest.main() diff --git a/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_request_body_post_pattern_validation_request_body/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_request_body_post_pattern_validation_request_body/__init__.py index ba0ea2d8977..e69de29bb2d 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_request_body_post_pattern_validation_request_body/__init__.py +++ b/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_request_body_post_pattern_validation_request_body/__init__.py @@ -1,261 +0,0 @@ -# coding: utf-8 - -""" - - - Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator -""" - -import unittest -from unittest.mock import patch - -import urllib3 - -import unit_test_api -from unit_test_api.paths.request_body_post_pattern_validation_request_body.post import operation as post # noqa: E501 -from unit_test_api import schemas, api_client -from unit_test_api.configurations import api_configuration, schema_configuration - -from .. import ApiTestMixin - - -class TestPost(ApiTestMixin, unittest.TestCase): - """ - Post unit test stubs - """ - api_config = api_configuration.ApiConfiguration() - schema_config = schema_configuration.SchemaConfiguration() - used_api_client = api_client.ApiClient(configuration=api_config, schema_config=schema_config) - api = post.ApiForPost(api_client=used_api_client) # noqa: E501 - - response_status = 200 - response_body = '' - - def test_ignores_arrays_passes(self): - content_type = 'application/json' - # ignores arrays - with patch.object(urllib3.PoolManager, 'request') as mock_request: - payload = ( - [ - ] - ) - body = post.request_body.RequestBody.content["application/json"].schema.from_openapi_data_( - payload, - configuration_=self.schema_config - ) - mock_request.return_value = self.response( - self.json_bytes(self.response_body), - status=self.response_status - ) - api_response = self.api.post( - body=body, - content_type=content_type - ) - self.assert_pool_manager_request_called_with( - mock_request, - self.api_config.get_server_url('servers', None) + "/requestBody/postPatternValidationRequestBody", - method='post'.upper(), - body=self.json_bytes(payload), - content_type=content_type, - ) - - assert isinstance(api_response.response, urllib3.HTTPResponse) - assert isinstance(api_response.body, schemas.Unset) - - def test_ignores_objects_passes(self): - content_type = 'application/json' - # ignores objects - with patch.object(urllib3.PoolManager, 'request') as mock_request: - payload = ( - { - } - ) - body = post.request_body.RequestBody.content["application/json"].schema.from_openapi_data_( - payload, - configuration_=self.schema_config - ) - mock_request.return_value = self.response( - self.json_bytes(self.response_body), - status=self.response_status - ) - api_response = self.api.post( - body=body, - content_type=content_type - ) - self.assert_pool_manager_request_called_with( - mock_request, - self.api_config.get_server_url('servers', None) + "/requestBody/postPatternValidationRequestBody", - method='post'.upper(), - body=self.json_bytes(payload), - content_type=content_type, - ) - - assert isinstance(api_response.response, urllib3.HTTPResponse) - assert isinstance(api_response.body, schemas.Unset) - - def test_ignores_null_passes(self): - content_type = 'application/json' - # ignores null - with patch.object(urllib3.PoolManager, 'request') as mock_request: - payload = ( - None - ) - body = post.request_body.RequestBody.content["application/json"].schema.from_openapi_data_( - payload, - configuration_=self.schema_config - ) - mock_request.return_value = self.response( - self.json_bytes(self.response_body), - status=self.response_status - ) - api_response = self.api.post( - body=body, - content_type=content_type - ) - self.assert_pool_manager_request_called_with( - mock_request, - self.api_config.get_server_url('servers', None) + "/requestBody/postPatternValidationRequestBody", - method='post'.upper(), - body=self.json_bytes(payload), - content_type=content_type, - ) - - assert isinstance(api_response.response, urllib3.HTTPResponse) - assert isinstance(api_response.body, schemas.Unset) - - def test_ignores_floats_passes(self): - content_type = 'application/json' - # ignores floats - with patch.object(urllib3.PoolManager, 'request') as mock_request: - payload = ( - 1.0 - ) - body = post.request_body.RequestBody.content["application/json"].schema.from_openapi_data_( - payload, - configuration_=self.schema_config - ) - mock_request.return_value = self.response( - self.json_bytes(self.response_body), - status=self.response_status - ) - api_response = self.api.post( - body=body, - content_type=content_type - ) - self.assert_pool_manager_request_called_with( - mock_request, - self.api_config.get_server_url('servers', None) + "/requestBody/postPatternValidationRequestBody", - method='post'.upper(), - body=self.json_bytes(payload), - content_type=content_type, - ) - - assert isinstance(api_response.response, urllib3.HTTPResponse) - assert isinstance(api_response.body, schemas.Unset) - - def test_a_non_matching_pattern_is_invalid_fails(self): - content_type = 'application/json' - # a non-matching pattern is invalid - with patch.object(urllib3.PoolManager, 'request') as mock_request: - payload = ( - "abc" - ) - with self.assertRaises((unit_test_api.ApiValueError, unit_test_api.ApiTypeError)): - body = post.request_body.RequestBody.content["application/json"].schema.from_openapi_data_( - payload, - configuration_=self.schema_config - ) - self.api.post(body=body) - - def test_ignores_booleans_passes(self): - content_type = 'application/json' - # ignores booleans - with patch.object(urllib3.PoolManager, 'request') as mock_request: - payload = ( - True - ) - body = post.request_body.RequestBody.content["application/json"].schema.from_openapi_data_( - payload, - configuration_=self.schema_config - ) - mock_request.return_value = self.response( - self.json_bytes(self.response_body), - status=self.response_status - ) - api_response = self.api.post( - body=body, - content_type=content_type - ) - self.assert_pool_manager_request_called_with( - mock_request, - self.api_config.get_server_url('servers', None) + "/requestBody/postPatternValidationRequestBody", - method='post'.upper(), - body=self.json_bytes(payload), - content_type=content_type, - ) - - assert isinstance(api_response.response, urllib3.HTTPResponse) - assert isinstance(api_response.body, schemas.Unset) - - def test_a_matching_pattern_is_valid_passes(self): - content_type = 'application/json' - # a matching pattern is valid - with patch.object(urllib3.PoolManager, 'request') as mock_request: - payload = ( - "aaa" - ) - body = post.request_body.RequestBody.content["application/json"].schema.from_openapi_data_( - payload, - configuration_=self.schema_config - ) - mock_request.return_value = self.response( - self.json_bytes(self.response_body), - status=self.response_status - ) - api_response = self.api.post( - body=body, - content_type=content_type - ) - self.assert_pool_manager_request_called_with( - mock_request, - self.api_config.get_server_url('servers', None) + "/requestBody/postPatternValidationRequestBody", - method='post'.upper(), - body=self.json_bytes(payload), - content_type=content_type, - ) - - assert isinstance(api_response.response, urllib3.HTTPResponse) - assert isinstance(api_response.body, schemas.Unset) - - def test_ignores_integers_passes(self): - content_type = 'application/json' - # ignores integers - with patch.object(urllib3.PoolManager, 'request') as mock_request: - payload = ( - 123 - ) - body = post.request_body.RequestBody.content["application/json"].schema.from_openapi_data_( - payload, - configuration_=self.schema_config - ) - mock_request.return_value = self.response( - self.json_bytes(self.response_body), - status=self.response_status - ) - api_response = self.api.post( - body=body, - content_type=content_type - ) - self.assert_pool_manager_request_called_with( - mock_request, - self.api_config.get_server_url('servers', None) + "/requestBody/postPatternValidationRequestBody", - method='post'.upper(), - body=self.json_bytes(payload), - content_type=content_type, - ) - - assert isinstance(api_response.response, urllib3.HTTPResponse) - assert isinstance(api_response.body, schemas.Unset) - -if __name__ == '__main__': - unittest.main() diff --git a/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_request_body_post_properties_with_escaped_characters_request_body/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_request_body_post_properties_with_escaped_characters_request_body/__init__.py index 6d982c9abef..e69de29bb2d 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_request_body_post_properties_with_escaped_characters_request_body/__init__.py +++ b/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_request_body_post_properties_with_escaped_characters_request_body/__init__.py @@ -1,105 +0,0 @@ -# coding: utf-8 - -""" - - - Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator -""" - -import unittest -from unittest.mock import patch - -import urllib3 - -import unit_test_api -from unit_test_api.paths.request_body_post_properties_with_escaped_characters_request_body.post import operation as post # noqa: E501 -from unit_test_api import schemas, api_client -from unit_test_api.configurations import api_configuration, schema_configuration - -from .. import ApiTestMixin - - -class TestPost(ApiTestMixin, unittest.TestCase): - """ - Post unit test stubs - """ - api_config = api_configuration.ApiConfiguration() - schema_config = schema_configuration.SchemaConfiguration() - used_api_client = api_client.ApiClient(configuration=api_config, schema_config=schema_config) - api = post.ApiForPost(api_client=used_api_client) # noqa: E501 - - response_status = 200 - response_body = '' - - def test_object_with_all_numbers_is_valid_passes(self): - content_type = 'application/json' - # object with all numbers is valid - with patch.object(urllib3.PoolManager, 'request') as mock_request: - payload = ( - { - "foo\nbar": - 1, - "foo\"bar": - 1, - "foo\\bar": - 1, - "foo\rbar": - 1, - "foo\tbar": - 1, - "foo\fbar": - 1, - } - ) - body = post.request_body.RequestBody.content["application/json"].schema.from_openapi_data_( - payload, - configuration_=self.schema_config - ) - mock_request.return_value = self.response( - self.json_bytes(self.response_body), - status=self.response_status - ) - api_response = self.api.post( - body=body, - content_type=content_type - ) - self.assert_pool_manager_request_called_with( - mock_request, - self.api_config.get_server_url('servers', None) + "/requestBody/postPropertiesWithEscapedCharactersRequestBody", - method='post'.upper(), - body=self.json_bytes(payload), - content_type=content_type, - ) - - assert isinstance(api_response.response, urllib3.HTTPResponse) - assert isinstance(api_response.body, schemas.Unset) - - def test_object_with_strings_is_invalid_fails(self): - content_type = 'application/json' - # object with strings is invalid - with patch.object(urllib3.PoolManager, 'request') as mock_request: - payload = ( - { - "foo\nbar": - "1", - "foo\"bar": - "1", - "foo\\bar": - "1", - "foo\rbar": - "1", - "foo\tbar": - "1", - "foo\fbar": - "1", - } - ) - with self.assertRaises((unit_test_api.ApiValueError, unit_test_api.ApiTypeError)): - body = post.request_body.RequestBody.content["application/json"].schema.from_openapi_data_( - payload, - configuration_=self.schema_config - ) - self.api.post(body=body) - -if __name__ == '__main__': - unittest.main() diff --git a/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_request_body_post_property_named_ref_that_is_not_a_reference_request_body/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_request_body_post_property_named_ref_that_is_not_a_reference_request_body/__init__.py index e0d6076987e..e69de29bb2d 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_request_body_post_property_named_ref_that_is_not_a_reference_request_body/__init__.py +++ b/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_request_body_post_property_named_ref_that_is_not_a_reference_request_body/__init__.py @@ -1,85 +0,0 @@ -# coding: utf-8 - -""" - - - Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator -""" - -import unittest -from unittest.mock import patch - -import urllib3 - -import unit_test_api -from unit_test_api.paths.request_body_post_property_named_ref_that_is_not_a_reference_request_body.post import operation as post # noqa: E501 -from unit_test_api import schemas, api_client -from unit_test_api.configurations import api_configuration, schema_configuration - -from .. import ApiTestMixin - - -class TestPost(ApiTestMixin, unittest.TestCase): - """ - Post unit test stubs - """ - api_config = api_configuration.ApiConfiguration() - schema_config = schema_configuration.SchemaConfiguration() - used_api_client = api_client.ApiClient(configuration=api_config, schema_config=schema_config) - api = post.ApiForPost(api_client=used_api_client) # noqa: E501 - - response_status = 200 - response_body = '' - - def test_property_named_ref_valid_passes(self): - content_type = 'application/json' - # property named $ref valid - with patch.object(urllib3.PoolManager, 'request') as mock_request: - payload = ( - { - "$ref": - "a", - } - ) - body = post.request_body.RequestBody.content["application/json"].schema.from_openapi_data_( - payload, - configuration_=self.schema_config - ) - mock_request.return_value = self.response( - self.json_bytes(self.response_body), - status=self.response_status - ) - api_response = self.api.post( - body=body, - content_type=content_type - ) - self.assert_pool_manager_request_called_with( - mock_request, - self.api_config.get_server_url('servers', None) + "/requestBody/postPropertyNamedRefThatIsNotAReferenceRequestBody", - method='post'.upper(), - body=self.json_bytes(payload), - content_type=content_type, - ) - - assert isinstance(api_response.response, urllib3.HTTPResponse) - assert isinstance(api_response.body, schemas.Unset) - - def test_property_named_ref_invalid_fails(self): - content_type = 'application/json' - # property named $ref invalid - with patch.object(urllib3.PoolManager, 'request') as mock_request: - payload = ( - { - "$ref": - 2, - } - ) - with self.assertRaises((unit_test_api.ApiValueError, unit_test_api.ApiTypeError)): - body = post.request_body.RequestBody.content["application/json"].schema.from_openapi_data_( - payload, - configuration_=self.schema_config - ) - self.api.post(body=body) - -if __name__ == '__main__': - unittest.main() diff --git a/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_request_body_post_ref_in_additionalproperties_request_body/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_request_body_post_ref_in_additionalproperties_request_body/__init__.py index 730ccba3b70..e69de29bb2d 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_request_body_post_ref_in_additionalproperties_request_body/__init__.py +++ b/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_request_body_post_ref_in_additionalproperties_request_body/__init__.py @@ -1,91 +0,0 @@ -# coding: utf-8 - -""" - - - Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator -""" - -import unittest -from unittest.mock import patch - -import urllib3 - -import unit_test_api -from unit_test_api.paths.request_body_post_ref_in_additionalproperties_request_body.post import operation as post # noqa: E501 -from unit_test_api import schemas, api_client -from unit_test_api.configurations import api_configuration, schema_configuration - -from .. import ApiTestMixin - - -class TestPost(ApiTestMixin, unittest.TestCase): - """ - Post unit test stubs - """ - api_config = api_configuration.ApiConfiguration() - schema_config = schema_configuration.SchemaConfiguration() - used_api_client = api_client.ApiClient(configuration=api_config, schema_config=schema_config) - api = post.ApiForPost(api_client=used_api_client) # noqa: E501 - - response_status = 200 - response_body = '' - - def test_property_named_ref_valid_passes(self): - content_type = 'application/json' - # property named $ref valid - with patch.object(urllib3.PoolManager, 'request') as mock_request: - payload = ( - { - "someProp": - { - "$ref": - "a", - }, - } - ) - body = post.request_body.RequestBody.content["application/json"].schema.from_openapi_data_( - payload, - configuration_=self.schema_config - ) - mock_request.return_value = self.response( - self.json_bytes(self.response_body), - status=self.response_status - ) - api_response = self.api.post( - body=body, - content_type=content_type - ) - self.assert_pool_manager_request_called_with( - mock_request, - self.api_config.get_server_url('servers', None) + "/requestBody/postRefInAdditionalpropertiesRequestBody", - method='post'.upper(), - body=self.json_bytes(payload), - content_type=content_type, - ) - - assert isinstance(api_response.response, urllib3.HTTPResponse) - assert isinstance(api_response.body, schemas.Unset) - - def test_property_named_ref_invalid_fails(self): - content_type = 'application/json' - # property named $ref invalid - with patch.object(urllib3.PoolManager, 'request') as mock_request: - payload = ( - { - "someProp": - { - "$ref": - 2, - }, - } - ) - with self.assertRaises((unit_test_api.ApiValueError, unit_test_api.ApiTypeError)): - body = post.request_body.RequestBody.content["application/json"].schema.from_openapi_data_( - payload, - configuration_=self.schema_config - ) - self.api.post(body=body) - -if __name__ == '__main__': - unittest.main() diff --git a/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_request_body_post_ref_in_allof_request_body/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_request_body_post_ref_in_allof_request_body/__init__.py index a2323f0a8bd..e69de29bb2d 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_request_body_post_ref_in_allof_request_body/__init__.py +++ b/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_request_body_post_ref_in_allof_request_body/__init__.py @@ -1,85 +0,0 @@ -# coding: utf-8 - -""" - - - Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator -""" - -import unittest -from unittest.mock import patch - -import urllib3 - -import unit_test_api -from unit_test_api.paths.request_body_post_ref_in_allof_request_body.post import operation as post # noqa: E501 -from unit_test_api import schemas, api_client -from unit_test_api.configurations import api_configuration, schema_configuration - -from .. import ApiTestMixin - - -class TestPost(ApiTestMixin, unittest.TestCase): - """ - Post unit test stubs - """ - api_config = api_configuration.ApiConfiguration() - schema_config = schema_configuration.SchemaConfiguration() - used_api_client = api_client.ApiClient(configuration=api_config, schema_config=schema_config) - api = post.ApiForPost(api_client=used_api_client) # noqa: E501 - - response_status = 200 - response_body = '' - - def test_property_named_ref_valid_passes(self): - content_type = 'application/json' - # property named $ref valid - with patch.object(urllib3.PoolManager, 'request') as mock_request: - payload = ( - { - "$ref": - "a", - } - ) - body = post.request_body.RequestBody.content["application/json"].schema.from_openapi_data_( - payload, - configuration_=self.schema_config - ) - mock_request.return_value = self.response( - self.json_bytes(self.response_body), - status=self.response_status - ) - api_response = self.api.post( - body=body, - content_type=content_type - ) - self.assert_pool_manager_request_called_with( - mock_request, - self.api_config.get_server_url('servers', None) + "/requestBody/postRefInAllofRequestBody", - method='post'.upper(), - body=self.json_bytes(payload), - content_type=content_type, - ) - - assert isinstance(api_response.response, urllib3.HTTPResponse) - assert isinstance(api_response.body, schemas.Unset) - - def test_property_named_ref_invalid_fails(self): - content_type = 'application/json' - # property named $ref invalid - with patch.object(urllib3.PoolManager, 'request') as mock_request: - payload = ( - { - "$ref": - 2, - } - ) - with self.assertRaises((unit_test_api.ApiValueError, unit_test_api.ApiTypeError)): - body = post.request_body.RequestBody.content["application/json"].schema.from_openapi_data_( - payload, - configuration_=self.schema_config - ) - self.api.post(body=body) - -if __name__ == '__main__': - unittest.main() diff --git a/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_request_body_post_ref_in_anyof_request_body/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_request_body_post_ref_in_anyof_request_body/__init__.py index 7249e96639f..e69de29bb2d 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_request_body_post_ref_in_anyof_request_body/__init__.py +++ b/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_request_body_post_ref_in_anyof_request_body/__init__.py @@ -1,85 +0,0 @@ -# coding: utf-8 - -""" - - - Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator -""" - -import unittest -from unittest.mock import patch - -import urllib3 - -import unit_test_api -from unit_test_api.paths.request_body_post_ref_in_anyof_request_body.post import operation as post # noqa: E501 -from unit_test_api import schemas, api_client -from unit_test_api.configurations import api_configuration, schema_configuration - -from .. import ApiTestMixin - - -class TestPost(ApiTestMixin, unittest.TestCase): - """ - Post unit test stubs - """ - api_config = api_configuration.ApiConfiguration() - schema_config = schema_configuration.SchemaConfiguration() - used_api_client = api_client.ApiClient(configuration=api_config, schema_config=schema_config) - api = post.ApiForPost(api_client=used_api_client) # noqa: E501 - - response_status = 200 - response_body = '' - - def test_property_named_ref_valid_passes(self): - content_type = 'application/json' - # property named $ref valid - with patch.object(urllib3.PoolManager, 'request') as mock_request: - payload = ( - { - "$ref": - "a", - } - ) - body = post.request_body.RequestBody.content["application/json"].schema.from_openapi_data_( - payload, - configuration_=self.schema_config - ) - mock_request.return_value = self.response( - self.json_bytes(self.response_body), - status=self.response_status - ) - api_response = self.api.post( - body=body, - content_type=content_type - ) - self.assert_pool_manager_request_called_with( - mock_request, - self.api_config.get_server_url('servers', None) + "/requestBody/postRefInAnyofRequestBody", - method='post'.upper(), - body=self.json_bytes(payload), - content_type=content_type, - ) - - assert isinstance(api_response.response, urllib3.HTTPResponse) - assert isinstance(api_response.body, schemas.Unset) - - def test_property_named_ref_invalid_fails(self): - content_type = 'application/json' - # property named $ref invalid - with patch.object(urllib3.PoolManager, 'request') as mock_request: - payload = ( - { - "$ref": - 2, - } - ) - with self.assertRaises((unit_test_api.ApiValueError, unit_test_api.ApiTypeError)): - body = post.request_body.RequestBody.content["application/json"].schema.from_openapi_data_( - payload, - configuration_=self.schema_config - ) - self.api.post(body=body) - -if __name__ == '__main__': - unittest.main() diff --git a/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_request_body_post_ref_in_items_request_body/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_request_body_post_ref_in_items_request_body/__init__.py index a5ca64e5ebd..e69de29bb2d 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_request_body_post_ref_in_items_request_body/__init__.py +++ b/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_request_body_post_ref_in_items_request_body/__init__.py @@ -1,89 +0,0 @@ -# coding: utf-8 - -""" - - - Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator -""" - -import unittest -from unittest.mock import patch - -import urllib3 - -import unit_test_api -from unit_test_api.paths.request_body_post_ref_in_items_request_body.post import operation as post # noqa: E501 -from unit_test_api import schemas, api_client -from unit_test_api.configurations import api_configuration, schema_configuration - -from .. import ApiTestMixin - - -class TestPost(ApiTestMixin, unittest.TestCase): - """ - Post unit test stubs - """ - api_config = api_configuration.ApiConfiguration() - schema_config = schema_configuration.SchemaConfiguration() - used_api_client = api_client.ApiClient(configuration=api_config, schema_config=schema_config) - api = post.ApiForPost(api_client=used_api_client) # noqa: E501 - - response_status = 200 - response_body = '' - - def test_property_named_ref_valid_passes(self): - content_type = 'application/json' - # property named $ref valid - with patch.object(urllib3.PoolManager, 'request') as mock_request: - payload = ( - [ - { - "$ref": - "a", - }, - ] - ) - body = post.request_body.RequestBody.content["application/json"].schema.from_openapi_data_( - payload, - configuration_=self.schema_config - ) - mock_request.return_value = self.response( - self.json_bytes(self.response_body), - status=self.response_status - ) - api_response = self.api.post( - body=body, - content_type=content_type - ) - self.assert_pool_manager_request_called_with( - mock_request, - self.api_config.get_server_url('servers', None) + "/requestBody/postRefInItemsRequestBody", - method='post'.upper(), - body=self.json_bytes(payload), - content_type=content_type, - ) - - assert isinstance(api_response.response, urllib3.HTTPResponse) - assert isinstance(api_response.body, schemas.Unset) - - def test_property_named_ref_invalid_fails(self): - content_type = 'application/json' - # property named $ref invalid - with patch.object(urllib3.PoolManager, 'request') as mock_request: - payload = ( - [ - { - "$ref": - 2, - }, - ] - ) - with self.assertRaises((unit_test_api.ApiValueError, unit_test_api.ApiTypeError)): - body = post.request_body.RequestBody.content["application/json"].schema.from_openapi_data_( - payload, - configuration_=self.schema_config - ) - self.api.post(body=body) - -if __name__ == '__main__': - unittest.main() diff --git a/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_request_body_post_ref_in_not_request_body/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_request_body_post_ref_in_not_request_body/__init__.py index 5b150784434..e69de29bb2d 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_request_body_post_ref_in_not_request_body/__init__.py +++ b/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_request_body_post_ref_in_not_request_body/__init__.py @@ -1,85 +0,0 @@ -# coding: utf-8 - -""" - - - Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator -""" - -import unittest -from unittest.mock import patch - -import urllib3 - -import unit_test_api -from unit_test_api.paths.request_body_post_ref_in_not_request_body.post import operation as post # noqa: E501 -from unit_test_api import schemas, api_client -from unit_test_api.configurations import api_configuration, schema_configuration - -from .. import ApiTestMixin - - -class TestPost(ApiTestMixin, unittest.TestCase): - """ - Post unit test stubs - """ - api_config = api_configuration.ApiConfiguration() - schema_config = schema_configuration.SchemaConfiguration() - used_api_client = api_client.ApiClient(configuration=api_config, schema_config=schema_config) - api = post.ApiForPost(api_client=used_api_client) # noqa: E501 - - response_status = 200 - response_body = '' - - def test_property_named_ref_valid_passes(self): - content_type = 'application/json' - # property named $ref valid - with patch.object(urllib3.PoolManager, 'request') as mock_request: - payload = ( - { - "$ref": - 2, - } - ) - body = post.request_body.RequestBody.content["application/json"].schema.from_openapi_data_( - payload, - configuration_=self.schema_config - ) - mock_request.return_value = self.response( - self.json_bytes(self.response_body), - status=self.response_status - ) - api_response = self.api.post( - body=body, - content_type=content_type - ) - self.assert_pool_manager_request_called_with( - mock_request, - self.api_config.get_server_url('servers', None) + "/requestBody/postRefInNotRequestBody", - method='post'.upper(), - body=self.json_bytes(payload), - content_type=content_type, - ) - - assert isinstance(api_response.response, urllib3.HTTPResponse) - assert isinstance(api_response.body, schemas.Unset) - - def test_property_named_ref_invalid_fails(self): - content_type = 'application/json' - # property named $ref invalid - with patch.object(urllib3.PoolManager, 'request') as mock_request: - payload = ( - { - "$ref": - "a", - } - ) - with self.assertRaises((unit_test_api.ApiValueError, unit_test_api.ApiTypeError)): - body = post.request_body.RequestBody.content["application/json"].schema.from_openapi_data_( - payload, - configuration_=self.schema_config - ) - self.api.post(body=body) - -if __name__ == '__main__': - unittest.main() diff --git a/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_request_body_post_ref_in_oneof_request_body/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_request_body_post_ref_in_oneof_request_body/__init__.py index 6595a3a1dad..e69de29bb2d 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_request_body_post_ref_in_oneof_request_body/__init__.py +++ b/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_request_body_post_ref_in_oneof_request_body/__init__.py @@ -1,85 +0,0 @@ -# coding: utf-8 - -""" - - - Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator -""" - -import unittest -from unittest.mock import patch - -import urllib3 - -import unit_test_api -from unit_test_api.paths.request_body_post_ref_in_oneof_request_body.post import operation as post # noqa: E501 -from unit_test_api import schemas, api_client -from unit_test_api.configurations import api_configuration, schema_configuration - -from .. import ApiTestMixin - - -class TestPost(ApiTestMixin, unittest.TestCase): - """ - Post unit test stubs - """ - api_config = api_configuration.ApiConfiguration() - schema_config = schema_configuration.SchemaConfiguration() - used_api_client = api_client.ApiClient(configuration=api_config, schema_config=schema_config) - api = post.ApiForPost(api_client=used_api_client) # noqa: E501 - - response_status = 200 - response_body = '' - - def test_property_named_ref_valid_passes(self): - content_type = 'application/json' - # property named $ref valid - with patch.object(urllib3.PoolManager, 'request') as mock_request: - payload = ( - { - "$ref": - "a", - } - ) - body = post.request_body.RequestBody.content["application/json"].schema.from_openapi_data_( - payload, - configuration_=self.schema_config - ) - mock_request.return_value = self.response( - self.json_bytes(self.response_body), - status=self.response_status - ) - api_response = self.api.post( - body=body, - content_type=content_type - ) - self.assert_pool_manager_request_called_with( - mock_request, - self.api_config.get_server_url('servers', None) + "/requestBody/postRefInOneofRequestBody", - method='post'.upper(), - body=self.json_bytes(payload), - content_type=content_type, - ) - - assert isinstance(api_response.response, urllib3.HTTPResponse) - assert isinstance(api_response.body, schemas.Unset) - - def test_property_named_ref_invalid_fails(self): - content_type = 'application/json' - # property named $ref invalid - with patch.object(urllib3.PoolManager, 'request') as mock_request: - payload = ( - { - "$ref": - 2, - } - ) - with self.assertRaises((unit_test_api.ApiValueError, unit_test_api.ApiTypeError)): - body = post.request_body.RequestBody.content["application/json"].schema.from_openapi_data_( - payload, - configuration_=self.schema_config - ) - self.api.post(body=body) - -if __name__ == '__main__': - unittest.main() diff --git a/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_request_body_post_ref_in_property_request_body/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_request_body_post_ref_in_property_request_body/__init__.py index b93276c4717..e69de29bb2d 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_request_body_post_ref_in_property_request_body/__init__.py +++ b/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_request_body_post_ref_in_property_request_body/__init__.py @@ -1,91 +0,0 @@ -# coding: utf-8 - -""" - - - Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator -""" - -import unittest -from unittest.mock import patch - -import urllib3 - -import unit_test_api -from unit_test_api.paths.request_body_post_ref_in_property_request_body.post import operation as post # noqa: E501 -from unit_test_api import schemas, api_client -from unit_test_api.configurations import api_configuration, schema_configuration - -from .. import ApiTestMixin - - -class TestPost(ApiTestMixin, unittest.TestCase): - """ - Post unit test stubs - """ - api_config = api_configuration.ApiConfiguration() - schema_config = schema_configuration.SchemaConfiguration() - used_api_client = api_client.ApiClient(configuration=api_config, schema_config=schema_config) - api = post.ApiForPost(api_client=used_api_client) # noqa: E501 - - response_status = 200 - response_body = '' - - def test_property_named_ref_valid_passes(self): - content_type = 'application/json' - # property named $ref valid - with patch.object(urllib3.PoolManager, 'request') as mock_request: - payload = ( - { - "a": - { - "$ref": - "a", - }, - } - ) - body = post.request_body.RequestBody.content["application/json"].schema.from_openapi_data_( - payload, - configuration_=self.schema_config - ) - mock_request.return_value = self.response( - self.json_bytes(self.response_body), - status=self.response_status - ) - api_response = self.api.post( - body=body, - content_type=content_type - ) - self.assert_pool_manager_request_called_with( - mock_request, - self.api_config.get_server_url('servers', None) + "/requestBody/postRefInPropertyRequestBody", - method='post'.upper(), - body=self.json_bytes(payload), - content_type=content_type, - ) - - assert isinstance(api_response.response, urllib3.HTTPResponse) - assert isinstance(api_response.body, schemas.Unset) - - def test_property_named_ref_invalid_fails(self): - content_type = 'application/json' - # property named $ref invalid - with patch.object(urllib3.PoolManager, 'request') as mock_request: - payload = ( - { - "a": - { - "$ref": - 2, - }, - } - ) - with self.assertRaises((unit_test_api.ApiValueError, unit_test_api.ApiTypeError)): - body = post.request_body.RequestBody.content["application/json"].schema.from_openapi_data_( - payload, - configuration_=self.schema_config - ) - self.api.post(body=body) - -if __name__ == '__main__': - unittest.main() diff --git a/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_request_body_post_required_default_validation_request_body/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_request_body_post_required_default_validation_request_body/__init__.py index 15b2c1debfd..e69de29bb2d 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_request_body_post_required_default_validation_request_body/__init__.py +++ b/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_request_body_post_required_default_validation_request_body/__init__.py @@ -1,66 +0,0 @@ -# coding: utf-8 - -""" - - - Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator -""" - -import unittest -from unittest.mock import patch - -import urllib3 - -import unit_test_api -from unit_test_api.paths.request_body_post_required_default_validation_request_body.post import operation as post # noqa: E501 -from unit_test_api import schemas, api_client -from unit_test_api.configurations import api_configuration, schema_configuration - -from .. import ApiTestMixin - - -class TestPost(ApiTestMixin, unittest.TestCase): - """ - Post unit test stubs - """ - api_config = api_configuration.ApiConfiguration() - schema_config = schema_configuration.SchemaConfiguration() - used_api_client = api_client.ApiClient(configuration=api_config, schema_config=schema_config) - api = post.ApiForPost(api_client=used_api_client) # noqa: E501 - - response_status = 200 - response_body = '' - - def test_not_required_by_default_passes(self): - content_type = 'application/json' - # not required by default - with patch.object(urllib3.PoolManager, 'request') as mock_request: - payload = ( - { - } - ) - body = post.request_body.RequestBody.content["application/json"].schema.from_openapi_data_( - payload, - configuration_=self.schema_config - ) - mock_request.return_value = self.response( - self.json_bytes(self.response_body), - status=self.response_status - ) - api_response = self.api.post( - body=body, - content_type=content_type - ) - self.assert_pool_manager_request_called_with( - mock_request, - self.api_config.get_server_url('servers', None) + "/requestBody/postRequiredDefaultValidationRequestBody", - method='post'.upper(), - body=self.json_bytes(payload), - content_type=content_type, - ) - - assert isinstance(api_response.response, urllib3.HTTPResponse) - assert isinstance(api_response.body, schemas.Unset) - -if __name__ == '__main__': - unittest.main() diff --git a/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_request_body_post_required_validation_request_body/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_request_body_post_required_validation_request_body/__init__.py index fe9c130b39e..e69de29bb2d 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_request_body_post_required_validation_request_body/__init__.py +++ b/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_request_body_post_required_validation_request_body/__init__.py @@ -1,176 +0,0 @@ -# coding: utf-8 - -""" - - - Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator -""" - -import unittest -from unittest.mock import patch - -import urllib3 - -import unit_test_api -from unit_test_api.paths.request_body_post_required_validation_request_body.post import operation as post # noqa: E501 -from unit_test_api import schemas, api_client -from unit_test_api.configurations import api_configuration, schema_configuration - -from .. import ApiTestMixin - - -class TestPost(ApiTestMixin, unittest.TestCase): - """ - Post unit test stubs - """ - api_config = api_configuration.ApiConfiguration() - schema_config = schema_configuration.SchemaConfiguration() - used_api_client = api_client.ApiClient(configuration=api_config, schema_config=schema_config) - api = post.ApiForPost(api_client=used_api_client) # noqa: E501 - - response_status = 200 - response_body = '' - - def test_ignores_arrays_passes(self): - content_type = 'application/json' - # ignores arrays - with patch.object(urllib3.PoolManager, 'request') as mock_request: - payload = ( - [ - ] - ) - body = post.request_body.RequestBody.content["application/json"].schema.from_openapi_data_( - payload, - configuration_=self.schema_config - ) - mock_request.return_value = self.response( - self.json_bytes(self.response_body), - status=self.response_status - ) - api_response = self.api.post( - body=body, - content_type=content_type - ) - self.assert_pool_manager_request_called_with( - mock_request, - self.api_config.get_server_url('servers', None) + "/requestBody/postRequiredValidationRequestBody", - method='post'.upper(), - body=self.json_bytes(payload), - content_type=content_type, - ) - - assert isinstance(api_response.response, urllib3.HTTPResponse) - assert isinstance(api_response.body, schemas.Unset) - - def test_present_required_property_is_valid_passes(self): - content_type = 'application/json' - # present required property is valid - with patch.object(urllib3.PoolManager, 'request') as mock_request: - payload = ( - { - "foo": - 1, - } - ) - body = post.request_body.RequestBody.content["application/json"].schema.from_openapi_data_( - payload, - configuration_=self.schema_config - ) - mock_request.return_value = self.response( - self.json_bytes(self.response_body), - status=self.response_status - ) - api_response = self.api.post( - body=body, - content_type=content_type - ) - self.assert_pool_manager_request_called_with( - mock_request, - self.api_config.get_server_url('servers', None) + "/requestBody/postRequiredValidationRequestBody", - method='post'.upper(), - body=self.json_bytes(payload), - content_type=content_type, - ) - - assert isinstance(api_response.response, urllib3.HTTPResponse) - assert isinstance(api_response.body, schemas.Unset) - - def test_ignores_other_non_objects_passes(self): - content_type = 'application/json' - # ignores other non-objects - with patch.object(urllib3.PoolManager, 'request') as mock_request: - payload = ( - 12 - ) - body = post.request_body.RequestBody.content["application/json"].schema.from_openapi_data_( - payload, - configuration_=self.schema_config - ) - mock_request.return_value = self.response( - self.json_bytes(self.response_body), - status=self.response_status - ) - api_response = self.api.post( - body=body, - content_type=content_type - ) - self.assert_pool_manager_request_called_with( - mock_request, - self.api_config.get_server_url('servers', None) + "/requestBody/postRequiredValidationRequestBody", - method='post'.upper(), - body=self.json_bytes(payload), - content_type=content_type, - ) - - assert isinstance(api_response.response, urllib3.HTTPResponse) - assert isinstance(api_response.body, schemas.Unset) - - def test_ignores_strings_passes(self): - content_type = 'application/json' - # ignores strings - with patch.object(urllib3.PoolManager, 'request') as mock_request: - payload = ( - "" - ) - body = post.request_body.RequestBody.content["application/json"].schema.from_openapi_data_( - payload, - configuration_=self.schema_config - ) - mock_request.return_value = self.response( - self.json_bytes(self.response_body), - status=self.response_status - ) - api_response = self.api.post( - body=body, - content_type=content_type - ) - self.assert_pool_manager_request_called_with( - mock_request, - self.api_config.get_server_url('servers', None) + "/requestBody/postRequiredValidationRequestBody", - method='post'.upper(), - body=self.json_bytes(payload), - content_type=content_type, - ) - - assert isinstance(api_response.response, urllib3.HTTPResponse) - assert isinstance(api_response.body, schemas.Unset) - - def test_non_present_required_property_is_invalid_fails(self): - content_type = 'application/json' - # non-present required property is invalid - with patch.object(urllib3.PoolManager, 'request') as mock_request: - payload = ( - { - "bar": - 1, - } - ) - with self.assertRaises((unit_test_api.ApiValueError, unit_test_api.ApiTypeError)): - body = post.request_body.RequestBody.content["application/json"].schema.from_openapi_data_( - payload, - configuration_=self.schema_config - ) - self.api.post(body=body) - -if __name__ == '__main__': - unittest.main() diff --git a/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_request_body_post_required_with_empty_array_request_body/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_request_body_post_required_with_empty_array_request_body/__init__.py index d47aba085ce..e69de29bb2d 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_request_body_post_required_with_empty_array_request_body/__init__.py +++ b/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_request_body_post_required_with_empty_array_request_body/__init__.py @@ -1,66 +0,0 @@ -# coding: utf-8 - -""" - - - Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator -""" - -import unittest -from unittest.mock import patch - -import urllib3 - -import unit_test_api -from unit_test_api.paths.request_body_post_required_with_empty_array_request_body.post import operation as post # noqa: E501 -from unit_test_api import schemas, api_client -from unit_test_api.configurations import api_configuration, schema_configuration - -from .. import ApiTestMixin - - -class TestPost(ApiTestMixin, unittest.TestCase): - """ - Post unit test stubs - """ - api_config = api_configuration.ApiConfiguration() - schema_config = schema_configuration.SchemaConfiguration() - used_api_client = api_client.ApiClient(configuration=api_config, schema_config=schema_config) - api = post.ApiForPost(api_client=used_api_client) # noqa: E501 - - response_status = 200 - response_body = '' - - def test_property_not_required_passes(self): - content_type = 'application/json' - # property not required - with patch.object(urllib3.PoolManager, 'request') as mock_request: - payload = ( - { - } - ) - body = post.request_body.RequestBody.content["application/json"].schema.from_openapi_data_( - payload, - configuration_=self.schema_config - ) - mock_request.return_value = self.response( - self.json_bytes(self.response_body), - status=self.response_status - ) - api_response = self.api.post( - body=body, - content_type=content_type - ) - self.assert_pool_manager_request_called_with( - mock_request, - self.api_config.get_server_url('servers', None) + "/requestBody/postRequiredWithEmptyArrayRequestBody", - method='post'.upper(), - body=self.json_bytes(payload), - content_type=content_type, - ) - - assert isinstance(api_response.response, urllib3.HTTPResponse) - assert isinstance(api_response.body, schemas.Unset) - -if __name__ == '__main__': - unittest.main() diff --git a/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_request_body_post_required_with_escaped_characters_request_body/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_request_body_post_required_with_escaped_characters_request_body/__init__.py index ecf2aea5064..e69de29bb2d 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_request_body_post_required_with_escaped_characters_request_body/__init__.py +++ b/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_request_body_post_required_with_escaped_characters_request_body/__init__.py @@ -1,97 +0,0 @@ -# coding: utf-8 - -""" - - - Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator -""" - -import unittest -from unittest.mock import patch - -import urllib3 - -import unit_test_api -from unit_test_api.paths.request_body_post_required_with_escaped_characters_request_body.post import operation as post # noqa: E501 -from unit_test_api import schemas, api_client -from unit_test_api.configurations import api_configuration, schema_configuration - -from .. import ApiTestMixin - - -class TestPost(ApiTestMixin, unittest.TestCase): - """ - Post unit test stubs - """ - api_config = api_configuration.ApiConfiguration() - schema_config = schema_configuration.SchemaConfiguration() - used_api_client = api_client.ApiClient(configuration=api_config, schema_config=schema_config) - api = post.ApiForPost(api_client=used_api_client) # noqa: E501 - - response_status = 200 - response_body = '' - - def test_object_with_some_properties_missing_is_invalid_fails(self): - content_type = 'application/json' - # object with some properties missing is invalid - with patch.object(urllib3.PoolManager, 'request') as mock_request: - payload = ( - { - "foo\nbar": - "1", - "foo\"bar": - "1", - } - ) - with self.assertRaises((unit_test_api.ApiValueError, unit_test_api.ApiTypeError)): - body = post.request_body.RequestBody.content["application/json"].schema.from_openapi_data_( - payload, - configuration_=self.schema_config - ) - self.api.post(body=body) - - def test_object_with_all_properties_present_is_valid_passes(self): - content_type = 'application/json' - # object with all properties present is valid - with patch.object(urllib3.PoolManager, 'request') as mock_request: - payload = ( - { - "foo\nbar": - 1, - "foo\"bar": - 1, - "foo\\bar": - 1, - "foo\rbar": - 1, - "foo\tbar": - 1, - "foo\fbar": - 1, - } - ) - body = post.request_body.RequestBody.content["application/json"].schema.from_openapi_data_( - payload, - configuration_=self.schema_config - ) - mock_request.return_value = self.response( - self.json_bytes(self.response_body), - status=self.response_status - ) - api_response = self.api.post( - body=body, - content_type=content_type - ) - self.assert_pool_manager_request_called_with( - mock_request, - self.api_config.get_server_url('servers', None) + "/requestBody/postRequiredWithEscapedCharactersRequestBody", - method='post'.upper(), - body=self.json_bytes(payload), - content_type=content_type, - ) - - assert isinstance(api_response.response, urllib3.HTTPResponse) - assert isinstance(api_response.body, schemas.Unset) - -if __name__ == '__main__': - unittest.main() diff --git a/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_request_body_post_simple_enum_validation_request_body/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_request_body_post_simple_enum_validation_request_body/__init__.py index fd49bc77202..e69de29bb2d 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_request_body_post_simple_enum_validation_request_body/__init__.py +++ b/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_request_body_post_simple_enum_validation_request_body/__init__.py @@ -1,79 +0,0 @@ -# coding: utf-8 - -""" - - - Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator -""" - -import unittest -from unittest.mock import patch - -import urllib3 - -import unit_test_api -from unit_test_api.paths.request_body_post_simple_enum_validation_request_body.post import operation as post # noqa: E501 -from unit_test_api import schemas, api_client -from unit_test_api.configurations import api_configuration, schema_configuration - -from .. import ApiTestMixin - - -class TestPost(ApiTestMixin, unittest.TestCase): - """ - Post unit test stubs - """ - api_config = api_configuration.ApiConfiguration() - schema_config = schema_configuration.SchemaConfiguration() - used_api_client = api_client.ApiClient(configuration=api_config, schema_config=schema_config) - api = post.ApiForPost(api_client=used_api_client) # noqa: E501 - - response_status = 200 - response_body = '' - - def test_something_else_is_invalid_fails(self): - content_type = 'application/json' - # something else is invalid - with patch.object(urllib3.PoolManager, 'request') as mock_request: - payload = ( - 4 - ) - with self.assertRaises((unit_test_api.ApiValueError, unit_test_api.ApiTypeError)): - body = post.request_body.RequestBody.content["application/json"].schema.from_openapi_data_( - payload, - configuration_=self.schema_config - ) - self.api.post(body=body) - - def test_one_of_the_enum_is_valid_passes(self): - content_type = 'application/json' - # one of the enum is valid - with patch.object(urllib3.PoolManager, 'request') as mock_request: - payload = ( - 1 - ) - body = post.request_body.RequestBody.content["application/json"].schema.from_openapi_data_( - payload, - configuration_=self.schema_config - ) - mock_request.return_value = self.response( - self.json_bytes(self.response_body), - status=self.response_status - ) - api_response = self.api.post( - body=body, - content_type=content_type - ) - self.assert_pool_manager_request_called_with( - mock_request, - self.api_config.get_server_url('servers', None) + "/requestBody/postSimpleEnumValidationRequestBody", - method='post'.upper(), - body=self.json_bytes(payload), - content_type=content_type, - ) - - assert isinstance(api_response.response, urllib3.HTTPResponse) - assert isinstance(api_response.body, schemas.Unset) - -if __name__ == '__main__': - unittest.main() diff --git a/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_request_body_post_string_type_matches_strings_request_body/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_request_body_post_string_type_matches_strings_request_body/__init__.py index ecda83b4d4a..e69de29bb2d 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_request_body_post_string_type_matches_strings_request_body/__init__.py +++ b/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_request_body_post_string_type_matches_strings_request_body/__init__.py @@ -1,211 +0,0 @@ -# coding: utf-8 - -""" - - - Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator -""" - -import unittest -from unittest.mock import patch - -import urllib3 - -import unit_test_api -from unit_test_api.paths.request_body_post_string_type_matches_strings_request_body.post import operation as post # noqa: E501 -from unit_test_api import schemas, api_client -from unit_test_api.configurations import api_configuration, schema_configuration - -from .. import ApiTestMixin - - -class TestPost(ApiTestMixin, unittest.TestCase): - """ - Post unit test stubs - """ - api_config = api_configuration.ApiConfiguration() - schema_config = schema_configuration.SchemaConfiguration() - used_api_client = api_client.ApiClient(configuration=api_config, schema_config=schema_config) - api = post.ApiForPost(api_client=used_api_client) # noqa: E501 - - response_status = 200 - response_body = '' - - def test_1_is_not_a_string_fails(self): - content_type = 'application/json' - # 1 is not a string - with patch.object(urllib3.PoolManager, 'request') as mock_request: - payload = ( - 1 - ) - with self.assertRaises((unit_test_api.ApiValueError, unit_test_api.ApiTypeError)): - body = post.request_body.RequestBody.content["application/json"].schema.from_openapi_data_( - payload, - configuration_=self.schema_config - ) - self.api.post(body=body) - - def test_a_string_is_still_a_string_even_if_it_looks_like_a_number_passes(self): - content_type = 'application/json' - # a string is still a string, even if it looks like a number - with patch.object(urllib3.PoolManager, 'request') as mock_request: - payload = ( - "1" - ) - body = post.request_body.RequestBody.content["application/json"].schema.from_openapi_data_( - payload, - configuration_=self.schema_config - ) - mock_request.return_value = self.response( - self.json_bytes(self.response_body), - status=self.response_status - ) - api_response = self.api.post( - body=body, - content_type=content_type - ) - self.assert_pool_manager_request_called_with( - mock_request, - self.api_config.get_server_url('servers', None) + "/requestBody/postStringTypeMatchesStringsRequestBody", - method='post'.upper(), - body=self.json_bytes(payload), - content_type=content_type, - ) - - assert isinstance(api_response.response, urllib3.HTTPResponse) - assert isinstance(api_response.body, schemas.Unset) - - def test_an_empty_string_is_still_a_string_passes(self): - content_type = 'application/json' - # an empty string is still a string - with patch.object(urllib3.PoolManager, 'request') as mock_request: - payload = ( - "" - ) - body = post.request_body.RequestBody.content["application/json"].schema.from_openapi_data_( - payload, - configuration_=self.schema_config - ) - mock_request.return_value = self.response( - self.json_bytes(self.response_body), - status=self.response_status - ) - api_response = self.api.post( - body=body, - content_type=content_type - ) - self.assert_pool_manager_request_called_with( - mock_request, - self.api_config.get_server_url('servers', None) + "/requestBody/postStringTypeMatchesStringsRequestBody", - method='post'.upper(), - body=self.json_bytes(payload), - content_type=content_type, - ) - - assert isinstance(api_response.response, urllib3.HTTPResponse) - assert isinstance(api_response.body, schemas.Unset) - - def test_a_float_is_not_a_string_fails(self): - content_type = 'application/json' - # a float is not a string - with patch.object(urllib3.PoolManager, 'request') as mock_request: - payload = ( - 1.1 - ) - with self.assertRaises((unit_test_api.ApiValueError, unit_test_api.ApiTypeError)): - body = post.request_body.RequestBody.content["application/json"].schema.from_openapi_data_( - payload, - configuration_=self.schema_config - ) - self.api.post(body=body) - - def test_an_object_is_not_a_string_fails(self): - content_type = 'application/json' - # an object is not a string - with patch.object(urllib3.PoolManager, 'request') as mock_request: - payload = ( - { - } - ) - with self.assertRaises((unit_test_api.ApiValueError, unit_test_api.ApiTypeError)): - body = post.request_body.RequestBody.content["application/json"].schema.from_openapi_data_( - payload, - configuration_=self.schema_config - ) - self.api.post(body=body) - - def test_an_array_is_not_a_string_fails(self): - content_type = 'application/json' - # an array is not a string - with patch.object(urllib3.PoolManager, 'request') as mock_request: - payload = ( - [ - ] - ) - with self.assertRaises((unit_test_api.ApiValueError, unit_test_api.ApiTypeError)): - body = post.request_body.RequestBody.content["application/json"].schema.from_openapi_data_( - payload, - configuration_=self.schema_config - ) - self.api.post(body=body) - - def test_a_boolean_is_not_a_string_fails(self): - content_type = 'application/json' - # a boolean is not a string - with patch.object(urllib3.PoolManager, 'request') as mock_request: - payload = ( - True - ) - with self.assertRaises((unit_test_api.ApiValueError, unit_test_api.ApiTypeError)): - body = post.request_body.RequestBody.content["application/json"].schema.from_openapi_data_( - payload, - configuration_=self.schema_config - ) - self.api.post(body=body) - - def test_null_is_not_a_string_fails(self): - content_type = 'application/json' - # null is not a string - with patch.object(urllib3.PoolManager, 'request') as mock_request: - payload = ( - None - ) - with self.assertRaises((unit_test_api.ApiValueError, unit_test_api.ApiTypeError)): - body = post.request_body.RequestBody.content["application/json"].schema.from_openapi_data_( - payload, - configuration_=self.schema_config - ) - self.api.post(body=body) - - def test_a_string_is_a_string_passes(self): - content_type = 'application/json' - # a string is a string - with patch.object(urllib3.PoolManager, 'request') as mock_request: - payload = ( - "foo" - ) - body = post.request_body.RequestBody.content["application/json"].schema.from_openapi_data_( - payload, - configuration_=self.schema_config - ) - mock_request.return_value = self.response( - self.json_bytes(self.response_body), - status=self.response_status - ) - api_response = self.api.post( - body=body, - content_type=content_type - ) - self.assert_pool_manager_request_called_with( - mock_request, - self.api_config.get_server_url('servers', None) + "/requestBody/postStringTypeMatchesStringsRequestBody", - method='post'.upper(), - body=self.json_bytes(payload), - content_type=content_type, - ) - - assert isinstance(api_response.response, urllib3.HTTPResponse) - assert isinstance(api_response.body, schemas.Unset) - -if __name__ == '__main__': - unittest.main() diff --git a/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_request_body_post_the_default_keyword_does_not_do_anything_if_the_property_is_missing_request_body/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_request_body_post_the_default_keyword_does_not_do_anything_if_the_property_is_missing_request_body/__init__.py index e059c3ae906..e69de29bb2d 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_request_body_post_the_default_keyword_does_not_do_anything_if_the_property_is_missing_request_body/__init__.py +++ b/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_request_body_post_the_default_keyword_does_not_do_anything_if_the_property_is_missing_request_body/__init__.py @@ -1,116 +0,0 @@ -# coding: utf-8 - -""" - - - Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator -""" - -import unittest -from unittest.mock import patch - -import urllib3 - -import unit_test_api -from unit_test_api.paths.request_body_post_the_default_keyword_does_not_do_anything_if_the_property_is_missing_request_body.post import operation as post # noqa: E501 -from unit_test_api import schemas, api_client -from unit_test_api.configurations import api_configuration, schema_configuration - -from .. import ApiTestMixin - - -class TestPost(ApiTestMixin, unittest.TestCase): - """ - Post unit test stubs - """ - api_config = api_configuration.ApiConfiguration() - schema_config = schema_configuration.SchemaConfiguration() - used_api_client = api_client.ApiClient(configuration=api_config, schema_config=schema_config) - api = post.ApiForPost(api_client=used_api_client) # noqa: E501 - - response_status = 200 - response_body = '' - - def test_missing_properties_are_not_filled_in_with_the_default_passes(self): - content_type = 'application/json' - # missing properties are not filled in with the default - with patch.object(urllib3.PoolManager, 'request') as mock_request: - payload = ( - { - } - ) - body = post.request_body.RequestBody.content["application/json"].schema.from_openapi_data_( - payload, - configuration_=self.schema_config - ) - mock_request.return_value = self.response( - self.json_bytes(self.response_body), - status=self.response_status - ) - api_response = self.api.post( - body=body, - content_type=content_type - ) - self.assert_pool_manager_request_called_with( - mock_request, - self.api_config.get_server_url('servers', None) + "/requestBody/postTheDefaultKeywordDoesNotDoAnythingIfThePropertyIsMissingRequestBody", - method='post'.upper(), - body=self.json_bytes(payload), - content_type=content_type, - ) - - assert isinstance(api_response.response, urllib3.HTTPResponse) - assert isinstance(api_response.body, schemas.Unset) - - def test_an_explicit_property_value_is_checked_against_maximum_passing_passes(self): - content_type = 'application/json' - # an explicit property value is checked against maximum (passing) - with patch.object(urllib3.PoolManager, 'request') as mock_request: - payload = ( - { - "alpha": - 1, - } - ) - body = post.request_body.RequestBody.content["application/json"].schema.from_openapi_data_( - payload, - configuration_=self.schema_config - ) - mock_request.return_value = self.response( - self.json_bytes(self.response_body), - status=self.response_status - ) - api_response = self.api.post( - body=body, - content_type=content_type - ) - self.assert_pool_manager_request_called_with( - mock_request, - self.api_config.get_server_url('servers', None) + "/requestBody/postTheDefaultKeywordDoesNotDoAnythingIfThePropertyIsMissingRequestBody", - method='post'.upper(), - body=self.json_bytes(payload), - content_type=content_type, - ) - - assert isinstance(api_response.response, urllib3.HTTPResponse) - assert isinstance(api_response.body, schemas.Unset) - - def test_an_explicit_property_value_is_checked_against_maximum_failing_fails(self): - content_type = 'application/json' - # an explicit property value is checked against maximum (failing) - with patch.object(urllib3.PoolManager, 'request') as mock_request: - payload = ( - { - "alpha": - 5, - } - ) - with self.assertRaises((unit_test_api.ApiValueError, unit_test_api.ApiTypeError)): - body = post.request_body.RequestBody.content["application/json"].schema.from_openapi_data_( - payload, - configuration_=self.schema_config - ) - self.api.post(body=body) - -if __name__ == '__main__': - unittest.main() diff --git a/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_request_body_post_uniqueitems_false_validation_request_body/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_request_body_post_uniqueitems_false_validation_request_body/__init__.py index 94ee39560e6..e69de29bb2d 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_request_body_post_uniqueitems_false_validation_request_body/__init__.py +++ b/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_request_body_post_uniqueitems_false_validation_request_body/__init__.py @@ -1,601 +0,0 @@ -# coding: utf-8 - -""" - - - Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator -""" - -import unittest -from unittest.mock import patch - -import urllib3 - -import unit_test_api -from unit_test_api.paths.request_body_post_uniqueitems_false_validation_request_body.post import operation as post # noqa: E501 -from unit_test_api import schemas, api_client -from unit_test_api.configurations import api_configuration, schema_configuration - -from .. import ApiTestMixin - - -class TestPost(ApiTestMixin, unittest.TestCase): - """ - Post unit test stubs - """ - api_config = api_configuration.ApiConfiguration() - schema_config = schema_configuration.SchemaConfiguration() - used_api_client = api_client.ApiClient(configuration=api_config, schema_config=schema_config) - api = post.ApiForPost(api_client=used_api_client) # noqa: E501 - - response_status = 200 - response_body = '' - - def test_non_unique_array_of_integers_is_valid_passes(self): - content_type = 'application/json' - # non-unique array of integers is valid - with patch.object(urllib3.PoolManager, 'request') as mock_request: - payload = ( - [ - 1, - 1, - ] - ) - body = post.request_body.RequestBody.content["application/json"].schema.from_openapi_data_( - payload, - configuration_=self.schema_config - ) - mock_request.return_value = self.response( - self.json_bytes(self.response_body), - status=self.response_status - ) - api_response = self.api.post( - body=body, - content_type=content_type - ) - self.assert_pool_manager_request_called_with( - mock_request, - self.api_config.get_server_url('servers', None) + "/requestBody/postUniqueitemsFalseValidationRequestBody", - method='post'.upper(), - body=self.json_bytes(payload), - content_type=content_type, - ) - - assert isinstance(api_response.response, urllib3.HTTPResponse) - assert isinstance(api_response.body, schemas.Unset) - - def test_unique_array_of_objects_is_valid_passes(self): - content_type = 'application/json' - # unique array of objects is valid - with patch.object(urllib3.PoolManager, 'request') as mock_request: - payload = ( - [ - { - "foo": - "bar", - }, - { - "foo": - "baz", - }, - ] - ) - body = post.request_body.RequestBody.content["application/json"].schema.from_openapi_data_( - payload, - configuration_=self.schema_config - ) - mock_request.return_value = self.response( - self.json_bytes(self.response_body), - status=self.response_status - ) - api_response = self.api.post( - body=body, - content_type=content_type - ) - self.assert_pool_manager_request_called_with( - mock_request, - self.api_config.get_server_url('servers', None) + "/requestBody/postUniqueitemsFalseValidationRequestBody", - method='post'.upper(), - body=self.json_bytes(payload), - content_type=content_type, - ) - - assert isinstance(api_response.response, urllib3.HTTPResponse) - assert isinstance(api_response.body, schemas.Unset) - - def test_non_unique_array_of_nested_objects_is_valid_passes(self): - content_type = 'application/json' - # non-unique array of nested objects is valid - with patch.object(urllib3.PoolManager, 'request') as mock_request: - payload = ( - [ - { - "foo": - { - "bar": - { - "baz": - True, - }, - }, - }, - { - "foo": - { - "bar": - { - "baz": - True, - }, - }, - }, - ] - ) - body = post.request_body.RequestBody.content["application/json"].schema.from_openapi_data_( - payload, - configuration_=self.schema_config - ) - mock_request.return_value = self.response( - self.json_bytes(self.response_body), - status=self.response_status - ) - api_response = self.api.post( - body=body, - content_type=content_type - ) - self.assert_pool_manager_request_called_with( - mock_request, - self.api_config.get_server_url('servers', None) + "/requestBody/postUniqueitemsFalseValidationRequestBody", - method='post'.upper(), - body=self.json_bytes(payload), - content_type=content_type, - ) - - assert isinstance(api_response.response, urllib3.HTTPResponse) - assert isinstance(api_response.body, schemas.Unset) - - def test_non_unique_array_of_objects_is_valid_passes(self): - content_type = 'application/json' - # non-unique array of objects is valid - with patch.object(urllib3.PoolManager, 'request') as mock_request: - payload = ( - [ - { - "foo": - "bar", - }, - { - "foo": - "bar", - }, - ] - ) - body = post.request_body.RequestBody.content["application/json"].schema.from_openapi_data_( - payload, - configuration_=self.schema_config - ) - mock_request.return_value = self.response( - self.json_bytes(self.response_body), - status=self.response_status - ) - api_response = self.api.post( - body=body, - content_type=content_type - ) - self.assert_pool_manager_request_called_with( - mock_request, - self.api_config.get_server_url('servers', None) + "/requestBody/postUniqueitemsFalseValidationRequestBody", - method='post'.upper(), - body=self.json_bytes(payload), - content_type=content_type, - ) - - assert isinstance(api_response.response, urllib3.HTTPResponse) - assert isinstance(api_response.body, schemas.Unset) - - def test_1_and_true_are_unique_passes(self): - content_type = 'application/json' - # 1 and true are unique - with patch.object(urllib3.PoolManager, 'request') as mock_request: - payload = ( - [ - 1, - True, - ] - ) - body = post.request_body.RequestBody.content["application/json"].schema.from_openapi_data_( - payload, - configuration_=self.schema_config - ) - mock_request.return_value = self.response( - self.json_bytes(self.response_body), - status=self.response_status - ) - api_response = self.api.post( - body=body, - content_type=content_type - ) - self.assert_pool_manager_request_called_with( - mock_request, - self.api_config.get_server_url('servers', None) + "/requestBody/postUniqueitemsFalseValidationRequestBody", - method='post'.upper(), - body=self.json_bytes(payload), - content_type=content_type, - ) - - assert isinstance(api_response.response, urllib3.HTTPResponse) - assert isinstance(api_response.body, schemas.Unset) - - def test_unique_array_of_integers_is_valid_passes(self): - content_type = 'application/json' - # unique array of integers is valid - with patch.object(urllib3.PoolManager, 'request') as mock_request: - payload = ( - [ - 1, - 2, - ] - ) - body = post.request_body.RequestBody.content["application/json"].schema.from_openapi_data_( - payload, - configuration_=self.schema_config - ) - mock_request.return_value = self.response( - self.json_bytes(self.response_body), - status=self.response_status - ) - api_response = self.api.post( - body=body, - content_type=content_type - ) - self.assert_pool_manager_request_called_with( - mock_request, - self.api_config.get_server_url('servers', None) + "/requestBody/postUniqueitemsFalseValidationRequestBody", - method='post'.upper(), - body=self.json_bytes(payload), - content_type=content_type, - ) - - assert isinstance(api_response.response, urllib3.HTTPResponse) - assert isinstance(api_response.body, schemas.Unset) - - def test_non_unique_array_of_arrays_is_valid_passes(self): - content_type = 'application/json' - # non-unique array of arrays is valid - with patch.object(urllib3.PoolManager, 'request') as mock_request: - payload = ( - [ - [ - "foo", - ], - [ - "foo", - ], - ] - ) - body = post.request_body.RequestBody.content["application/json"].schema.from_openapi_data_( - payload, - configuration_=self.schema_config - ) - mock_request.return_value = self.response( - self.json_bytes(self.response_body), - status=self.response_status - ) - api_response = self.api.post( - body=body, - content_type=content_type - ) - self.assert_pool_manager_request_called_with( - mock_request, - self.api_config.get_server_url('servers', None) + "/requestBody/postUniqueitemsFalseValidationRequestBody", - method='post'.upper(), - body=self.json_bytes(payload), - content_type=content_type, - ) - - assert isinstance(api_response.response, urllib3.HTTPResponse) - assert isinstance(api_response.body, schemas.Unset) - - def test_numbers_are_unique_if_mathematically_unequal_passes(self): - content_type = 'application/json' - # numbers are unique if mathematically unequal - with patch.object(urllib3.PoolManager, 'request') as mock_request: - payload = ( - [ - 1.0, - 1.0, - 1, - ] - ) - body = post.request_body.RequestBody.content["application/json"].schema.from_openapi_data_( - payload, - configuration_=self.schema_config - ) - mock_request.return_value = self.response( - self.json_bytes(self.response_body), - status=self.response_status - ) - api_response = self.api.post( - body=body, - content_type=content_type - ) - self.assert_pool_manager_request_called_with( - mock_request, - self.api_config.get_server_url('servers', None) + "/requestBody/postUniqueitemsFalseValidationRequestBody", - method='post'.upper(), - body=self.json_bytes(payload), - content_type=content_type, - ) - - assert isinstance(api_response.response, urllib3.HTTPResponse) - assert isinstance(api_response.body, schemas.Unset) - - def test_false_is_not_equal_to_zero_passes(self): - content_type = 'application/json' - # false is not equal to zero - with patch.object(urllib3.PoolManager, 'request') as mock_request: - payload = ( - [ - 0, - False, - ] - ) - body = post.request_body.RequestBody.content["application/json"].schema.from_openapi_data_( - payload, - configuration_=self.schema_config - ) - mock_request.return_value = self.response( - self.json_bytes(self.response_body), - status=self.response_status - ) - api_response = self.api.post( - body=body, - content_type=content_type - ) - self.assert_pool_manager_request_called_with( - mock_request, - self.api_config.get_server_url('servers', None) + "/requestBody/postUniqueitemsFalseValidationRequestBody", - method='post'.upper(), - body=self.json_bytes(payload), - content_type=content_type, - ) - - assert isinstance(api_response.response, urllib3.HTTPResponse) - assert isinstance(api_response.body, schemas.Unset) - - def test_unique_array_of_nested_objects_is_valid_passes(self): - content_type = 'application/json' - # unique array of nested objects is valid - with patch.object(urllib3.PoolManager, 'request') as mock_request: - payload = ( - [ - { - "foo": - { - "bar": - { - "baz": - True, - }, - }, - }, - { - "foo": - { - "bar": - { - "baz": - False, - }, - }, - }, - ] - ) - body = post.request_body.RequestBody.content["application/json"].schema.from_openapi_data_( - payload, - configuration_=self.schema_config - ) - mock_request.return_value = self.response( - self.json_bytes(self.response_body), - status=self.response_status - ) - api_response = self.api.post( - body=body, - content_type=content_type - ) - self.assert_pool_manager_request_called_with( - mock_request, - self.api_config.get_server_url('servers', None) + "/requestBody/postUniqueitemsFalseValidationRequestBody", - method='post'.upper(), - body=self.json_bytes(payload), - content_type=content_type, - ) - - assert isinstance(api_response.response, urllib3.HTTPResponse) - assert isinstance(api_response.body, schemas.Unset) - - def test_0_and_false_are_unique_passes(self): - content_type = 'application/json' - # 0 and false are unique - with patch.object(urllib3.PoolManager, 'request') as mock_request: - payload = ( - [ - 0, - False, - ] - ) - body = post.request_body.RequestBody.content["application/json"].schema.from_openapi_data_( - payload, - configuration_=self.schema_config - ) - mock_request.return_value = self.response( - self.json_bytes(self.response_body), - status=self.response_status - ) - api_response = self.api.post( - body=body, - content_type=content_type - ) - self.assert_pool_manager_request_called_with( - mock_request, - self.api_config.get_server_url('servers', None) + "/requestBody/postUniqueitemsFalseValidationRequestBody", - method='post'.upper(), - body=self.json_bytes(payload), - content_type=content_type, - ) - - assert isinstance(api_response.response, urllib3.HTTPResponse) - assert isinstance(api_response.body, schemas.Unset) - - def test_unique_array_of_arrays_is_valid_passes(self): - content_type = 'application/json' - # unique array of arrays is valid - with patch.object(urllib3.PoolManager, 'request') as mock_request: - payload = ( - [ - [ - "foo", - ], - [ - "bar", - ], - ] - ) - body = post.request_body.RequestBody.content["application/json"].schema.from_openapi_data_( - payload, - configuration_=self.schema_config - ) - mock_request.return_value = self.response( - self.json_bytes(self.response_body), - status=self.response_status - ) - api_response = self.api.post( - body=body, - content_type=content_type - ) - self.assert_pool_manager_request_called_with( - mock_request, - self.api_config.get_server_url('servers', None) + "/requestBody/postUniqueitemsFalseValidationRequestBody", - method='post'.upper(), - body=self.json_bytes(payload), - content_type=content_type, - ) - - assert isinstance(api_response.response, urllib3.HTTPResponse) - assert isinstance(api_response.body, schemas.Unset) - - def test_true_is_not_equal_to_one_passes(self): - content_type = 'application/json' - # true is not equal to one - with patch.object(urllib3.PoolManager, 'request') as mock_request: - payload = ( - [ - 1, - True, - ] - ) - body = post.request_body.RequestBody.content["application/json"].schema.from_openapi_data_( - payload, - configuration_=self.schema_config - ) - mock_request.return_value = self.response( - self.json_bytes(self.response_body), - status=self.response_status - ) - api_response = self.api.post( - body=body, - content_type=content_type - ) - self.assert_pool_manager_request_called_with( - mock_request, - self.api_config.get_server_url('servers', None) + "/requestBody/postUniqueitemsFalseValidationRequestBody", - method='post'.upper(), - body=self.json_bytes(payload), - content_type=content_type, - ) - - assert isinstance(api_response.response, urllib3.HTTPResponse) - assert isinstance(api_response.body, schemas.Unset) - - def test_non_unique_heterogeneous_types_are_valid_passes(self): - content_type = 'application/json' - # non-unique heterogeneous types are valid - with patch.object(urllib3.PoolManager, 'request') as mock_request: - payload = ( - [ - { - }, - [ - 1, - ], - True, - None, - { - }, - 1, - ] - ) - body = post.request_body.RequestBody.content["application/json"].schema.from_openapi_data_( - payload, - configuration_=self.schema_config - ) - mock_request.return_value = self.response( - self.json_bytes(self.response_body), - status=self.response_status - ) - api_response = self.api.post( - body=body, - content_type=content_type - ) - self.assert_pool_manager_request_called_with( - mock_request, - self.api_config.get_server_url('servers', None) + "/requestBody/postUniqueitemsFalseValidationRequestBody", - method='post'.upper(), - body=self.json_bytes(payload), - content_type=content_type, - ) - - assert isinstance(api_response.response, urllib3.HTTPResponse) - assert isinstance(api_response.body, schemas.Unset) - - def test_unique_heterogeneous_types_are_valid_passes(self): - content_type = 'application/json' - # unique heterogeneous types are valid - with patch.object(urllib3.PoolManager, 'request') as mock_request: - payload = ( - [ - { - }, - [ - 1, - ], - True, - None, - 1, - ] - ) - body = post.request_body.RequestBody.content["application/json"].schema.from_openapi_data_( - payload, - configuration_=self.schema_config - ) - mock_request.return_value = self.response( - self.json_bytes(self.response_body), - status=self.response_status - ) - api_response = self.api.post( - body=body, - content_type=content_type - ) - self.assert_pool_manager_request_called_with( - mock_request, - self.api_config.get_server_url('servers', None) + "/requestBody/postUniqueitemsFalseValidationRequestBody", - method='post'.upper(), - body=self.json_bytes(payload), - content_type=content_type, - ) - - assert isinstance(api_response.response, urllib3.HTTPResponse) - assert isinstance(api_response.body, schemas.Unset) - -if __name__ == '__main__': - unittest.main() diff --git a/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_request_body_post_uniqueitems_validation_request_body/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_request_body_post_uniqueitems_validation_request_body/__init__.py index a468e5ea03d..e69de29bb2d 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_request_body_post_uniqueitems_validation_request_body/__init__.py +++ b/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_request_body_post_uniqueitems_validation_request_body/__init__.py @@ -1,842 +0,0 @@ -# coding: utf-8 - -""" - - - Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator -""" - -import unittest -from unittest.mock import patch - -import urllib3 - -import unit_test_api -from unit_test_api.paths.request_body_post_uniqueitems_validation_request_body.post import operation as post # noqa: E501 -from unit_test_api import schemas, api_client -from unit_test_api.configurations import api_configuration, schema_configuration - -from .. import ApiTestMixin - - -class TestPost(ApiTestMixin, unittest.TestCase): - """ - Post unit test stubs - """ - api_config = api_configuration.ApiConfiguration() - schema_config = schema_configuration.SchemaConfiguration() - used_api_client = api_client.ApiClient(configuration=api_config, schema_config=schema_config) - api = post.ApiForPost(api_client=used_api_client) # noqa: E501 - - response_status = 200 - response_body = '' - - def test_unique_array_of_objects_is_valid_passes(self): - content_type = 'application/json' - # unique array of objects is valid - with patch.object(urllib3.PoolManager, 'request') as mock_request: - payload = ( - [ - { - "foo": - "bar", - }, - { - "foo": - "baz", - }, - ] - ) - body = post.request_body.RequestBody.content["application/json"].schema.from_openapi_data_( - payload, - configuration_=self.schema_config - ) - mock_request.return_value = self.response( - self.json_bytes(self.response_body), - status=self.response_status - ) - api_response = self.api.post( - body=body, - content_type=content_type - ) - self.assert_pool_manager_request_called_with( - mock_request, - self.api_config.get_server_url('servers', None) + "/requestBody/postUniqueitemsValidationRequestBody", - method='post'.upper(), - body=self.json_bytes(payload), - content_type=content_type, - ) - - assert isinstance(api_response.response, urllib3.HTTPResponse) - assert isinstance(api_response.body, schemas.Unset) - - def test_a_true_and_a1_are_unique_passes(self): - content_type = 'application/json' - # {"a": true} and {"a": 1} are unique - with patch.object(urllib3.PoolManager, 'request') as mock_request: - payload = ( - [ - { - "a": - True, - }, - { - "a": - 1, - }, - ] - ) - body = post.request_body.RequestBody.content["application/json"].schema.from_openapi_data_( - payload, - configuration_=self.schema_config - ) - mock_request.return_value = self.response( - self.json_bytes(self.response_body), - status=self.response_status - ) - api_response = self.api.post( - body=body, - content_type=content_type - ) - self.assert_pool_manager_request_called_with( - mock_request, - self.api_config.get_server_url('servers', None) + "/requestBody/postUniqueitemsValidationRequestBody", - method='post'.upper(), - body=self.json_bytes(payload), - content_type=content_type, - ) - - assert isinstance(api_response.response, urllib3.HTTPResponse) - assert isinstance(api_response.body, schemas.Unset) - - def test_non_unique_heterogeneous_types_are_invalid_fails(self): - content_type = 'application/json' - # non-unique heterogeneous types are invalid - with patch.object(urllib3.PoolManager, 'request') as mock_request: - payload = ( - [ - { - }, - [ - 1, - ], - True, - None, - { - }, - 1, - ] - ) - with self.assertRaises((unit_test_api.ApiValueError, unit_test_api.ApiTypeError)): - body = post.request_body.RequestBody.content["application/json"].schema.from_openapi_data_( - payload, - configuration_=self.schema_config - ) - self.api.post(body=body) - - def test_nested0_and_false_are_unique_passes(self): - content_type = 'application/json' - # nested [0] and [false] are unique - with patch.object(urllib3.PoolManager, 'request') as mock_request: - payload = ( - [ - [ - [ - 0, - ], - "foo", - ], - [ - [ - False, - ], - "foo", - ], - ] - ) - body = post.request_body.RequestBody.content["application/json"].schema.from_openapi_data_( - payload, - configuration_=self.schema_config - ) - mock_request.return_value = self.response( - self.json_bytes(self.response_body), - status=self.response_status - ) - api_response = self.api.post( - body=body, - content_type=content_type - ) - self.assert_pool_manager_request_called_with( - mock_request, - self.api_config.get_server_url('servers', None) + "/requestBody/postUniqueitemsValidationRequestBody", - method='post'.upper(), - body=self.json_bytes(payload), - content_type=content_type, - ) - - assert isinstance(api_response.response, urllib3.HTTPResponse) - assert isinstance(api_response.body, schemas.Unset) - - def test_a_false_and_a0_are_unique_passes(self): - content_type = 'application/json' - # {"a": false} and {"a": 0} are unique - with patch.object(urllib3.PoolManager, 'request') as mock_request: - payload = ( - [ - { - "a": - False, - }, - { - "a": - 0, - }, - ] - ) - body = post.request_body.RequestBody.content["application/json"].schema.from_openapi_data_( - payload, - configuration_=self.schema_config - ) - mock_request.return_value = self.response( - self.json_bytes(self.response_body), - status=self.response_status - ) - api_response = self.api.post( - body=body, - content_type=content_type - ) - self.assert_pool_manager_request_called_with( - mock_request, - self.api_config.get_server_url('servers', None) + "/requestBody/postUniqueitemsValidationRequestBody", - method='post'.upper(), - body=self.json_bytes(payload), - content_type=content_type, - ) - - assert isinstance(api_response.response, urllib3.HTTPResponse) - assert isinstance(api_response.body, schemas.Unset) - - def test_numbers_are_unique_if_mathematically_unequal_fails(self): - content_type = 'application/json' - # numbers are unique if mathematically unequal - with patch.object(urllib3.PoolManager, 'request') as mock_request: - payload = ( - [ - 1.0, - 1.0, - 1, - ] - ) - with self.assertRaises((unit_test_api.ApiValueError, unit_test_api.ApiTypeError)): - body = post.request_body.RequestBody.content["application/json"].schema.from_openapi_data_( - payload, - configuration_=self.schema_config - ) - self.api.post(body=body) - - def test_false_is_not_equal_to_zero_passes(self): - content_type = 'application/json' - # false is not equal to zero - with patch.object(urllib3.PoolManager, 'request') as mock_request: - payload = ( - [ - 0, - False, - ] - ) - body = post.request_body.RequestBody.content["application/json"].schema.from_openapi_data_( - payload, - configuration_=self.schema_config - ) - mock_request.return_value = self.response( - self.json_bytes(self.response_body), - status=self.response_status - ) - api_response = self.api.post( - body=body, - content_type=content_type - ) - self.assert_pool_manager_request_called_with( - mock_request, - self.api_config.get_server_url('servers', None) + "/requestBody/postUniqueitemsValidationRequestBody", - method='post'.upper(), - body=self.json_bytes(payload), - content_type=content_type, - ) - - assert isinstance(api_response.response, urllib3.HTTPResponse) - assert isinstance(api_response.body, schemas.Unset) - - def test_0_and_false_are_unique_passes(self): - content_type = 'application/json' - # [0] and [false] are unique - with patch.object(urllib3.PoolManager, 'request') as mock_request: - payload = ( - [ - [ - 0, - ], - [ - False, - ], - ] - ) - body = post.request_body.RequestBody.content["application/json"].schema.from_openapi_data_( - payload, - configuration_=self.schema_config - ) - mock_request.return_value = self.response( - self.json_bytes(self.response_body), - status=self.response_status - ) - api_response = self.api.post( - body=body, - content_type=content_type - ) - self.assert_pool_manager_request_called_with( - mock_request, - self.api_config.get_server_url('servers', None) + "/requestBody/postUniqueitemsValidationRequestBody", - method='post'.upper(), - body=self.json_bytes(payload), - content_type=content_type, - ) - - assert isinstance(api_response.response, urllib3.HTTPResponse) - assert isinstance(api_response.body, schemas.Unset) - - def test_unique_array_of_arrays_is_valid_passes(self): - content_type = 'application/json' - # unique array of arrays is valid - with patch.object(urllib3.PoolManager, 'request') as mock_request: - payload = ( - [ - [ - "foo", - ], - [ - "bar", - ], - ] - ) - body = post.request_body.RequestBody.content["application/json"].schema.from_openapi_data_( - payload, - configuration_=self.schema_config - ) - mock_request.return_value = self.response( - self.json_bytes(self.response_body), - status=self.response_status - ) - api_response = self.api.post( - body=body, - content_type=content_type - ) - self.assert_pool_manager_request_called_with( - mock_request, - self.api_config.get_server_url('servers', None) + "/requestBody/postUniqueitemsValidationRequestBody", - method='post'.upper(), - body=self.json_bytes(payload), - content_type=content_type, - ) - - assert isinstance(api_response.response, urllib3.HTTPResponse) - assert isinstance(api_response.body, schemas.Unset) - - def test_non_unique_array_of_nested_objects_is_invalid_fails(self): - content_type = 'application/json' - # non-unique array of nested objects is invalid - with patch.object(urllib3.PoolManager, 'request') as mock_request: - payload = ( - [ - { - "foo": - { - "bar": - { - "baz": - True, - }, - }, - }, - { - "foo": - { - "bar": - { - "baz": - True, - }, - }, - }, - ] - ) - with self.assertRaises((unit_test_api.ApiValueError, unit_test_api.ApiTypeError)): - body = post.request_body.RequestBody.content["application/json"].schema.from_openapi_data_( - payload, - configuration_=self.schema_config - ) - self.api.post(body=body) - - def test_non_unique_array_of_more_than_two_integers_is_invalid_fails(self): - content_type = 'application/json' - # non-unique array of more than two integers is invalid - with patch.object(urllib3.PoolManager, 'request') as mock_request: - payload = ( - [ - 1, - 2, - 1, - ] - ) - with self.assertRaises((unit_test_api.ApiValueError, unit_test_api.ApiTypeError)): - body = post.request_body.RequestBody.content["application/json"].schema.from_openapi_data_( - payload, - configuration_=self.schema_config - ) - self.api.post(body=body) - - def test_true_is_not_equal_to_one_passes(self): - content_type = 'application/json' - # true is not equal to one - with patch.object(urllib3.PoolManager, 'request') as mock_request: - payload = ( - [ - 1, - True, - ] - ) - body = post.request_body.RequestBody.content["application/json"].schema.from_openapi_data_( - payload, - configuration_=self.schema_config - ) - mock_request.return_value = self.response( - self.json_bytes(self.response_body), - status=self.response_status - ) - api_response = self.api.post( - body=body, - content_type=content_type - ) - self.assert_pool_manager_request_called_with( - mock_request, - self.api_config.get_server_url('servers', None) + "/requestBody/postUniqueitemsValidationRequestBody", - method='post'.upper(), - body=self.json_bytes(payload), - content_type=content_type, - ) - - assert isinstance(api_response.response, urllib3.HTTPResponse) - assert isinstance(api_response.body, schemas.Unset) - - def test_objects_are_non_unique_despite_key_order_fails(self): - content_type = 'application/json' - # objects are non-unique despite key order - with patch.object(urllib3.PoolManager, 'request') as mock_request: - payload = ( - [ - { - "a": - 1, - "b": - 2, - }, - { - "b": - 2, - "a": - 1, - }, - ] - ) - with self.assertRaises((unit_test_api.ApiValueError, unit_test_api.ApiTypeError)): - body = post.request_body.RequestBody.content["application/json"].schema.from_openapi_data_( - payload, - configuration_=self.schema_config - ) - self.api.post(body=body) - - def test_unique_array_of_strings_is_valid_passes(self): - content_type = 'application/json' - # unique array of strings is valid - with patch.object(urllib3.PoolManager, 'request') as mock_request: - payload = ( - [ - "foo", - "bar", - "baz", - ] - ) - body = post.request_body.RequestBody.content["application/json"].schema.from_openapi_data_( - payload, - configuration_=self.schema_config - ) - mock_request.return_value = self.response( - self.json_bytes(self.response_body), - status=self.response_status - ) - api_response = self.api.post( - body=body, - content_type=content_type - ) - self.assert_pool_manager_request_called_with( - mock_request, - self.api_config.get_server_url('servers', None) + "/requestBody/postUniqueitemsValidationRequestBody", - method='post'.upper(), - body=self.json_bytes(payload), - content_type=content_type, - ) - - assert isinstance(api_response.response, urllib3.HTTPResponse) - assert isinstance(api_response.body, schemas.Unset) - - def test_1_and_true_are_unique_passes(self): - content_type = 'application/json' - # [1] and [true] are unique - with patch.object(urllib3.PoolManager, 'request') as mock_request: - payload = ( - [ - [ - 1, - ], - [ - True, - ], - ] - ) - body = post.request_body.RequestBody.content["application/json"].schema.from_openapi_data_( - payload, - configuration_=self.schema_config - ) - mock_request.return_value = self.response( - self.json_bytes(self.response_body), - status=self.response_status - ) - api_response = self.api.post( - body=body, - content_type=content_type - ) - self.assert_pool_manager_request_called_with( - mock_request, - self.api_config.get_server_url('servers', None) + "/requestBody/postUniqueitemsValidationRequestBody", - method='post'.upper(), - body=self.json_bytes(payload), - content_type=content_type, - ) - - assert isinstance(api_response.response, urllib3.HTTPResponse) - assert isinstance(api_response.body, schemas.Unset) - - def test_different_objects_are_unique_passes(self): - content_type = 'application/json' - # different objects are unique - with patch.object(urllib3.PoolManager, 'request') as mock_request: - payload = ( - [ - { - "a": - 1, - "b": - 2, - }, - { - "a": - 2, - "b": - 1, - }, - ] - ) - body = post.request_body.RequestBody.content["application/json"].schema.from_openapi_data_( - payload, - configuration_=self.schema_config - ) - mock_request.return_value = self.response( - self.json_bytes(self.response_body), - status=self.response_status - ) - api_response = self.api.post( - body=body, - content_type=content_type - ) - self.assert_pool_manager_request_called_with( - mock_request, - self.api_config.get_server_url('servers', None) + "/requestBody/postUniqueitemsValidationRequestBody", - method='post'.upper(), - body=self.json_bytes(payload), - content_type=content_type, - ) - - assert isinstance(api_response.response, urllib3.HTTPResponse) - assert isinstance(api_response.body, schemas.Unset) - - def test_unique_array_of_integers_is_valid_passes(self): - content_type = 'application/json' - # unique array of integers is valid - with patch.object(urllib3.PoolManager, 'request') as mock_request: - payload = ( - [ - 1, - 2, - ] - ) - body = post.request_body.RequestBody.content["application/json"].schema.from_openapi_data_( - payload, - configuration_=self.schema_config - ) - mock_request.return_value = self.response( - self.json_bytes(self.response_body), - status=self.response_status - ) - api_response = self.api.post( - body=body, - content_type=content_type - ) - self.assert_pool_manager_request_called_with( - mock_request, - self.api_config.get_server_url('servers', None) + "/requestBody/postUniqueitemsValidationRequestBody", - method='post'.upper(), - body=self.json_bytes(payload), - content_type=content_type, - ) - - assert isinstance(api_response.response, urllib3.HTTPResponse) - assert isinstance(api_response.body, schemas.Unset) - - def test_non_unique_array_of_more_than_two_arrays_is_invalid_fails(self): - content_type = 'application/json' - # non-unique array of more than two arrays is invalid - with patch.object(urllib3.PoolManager, 'request') as mock_request: - payload = ( - [ - [ - "foo", - ], - [ - "bar", - ], - [ - "foo", - ], - ] - ) - with self.assertRaises((unit_test_api.ApiValueError, unit_test_api.ApiTypeError)): - body = post.request_body.RequestBody.content["application/json"].schema.from_openapi_data_( - payload, - configuration_=self.schema_config - ) - self.api.post(body=body) - - def test_non_unique_array_of_objects_is_invalid_fails(self): - content_type = 'application/json' - # non-unique array of objects is invalid - with patch.object(urllib3.PoolManager, 'request') as mock_request: - payload = ( - [ - { - "foo": - "bar", - }, - { - "foo": - "bar", - }, - ] - ) - with self.assertRaises((unit_test_api.ApiValueError, unit_test_api.ApiTypeError)): - body = post.request_body.RequestBody.content["application/json"].schema.from_openapi_data_( - payload, - configuration_=self.schema_config - ) - self.api.post(body=body) - - def test_unique_array_of_nested_objects_is_valid_passes(self): - content_type = 'application/json' - # unique array of nested objects is valid - with patch.object(urllib3.PoolManager, 'request') as mock_request: - payload = ( - [ - { - "foo": - { - "bar": - { - "baz": - True, - }, - }, - }, - { - "foo": - { - "bar": - { - "baz": - False, - }, - }, - }, - ] - ) - body = post.request_body.RequestBody.content["application/json"].schema.from_openapi_data_( - payload, - configuration_=self.schema_config - ) - mock_request.return_value = self.response( - self.json_bytes(self.response_body), - status=self.response_status - ) - api_response = self.api.post( - body=body, - content_type=content_type - ) - self.assert_pool_manager_request_called_with( - mock_request, - self.api_config.get_server_url('servers', None) + "/requestBody/postUniqueitemsValidationRequestBody", - method='post'.upper(), - body=self.json_bytes(payload), - content_type=content_type, - ) - - assert isinstance(api_response.response, urllib3.HTTPResponse) - assert isinstance(api_response.body, schemas.Unset) - - def test_non_unique_array_of_arrays_is_invalid_fails(self): - content_type = 'application/json' - # non-unique array of arrays is invalid - with patch.object(urllib3.PoolManager, 'request') as mock_request: - payload = ( - [ - [ - "foo", - ], - [ - "foo", - ], - ] - ) - with self.assertRaises((unit_test_api.ApiValueError, unit_test_api.ApiTypeError)): - body = post.request_body.RequestBody.content["application/json"].schema.from_openapi_data_( - payload, - configuration_=self.schema_config - ) - self.api.post(body=body) - - def test_non_unique_array_of_strings_is_invalid_fails(self): - content_type = 'application/json' - # non-unique array of strings is invalid - with patch.object(urllib3.PoolManager, 'request') as mock_request: - payload = ( - [ - "foo", - "bar", - "foo", - ] - ) - with self.assertRaises((unit_test_api.ApiValueError, unit_test_api.ApiTypeError)): - body = post.request_body.RequestBody.content["application/json"].schema.from_openapi_data_( - payload, - configuration_=self.schema_config - ) - self.api.post(body=body) - - def test_nested1_and_true_are_unique_passes(self): - content_type = 'application/json' - # nested [1] and [true] are unique - with patch.object(urllib3.PoolManager, 'request') as mock_request: - payload = ( - [ - [ - [ - 1, - ], - "foo", - ], - [ - [ - True, - ], - "foo", - ], - ] - ) - body = post.request_body.RequestBody.content["application/json"].schema.from_openapi_data_( - payload, - configuration_=self.schema_config - ) - mock_request.return_value = self.response( - self.json_bytes(self.response_body), - status=self.response_status - ) - api_response = self.api.post( - body=body, - content_type=content_type - ) - self.assert_pool_manager_request_called_with( - mock_request, - self.api_config.get_server_url('servers', None) + "/requestBody/postUniqueitemsValidationRequestBody", - method='post'.upper(), - body=self.json_bytes(payload), - content_type=content_type, - ) - - assert isinstance(api_response.response, urllib3.HTTPResponse) - assert isinstance(api_response.body, schemas.Unset) - - def test_unique_heterogeneous_types_are_valid_passes(self): - content_type = 'application/json' - # unique heterogeneous types are valid - with patch.object(urllib3.PoolManager, 'request') as mock_request: - payload = ( - [ - { - }, - [ - 1, - ], - True, - None, - 1, - "{}", - ] - ) - body = post.request_body.RequestBody.content["application/json"].schema.from_openapi_data_( - payload, - configuration_=self.schema_config - ) - mock_request.return_value = self.response( - self.json_bytes(self.response_body), - status=self.response_status - ) - api_response = self.api.post( - body=body, - content_type=content_type - ) - self.assert_pool_manager_request_called_with( - mock_request, - self.api_config.get_server_url('servers', None) + "/requestBody/postUniqueitemsValidationRequestBody", - method='post'.upper(), - body=self.json_bytes(payload), - content_type=content_type, - ) - - assert isinstance(api_response.response, urllib3.HTTPResponse) - assert isinstance(api_response.body, schemas.Unset) - - def test_non_unique_array_of_integers_is_invalid_fails(self): - content_type = 'application/json' - # non-unique array of integers is invalid - with patch.object(urllib3.PoolManager, 'request') as mock_request: - payload = ( - [ - 1, - 1, - ] - ) - with self.assertRaises((unit_test_api.ApiValueError, unit_test_api.ApiTypeError)): - body = post.request_body.RequestBody.content["application/json"].schema.from_openapi_data_( - payload, - configuration_=self.schema_config - ) - self.api.post(body=body) - -if __name__ == '__main__': - unittest.main() diff --git a/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_request_body_post_uri_format_request_body/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_request_body_post_uri_format_request_body/__init__.py index 58d93f81ec1..e69de29bb2d 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_request_body_post_uri_format_request_body/__init__.py +++ b/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_request_body_post_uri_format_request_body/__init__.py @@ -1,217 +0,0 @@ -# coding: utf-8 - -""" - - - Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator -""" - -import unittest -from unittest.mock import patch - -import urllib3 - -import unit_test_api -from unit_test_api.paths.request_body_post_uri_format_request_body.post import operation as post # noqa: E501 -from unit_test_api import schemas, api_client -from unit_test_api.configurations import api_configuration, schema_configuration - -from .. import ApiTestMixin - - -class TestPost(ApiTestMixin, unittest.TestCase): - """ - Post unit test stubs - """ - api_config = api_configuration.ApiConfiguration() - schema_config = schema_configuration.SchemaConfiguration() - used_api_client = api_client.ApiClient(configuration=api_config, schema_config=schema_config) - api = post.ApiForPost(api_client=used_api_client) # noqa: E501 - - response_status = 200 - response_body = '' - - def test_all_string_formats_ignore_objects_passes(self): - content_type = 'application/json' - # all string formats ignore objects - with patch.object(urllib3.PoolManager, 'request') as mock_request: - payload = ( - { - } - ) - body = post.request_body.RequestBody.content["application/json"].schema.from_openapi_data_( - payload, - configuration_=self.schema_config - ) - mock_request.return_value = self.response( - self.json_bytes(self.response_body), - status=self.response_status - ) - api_response = self.api.post( - body=body, - content_type=content_type - ) - self.assert_pool_manager_request_called_with( - mock_request, - self.api_config.get_server_url('servers', None) + "/requestBody/postUriFormatRequestBody", - method='post'.upper(), - body=self.json_bytes(payload), - content_type=content_type, - ) - - assert isinstance(api_response.response, urllib3.HTTPResponse) - assert isinstance(api_response.body, schemas.Unset) - - def test_all_string_formats_ignore_booleans_passes(self): - content_type = 'application/json' - # all string formats ignore booleans - with patch.object(urllib3.PoolManager, 'request') as mock_request: - payload = ( - False - ) - body = post.request_body.RequestBody.content["application/json"].schema.from_openapi_data_( - payload, - configuration_=self.schema_config - ) - mock_request.return_value = self.response( - self.json_bytes(self.response_body), - status=self.response_status - ) - api_response = self.api.post( - body=body, - content_type=content_type - ) - self.assert_pool_manager_request_called_with( - mock_request, - self.api_config.get_server_url('servers', None) + "/requestBody/postUriFormatRequestBody", - method='post'.upper(), - body=self.json_bytes(payload), - content_type=content_type, - ) - - assert isinstance(api_response.response, urllib3.HTTPResponse) - assert isinstance(api_response.body, schemas.Unset) - - def test_all_string_formats_ignore_integers_passes(self): - content_type = 'application/json' - # all string formats ignore integers - with patch.object(urllib3.PoolManager, 'request') as mock_request: - payload = ( - 12 - ) - body = post.request_body.RequestBody.content["application/json"].schema.from_openapi_data_( - payload, - configuration_=self.schema_config - ) - mock_request.return_value = self.response( - self.json_bytes(self.response_body), - status=self.response_status - ) - api_response = self.api.post( - body=body, - content_type=content_type - ) - self.assert_pool_manager_request_called_with( - mock_request, - self.api_config.get_server_url('servers', None) + "/requestBody/postUriFormatRequestBody", - method='post'.upper(), - body=self.json_bytes(payload), - content_type=content_type, - ) - - assert isinstance(api_response.response, urllib3.HTTPResponse) - assert isinstance(api_response.body, schemas.Unset) - - def test_all_string_formats_ignore_floats_passes(self): - content_type = 'application/json' - # all string formats ignore floats - with patch.object(urllib3.PoolManager, 'request') as mock_request: - payload = ( - 13.7 - ) - body = post.request_body.RequestBody.content["application/json"].schema.from_openapi_data_( - payload, - configuration_=self.schema_config - ) - mock_request.return_value = self.response( - self.json_bytes(self.response_body), - status=self.response_status - ) - api_response = self.api.post( - body=body, - content_type=content_type - ) - self.assert_pool_manager_request_called_with( - mock_request, - self.api_config.get_server_url('servers', None) + "/requestBody/postUriFormatRequestBody", - method='post'.upper(), - body=self.json_bytes(payload), - content_type=content_type, - ) - - assert isinstance(api_response.response, urllib3.HTTPResponse) - assert isinstance(api_response.body, schemas.Unset) - - def test_all_string_formats_ignore_arrays_passes(self): - content_type = 'application/json' - # all string formats ignore arrays - with patch.object(urllib3.PoolManager, 'request') as mock_request: - payload = ( - [ - ] - ) - body = post.request_body.RequestBody.content["application/json"].schema.from_openapi_data_( - payload, - configuration_=self.schema_config - ) - mock_request.return_value = self.response( - self.json_bytes(self.response_body), - status=self.response_status - ) - api_response = self.api.post( - body=body, - content_type=content_type - ) - self.assert_pool_manager_request_called_with( - mock_request, - self.api_config.get_server_url('servers', None) + "/requestBody/postUriFormatRequestBody", - method='post'.upper(), - body=self.json_bytes(payload), - content_type=content_type, - ) - - assert isinstance(api_response.response, urllib3.HTTPResponse) - assert isinstance(api_response.body, schemas.Unset) - - def test_all_string_formats_ignore_nulls_passes(self): - content_type = 'application/json' - # all string formats ignore nulls - with patch.object(urllib3.PoolManager, 'request') as mock_request: - payload = ( - None - ) - body = post.request_body.RequestBody.content["application/json"].schema.from_openapi_data_( - payload, - configuration_=self.schema_config - ) - mock_request.return_value = self.response( - self.json_bytes(self.response_body), - status=self.response_status - ) - api_response = self.api.post( - body=body, - content_type=content_type - ) - self.assert_pool_manager_request_called_with( - mock_request, - self.api_config.get_server_url('servers', None) + "/requestBody/postUriFormatRequestBody", - method='post'.upper(), - body=self.json_bytes(payload), - content_type=content_type, - ) - - assert isinstance(api_response.response, urllib3.HTTPResponse) - assert isinstance(api_response.body, schemas.Unset) - -if __name__ == '__main__': - unittest.main() diff --git a/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_request_body_post_uri_reference_format_request_body/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_request_body_post_uri_reference_format_request_body/__init__.py index b2b2eb2ef6d..e69de29bb2d 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_request_body_post_uri_reference_format_request_body/__init__.py +++ b/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_request_body_post_uri_reference_format_request_body/__init__.py @@ -1,217 +0,0 @@ -# coding: utf-8 - -""" - - - Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator -""" - -import unittest -from unittest.mock import patch - -import urllib3 - -import unit_test_api -from unit_test_api.paths.request_body_post_uri_reference_format_request_body.post import operation as post # noqa: E501 -from unit_test_api import schemas, api_client -from unit_test_api.configurations import api_configuration, schema_configuration - -from .. import ApiTestMixin - - -class TestPost(ApiTestMixin, unittest.TestCase): - """ - Post unit test stubs - """ - api_config = api_configuration.ApiConfiguration() - schema_config = schema_configuration.SchemaConfiguration() - used_api_client = api_client.ApiClient(configuration=api_config, schema_config=schema_config) - api = post.ApiForPost(api_client=used_api_client) # noqa: E501 - - response_status = 200 - response_body = '' - - def test_all_string_formats_ignore_objects_passes(self): - content_type = 'application/json' - # all string formats ignore objects - with patch.object(urllib3.PoolManager, 'request') as mock_request: - payload = ( - { - } - ) - body = post.request_body.RequestBody.content["application/json"].schema.from_openapi_data_( - payload, - configuration_=self.schema_config - ) - mock_request.return_value = self.response( - self.json_bytes(self.response_body), - status=self.response_status - ) - api_response = self.api.post( - body=body, - content_type=content_type - ) - self.assert_pool_manager_request_called_with( - mock_request, - self.api_config.get_server_url('servers', None) + "/requestBody/postUriReferenceFormatRequestBody", - method='post'.upper(), - body=self.json_bytes(payload), - content_type=content_type, - ) - - assert isinstance(api_response.response, urllib3.HTTPResponse) - assert isinstance(api_response.body, schemas.Unset) - - def test_all_string_formats_ignore_booleans_passes(self): - content_type = 'application/json' - # all string formats ignore booleans - with patch.object(urllib3.PoolManager, 'request') as mock_request: - payload = ( - False - ) - body = post.request_body.RequestBody.content["application/json"].schema.from_openapi_data_( - payload, - configuration_=self.schema_config - ) - mock_request.return_value = self.response( - self.json_bytes(self.response_body), - status=self.response_status - ) - api_response = self.api.post( - body=body, - content_type=content_type - ) - self.assert_pool_manager_request_called_with( - mock_request, - self.api_config.get_server_url('servers', None) + "/requestBody/postUriReferenceFormatRequestBody", - method='post'.upper(), - body=self.json_bytes(payload), - content_type=content_type, - ) - - assert isinstance(api_response.response, urllib3.HTTPResponse) - assert isinstance(api_response.body, schemas.Unset) - - def test_all_string_formats_ignore_integers_passes(self): - content_type = 'application/json' - # all string formats ignore integers - with patch.object(urllib3.PoolManager, 'request') as mock_request: - payload = ( - 12 - ) - body = post.request_body.RequestBody.content["application/json"].schema.from_openapi_data_( - payload, - configuration_=self.schema_config - ) - mock_request.return_value = self.response( - self.json_bytes(self.response_body), - status=self.response_status - ) - api_response = self.api.post( - body=body, - content_type=content_type - ) - self.assert_pool_manager_request_called_with( - mock_request, - self.api_config.get_server_url('servers', None) + "/requestBody/postUriReferenceFormatRequestBody", - method='post'.upper(), - body=self.json_bytes(payload), - content_type=content_type, - ) - - assert isinstance(api_response.response, urllib3.HTTPResponse) - assert isinstance(api_response.body, schemas.Unset) - - def test_all_string_formats_ignore_floats_passes(self): - content_type = 'application/json' - # all string formats ignore floats - with patch.object(urllib3.PoolManager, 'request') as mock_request: - payload = ( - 13.7 - ) - body = post.request_body.RequestBody.content["application/json"].schema.from_openapi_data_( - payload, - configuration_=self.schema_config - ) - mock_request.return_value = self.response( - self.json_bytes(self.response_body), - status=self.response_status - ) - api_response = self.api.post( - body=body, - content_type=content_type - ) - self.assert_pool_manager_request_called_with( - mock_request, - self.api_config.get_server_url('servers', None) + "/requestBody/postUriReferenceFormatRequestBody", - method='post'.upper(), - body=self.json_bytes(payload), - content_type=content_type, - ) - - assert isinstance(api_response.response, urllib3.HTTPResponse) - assert isinstance(api_response.body, schemas.Unset) - - def test_all_string_formats_ignore_arrays_passes(self): - content_type = 'application/json' - # all string formats ignore arrays - with patch.object(urllib3.PoolManager, 'request') as mock_request: - payload = ( - [ - ] - ) - body = post.request_body.RequestBody.content["application/json"].schema.from_openapi_data_( - payload, - configuration_=self.schema_config - ) - mock_request.return_value = self.response( - self.json_bytes(self.response_body), - status=self.response_status - ) - api_response = self.api.post( - body=body, - content_type=content_type - ) - self.assert_pool_manager_request_called_with( - mock_request, - self.api_config.get_server_url('servers', None) + "/requestBody/postUriReferenceFormatRequestBody", - method='post'.upper(), - body=self.json_bytes(payload), - content_type=content_type, - ) - - assert isinstance(api_response.response, urllib3.HTTPResponse) - assert isinstance(api_response.body, schemas.Unset) - - def test_all_string_formats_ignore_nulls_passes(self): - content_type = 'application/json' - # all string formats ignore nulls - with patch.object(urllib3.PoolManager, 'request') as mock_request: - payload = ( - None - ) - body = post.request_body.RequestBody.content["application/json"].schema.from_openapi_data_( - payload, - configuration_=self.schema_config - ) - mock_request.return_value = self.response( - self.json_bytes(self.response_body), - status=self.response_status - ) - api_response = self.api.post( - body=body, - content_type=content_type - ) - self.assert_pool_manager_request_called_with( - mock_request, - self.api_config.get_server_url('servers', None) + "/requestBody/postUriReferenceFormatRequestBody", - method='post'.upper(), - body=self.json_bytes(payload), - content_type=content_type, - ) - - assert isinstance(api_response.response, urllib3.HTTPResponse) - assert isinstance(api_response.body, schemas.Unset) - -if __name__ == '__main__': - unittest.main() diff --git a/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_request_body_post_uri_template_format_request_body/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_request_body_post_uri_template_format_request_body/__init__.py index 77ca486e1c3..e69de29bb2d 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_request_body_post_uri_template_format_request_body/__init__.py +++ b/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_request_body_post_uri_template_format_request_body/__init__.py @@ -1,217 +0,0 @@ -# coding: utf-8 - -""" - - - Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator -""" - -import unittest -from unittest.mock import patch - -import urllib3 - -import unit_test_api -from unit_test_api.paths.request_body_post_uri_template_format_request_body.post import operation as post # noqa: E501 -from unit_test_api import schemas, api_client -from unit_test_api.configurations import api_configuration, schema_configuration - -from .. import ApiTestMixin - - -class TestPost(ApiTestMixin, unittest.TestCase): - """ - Post unit test stubs - """ - api_config = api_configuration.ApiConfiguration() - schema_config = schema_configuration.SchemaConfiguration() - used_api_client = api_client.ApiClient(configuration=api_config, schema_config=schema_config) - api = post.ApiForPost(api_client=used_api_client) # noqa: E501 - - response_status = 200 - response_body = '' - - def test_all_string_formats_ignore_objects_passes(self): - content_type = 'application/json' - # all string formats ignore objects - with patch.object(urllib3.PoolManager, 'request') as mock_request: - payload = ( - { - } - ) - body = post.request_body.RequestBody.content["application/json"].schema.from_openapi_data_( - payload, - configuration_=self.schema_config - ) - mock_request.return_value = self.response( - self.json_bytes(self.response_body), - status=self.response_status - ) - api_response = self.api.post( - body=body, - content_type=content_type - ) - self.assert_pool_manager_request_called_with( - mock_request, - self.api_config.get_server_url('servers', None) + "/requestBody/postUriTemplateFormatRequestBody", - method='post'.upper(), - body=self.json_bytes(payload), - content_type=content_type, - ) - - assert isinstance(api_response.response, urllib3.HTTPResponse) - assert isinstance(api_response.body, schemas.Unset) - - def test_all_string_formats_ignore_booleans_passes(self): - content_type = 'application/json' - # all string formats ignore booleans - with patch.object(urllib3.PoolManager, 'request') as mock_request: - payload = ( - False - ) - body = post.request_body.RequestBody.content["application/json"].schema.from_openapi_data_( - payload, - configuration_=self.schema_config - ) - mock_request.return_value = self.response( - self.json_bytes(self.response_body), - status=self.response_status - ) - api_response = self.api.post( - body=body, - content_type=content_type - ) - self.assert_pool_manager_request_called_with( - mock_request, - self.api_config.get_server_url('servers', None) + "/requestBody/postUriTemplateFormatRequestBody", - method='post'.upper(), - body=self.json_bytes(payload), - content_type=content_type, - ) - - assert isinstance(api_response.response, urllib3.HTTPResponse) - assert isinstance(api_response.body, schemas.Unset) - - def test_all_string_formats_ignore_integers_passes(self): - content_type = 'application/json' - # all string formats ignore integers - with patch.object(urllib3.PoolManager, 'request') as mock_request: - payload = ( - 12 - ) - body = post.request_body.RequestBody.content["application/json"].schema.from_openapi_data_( - payload, - configuration_=self.schema_config - ) - mock_request.return_value = self.response( - self.json_bytes(self.response_body), - status=self.response_status - ) - api_response = self.api.post( - body=body, - content_type=content_type - ) - self.assert_pool_manager_request_called_with( - mock_request, - self.api_config.get_server_url('servers', None) + "/requestBody/postUriTemplateFormatRequestBody", - method='post'.upper(), - body=self.json_bytes(payload), - content_type=content_type, - ) - - assert isinstance(api_response.response, urllib3.HTTPResponse) - assert isinstance(api_response.body, schemas.Unset) - - def test_all_string_formats_ignore_floats_passes(self): - content_type = 'application/json' - # all string formats ignore floats - with patch.object(urllib3.PoolManager, 'request') as mock_request: - payload = ( - 13.7 - ) - body = post.request_body.RequestBody.content["application/json"].schema.from_openapi_data_( - payload, - configuration_=self.schema_config - ) - mock_request.return_value = self.response( - self.json_bytes(self.response_body), - status=self.response_status - ) - api_response = self.api.post( - body=body, - content_type=content_type - ) - self.assert_pool_manager_request_called_with( - mock_request, - self.api_config.get_server_url('servers', None) + "/requestBody/postUriTemplateFormatRequestBody", - method='post'.upper(), - body=self.json_bytes(payload), - content_type=content_type, - ) - - assert isinstance(api_response.response, urllib3.HTTPResponse) - assert isinstance(api_response.body, schemas.Unset) - - def test_all_string_formats_ignore_arrays_passes(self): - content_type = 'application/json' - # all string formats ignore arrays - with patch.object(urllib3.PoolManager, 'request') as mock_request: - payload = ( - [ - ] - ) - body = post.request_body.RequestBody.content["application/json"].schema.from_openapi_data_( - payload, - configuration_=self.schema_config - ) - mock_request.return_value = self.response( - self.json_bytes(self.response_body), - status=self.response_status - ) - api_response = self.api.post( - body=body, - content_type=content_type - ) - self.assert_pool_manager_request_called_with( - mock_request, - self.api_config.get_server_url('servers', None) + "/requestBody/postUriTemplateFormatRequestBody", - method='post'.upper(), - body=self.json_bytes(payload), - content_type=content_type, - ) - - assert isinstance(api_response.response, urllib3.HTTPResponse) - assert isinstance(api_response.body, schemas.Unset) - - def test_all_string_formats_ignore_nulls_passes(self): - content_type = 'application/json' - # all string formats ignore nulls - with patch.object(urllib3.PoolManager, 'request') as mock_request: - payload = ( - None - ) - body = post.request_body.RequestBody.content["application/json"].schema.from_openapi_data_( - payload, - configuration_=self.schema_config - ) - mock_request.return_value = self.response( - self.json_bytes(self.response_body), - status=self.response_status - ) - api_response = self.api.post( - body=body, - content_type=content_type - ) - self.assert_pool_manager_request_called_with( - mock_request, - self.api_config.get_server_url('servers', None) + "/requestBody/postUriTemplateFormatRequestBody", - method='post'.upper(), - body=self.json_bytes(payload), - content_type=content_type, - ) - - assert isinstance(api_response.response, urllib3.HTTPResponse) - assert isinstance(api_response.body, schemas.Unset) - -if __name__ == '__main__': - unittest.main() diff --git a/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_response_body_post_additionalproperties_allows_a_schema_which_should_validate_response_body_for_content_types/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_response_body_post_additionalproperties_allows_a_schema_which_should_validate_response_body_for_content_types/__init__.py index f3bb2f367cb..e69de29bb2d 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_response_body_post_additionalproperties_allows_a_schema_which_should_validate_response_body_for_content_types/__init__.py +++ b/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_response_body_post_additionalproperties_allows_a_schema_which_should_validate_response_body_for_content_types/__init__.py @@ -1,136 +0,0 @@ -# coding: utf-8 - -""" - - - Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator -""" - -import unittest -from unittest.mock import patch - -import urllib3 - -import unit_test_api -from unit_test_api.paths.response_body_post_additionalproperties_allows_a_schema_which_should_validate_response_body_for_content_types.post import operation as post # noqa: E501 -from unit_test_api import schemas, api_client -from unit_test_api.configurations import api_configuration, schema_configuration - -from .. import ApiTestMixin - - -class TestPost(ApiTestMixin, unittest.TestCase): - """ - Post unit test stubs - """ - api_config = api_configuration.ApiConfiguration() - schema_config = schema_configuration.SchemaConfiguration() - used_api_client = api_client.ApiClient(configuration=api_config, schema_config=schema_config) - api = post.ApiForPost(api_client=used_api_client) # noqa: E501 - - response_status = 200 - response_body_schema = post.response_200.ResponseFor200.content["application/json"].schema - - def test_no_additional_properties_is_valid_passes(self): - # no additional properties is valid - accept_content_type = 'application/json' - - with patch.object(urllib3.PoolManager, 'request') as mock_request: - payload = ( - { - "foo": - 1, - } - ) - mock_request.return_value = self.response( - self.json_bytes(payload), - status=self.response_status - ) - api_response = self.api.post( - accept_content_types=(accept_content_type,) - ) - self.assert_pool_manager_request_called_with( - mock_request, - self.api_config.get_server_url('servers', None) + "/responseBody/postAdditionalpropertiesAllowsASchemaWhichShouldValidateResponseBodyForContentTypes", - method='post'.upper(), - accept_content_type=accept_content_type, - ) - - assert isinstance(api_response.response, urllib3.HTTPResponse) - assert isinstance(api_response.body, self.response_body_schema) - deserialized_response_body = self.response_body_schema.from_openapi_data_( - payload, - configuration_=self.schema_config - ) - assert api_response.body == deserialized_response_body - - def test_an_additional_invalid_property_is_invalid_fails(self): - # an additional invalid property is invalid - accept_content_type = 'application/json' - - with patch.object(urllib3.PoolManager, 'request') as mock_request: - payload = ( - { - "foo": - 1, - "bar": - 2, - "quux": - 12, - } - ) - mock_request.return_value = self.response( - self.json_bytes(payload), - status=self.response_status - ) - with self.assertRaises((unit_test_api.ApiValueError, unit_test_api.ApiTypeError)): - self.api.post( - accept_content_types=(accept_content_type,) - ) - self.assert_pool_manager_request_called_with( - mock_request, - self.api_config.get_server_url('servers', None) + "/responseBody/postAdditionalpropertiesAllowsASchemaWhichShouldValidateResponseBodyForContentTypes", - method='post'.upper(), - content_type=None, - accept_content_type=accept_content_type, - ) - - def test_an_additional_valid_property_is_valid_passes(self): - # an additional valid property is valid - accept_content_type = 'application/json' - - with patch.object(urllib3.PoolManager, 'request') as mock_request: - payload = ( - { - "foo": - 1, - "bar": - 2, - "quux": - True, - } - ) - mock_request.return_value = self.response( - self.json_bytes(payload), - status=self.response_status - ) - api_response = self.api.post( - accept_content_types=(accept_content_type,) - ) - self.assert_pool_manager_request_called_with( - mock_request, - self.api_config.get_server_url('servers', None) + "/responseBody/postAdditionalpropertiesAllowsASchemaWhichShouldValidateResponseBodyForContentTypes", - method='post'.upper(), - accept_content_type=accept_content_type, - ) - - assert isinstance(api_response.response, urllib3.HTTPResponse) - assert isinstance(api_response.body, self.response_body_schema) - deserialized_response_body = self.response_body_schema.from_openapi_data_( - payload, - configuration_=self.schema_config - ) - assert api_response.body == deserialized_response_body - -if __name__ == '__main__': - unittest.main() diff --git a/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_response_body_post_additionalproperties_are_allowed_by_default_response_body_for_content_types/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_response_body_post_additionalproperties_are_allowed_by_default_response_body_for_content_types/__init__.py index b1fe00a398a..e69de29bb2d 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_response_body_post_additionalproperties_are_allowed_by_default_response_body_for_content_types/__init__.py +++ b/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_response_body_post_additionalproperties_are_allowed_by_default_response_body_for_content_types/__init__.py @@ -1,72 +0,0 @@ -# coding: utf-8 - -""" - - - Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator -""" - -import unittest -from unittest.mock import patch - -import urllib3 - -import unit_test_api -from unit_test_api.paths.response_body_post_additionalproperties_are_allowed_by_default_response_body_for_content_types.post import operation as post # noqa: E501 -from unit_test_api import schemas, api_client -from unit_test_api.configurations import api_configuration, schema_configuration - -from .. import ApiTestMixin - - -class TestPost(ApiTestMixin, unittest.TestCase): - """ - Post unit test stubs - """ - api_config = api_configuration.ApiConfiguration() - schema_config = schema_configuration.SchemaConfiguration() - used_api_client = api_client.ApiClient(configuration=api_config, schema_config=schema_config) - api = post.ApiForPost(api_client=used_api_client) # noqa: E501 - - response_status = 200 - response_body_schema = post.response_200.ResponseFor200.content["application/json"].schema - - def test_additional_properties_are_allowed_passes(self): - # additional properties are allowed - accept_content_type = 'application/json' - - with patch.object(urllib3.PoolManager, 'request') as mock_request: - payload = ( - { - "foo": - 1, - "bar": - 2, - "quux": - True, - } - ) - mock_request.return_value = self.response( - self.json_bytes(payload), - status=self.response_status - ) - api_response = self.api.post( - accept_content_types=(accept_content_type,) - ) - self.assert_pool_manager_request_called_with( - mock_request, - self.api_config.get_server_url('servers', None) + "/responseBody/postAdditionalpropertiesAreAllowedByDefaultResponseBodyForContentTypes", - method='post'.upper(), - accept_content_type=accept_content_type, - ) - - assert isinstance(api_response.response, urllib3.HTTPResponse) - assert isinstance(api_response.body, self.response_body_schema) - deserialized_response_body = self.response_body_schema.from_openapi_data_( - payload, - configuration_=self.schema_config - ) - assert api_response.body == deserialized_response_body - -if __name__ == '__main__': - unittest.main() diff --git a/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_response_body_post_additionalproperties_can_exist_by_itself_response_body_for_content_types/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_response_body_post_additionalproperties_can_exist_by_itself_response_body_for_content_types/__init__.py index 7de73d46e71..e69de29bb2d 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_response_body_post_additionalproperties_can_exist_by_itself_response_body_for_content_types/__init__.py +++ b/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_response_body_post_additionalproperties_can_exist_by_itself_response_body_for_content_types/__init__.py @@ -1,95 +0,0 @@ -# coding: utf-8 - -""" - - - Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator -""" - -import unittest -from unittest.mock import patch - -import urllib3 - -import unit_test_api -from unit_test_api.paths.response_body_post_additionalproperties_can_exist_by_itself_response_body_for_content_types.post import operation as post # noqa: E501 -from unit_test_api import schemas, api_client -from unit_test_api.configurations import api_configuration, schema_configuration - -from .. import ApiTestMixin - - -class TestPost(ApiTestMixin, unittest.TestCase): - """ - Post unit test stubs - """ - api_config = api_configuration.ApiConfiguration() - schema_config = schema_configuration.SchemaConfiguration() - used_api_client = api_client.ApiClient(configuration=api_config, schema_config=schema_config) - api = post.ApiForPost(api_client=used_api_client) # noqa: E501 - - response_status = 200 - response_body_schema = post.response_200.ResponseFor200.content["application/json"].schema - - def test_an_additional_invalid_property_is_invalid_fails(self): - # an additional invalid property is invalid - accept_content_type = 'application/json' - - with patch.object(urllib3.PoolManager, 'request') as mock_request: - payload = ( - { - "foo": - 1, - } - ) - mock_request.return_value = self.response( - self.json_bytes(payload), - status=self.response_status - ) - with self.assertRaises((unit_test_api.ApiValueError, unit_test_api.ApiTypeError)): - self.api.post( - accept_content_types=(accept_content_type,) - ) - self.assert_pool_manager_request_called_with( - mock_request, - self.api_config.get_server_url('servers', None) + "/responseBody/postAdditionalpropertiesCanExistByItselfResponseBodyForContentTypes", - method='post'.upper(), - content_type=None, - accept_content_type=accept_content_type, - ) - - def test_an_additional_valid_property_is_valid_passes(self): - # an additional valid property is valid - accept_content_type = 'application/json' - - with patch.object(urllib3.PoolManager, 'request') as mock_request: - payload = ( - { - "foo": - True, - } - ) - mock_request.return_value = self.response( - self.json_bytes(payload), - status=self.response_status - ) - api_response = self.api.post( - accept_content_types=(accept_content_type,) - ) - self.assert_pool_manager_request_called_with( - mock_request, - self.api_config.get_server_url('servers', None) + "/responseBody/postAdditionalpropertiesCanExistByItselfResponseBodyForContentTypes", - method='post'.upper(), - accept_content_type=accept_content_type, - ) - - assert isinstance(api_response.response, urllib3.HTTPResponse) - assert isinstance(api_response.body, self.response_body_schema) - deserialized_response_body = self.response_body_schema.from_openapi_data_( - payload, - configuration_=self.schema_config - ) - assert api_response.body == deserialized_response_body - -if __name__ == '__main__': - unittest.main() diff --git a/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_response_body_post_additionalproperties_should_not_look_in_applicators_response_body_for_content_types/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_response_body_post_additionalproperties_should_not_look_in_applicators_response_body_for_content_types/__init__.py index 02444352fc8..e69de29bb2d 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_response_body_post_additionalproperties_should_not_look_in_applicators_response_body_for_content_types/__init__.py +++ b/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_response_body_post_additionalproperties_should_not_look_in_applicators_response_body_for_content_types/__init__.py @@ -1,99 +0,0 @@ -# coding: utf-8 - -""" - - - Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator -""" - -import unittest -from unittest.mock import patch - -import urllib3 - -import unit_test_api -from unit_test_api.paths.response_body_post_additionalproperties_should_not_look_in_applicators_response_body_for_content_types.post import operation as post # noqa: E501 -from unit_test_api import schemas, api_client -from unit_test_api.configurations import api_configuration, schema_configuration - -from .. import ApiTestMixin - - -class TestPost(ApiTestMixin, unittest.TestCase): - """ - Post unit test stubs - """ - api_config = api_configuration.ApiConfiguration() - schema_config = schema_configuration.SchemaConfiguration() - used_api_client = api_client.ApiClient(configuration=api_config, schema_config=schema_config) - api = post.ApiForPost(api_client=used_api_client) # noqa: E501 - - response_status = 200 - response_body_schema = post.response_200.ResponseFor200.content["application/json"].schema - - def test_properties_defined_in_allof_are_not_examined_fails(self): - # properties defined in allOf are not examined - accept_content_type = 'application/json' - - with patch.object(urllib3.PoolManager, 'request') as mock_request: - payload = ( - { - "foo": - 1, - "bar": - True, - } - ) - mock_request.return_value = self.response( - self.json_bytes(payload), - status=self.response_status - ) - with self.assertRaises((unit_test_api.ApiValueError, unit_test_api.ApiTypeError)): - self.api.post( - accept_content_types=(accept_content_type,) - ) - self.assert_pool_manager_request_called_with( - mock_request, - self.api_config.get_server_url('servers', None) + "/responseBody/postAdditionalpropertiesShouldNotLookInApplicatorsResponseBodyForContentTypes", - method='post'.upper(), - content_type=None, - accept_content_type=accept_content_type, - ) - - def test_valid_test_case_passes(self): - # valid test case - accept_content_type = 'application/json' - - with patch.object(urllib3.PoolManager, 'request') as mock_request: - payload = ( - { - "foo": - False, - "bar": - True, - } - ) - mock_request.return_value = self.response( - self.json_bytes(payload), - status=self.response_status - ) - api_response = self.api.post( - accept_content_types=(accept_content_type,) - ) - self.assert_pool_manager_request_called_with( - mock_request, - self.api_config.get_server_url('servers', None) + "/responseBody/postAdditionalpropertiesShouldNotLookInApplicatorsResponseBodyForContentTypes", - method='post'.upper(), - accept_content_type=accept_content_type, - ) - - assert isinstance(api_response.response, urllib3.HTTPResponse) - assert isinstance(api_response.body, self.response_body_schema) - deserialized_response_body = self.response_body_schema.from_openapi_data_( - payload, - configuration_=self.schema_config - ) - assert api_response.body == deserialized_response_body - -if __name__ == '__main__': - unittest.main() diff --git a/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_response_body_post_allof_combined_with_anyof_oneof_response_body_for_content_types/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_response_body_post_allof_combined_with_anyof_oneof_response_body_for_content_types/__init__.py index 78ba38affd9..e69de29bb2d 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_response_body_post_allof_combined_with_anyof_oneof_response_body_for_content_types/__init__.py +++ b/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_response_body_post_allof_combined_with_anyof_oneof_response_body_for_content_types/__init__.py @@ -1,233 +0,0 @@ -# coding: utf-8 - -""" - - - Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator -""" - -import unittest -from unittest.mock import patch - -import urllib3 - -import unit_test_api -from unit_test_api.paths.response_body_post_allof_combined_with_anyof_oneof_response_body_for_content_types.post import operation as post # noqa: E501 -from unit_test_api import schemas, api_client -from unit_test_api.configurations import api_configuration, schema_configuration - -from .. import ApiTestMixin - - -class TestPost(ApiTestMixin, unittest.TestCase): - """ - Post unit test stubs - """ - api_config = api_configuration.ApiConfiguration() - schema_config = schema_configuration.SchemaConfiguration() - used_api_client = api_client.ApiClient(configuration=api_config, schema_config=schema_config) - api = post.ApiForPost(api_client=used_api_client) # noqa: E501 - - response_status = 200 - response_body_schema = post.response_200.ResponseFor200.content["application/json"].schema - - def test_allof_true_anyof_false_oneof_false_fails(self): - # allOf: true, anyOf: false, oneOf: false - accept_content_type = 'application/json' - - with patch.object(urllib3.PoolManager, 'request') as mock_request: - payload = ( - 2 - ) - mock_request.return_value = self.response( - self.json_bytes(payload), - status=self.response_status - ) - with self.assertRaises((unit_test_api.ApiValueError, unit_test_api.ApiTypeError)): - self.api.post( - accept_content_types=(accept_content_type,) - ) - self.assert_pool_manager_request_called_with( - mock_request, - self.api_config.get_server_url('servers', None) + "/responseBody/postAllofCombinedWithAnyofOneofResponseBodyForContentTypes", - method='post'.upper(), - content_type=None, - accept_content_type=accept_content_type, - ) - - def test_allof_false_anyof_false_oneof_true_fails(self): - # allOf: false, anyOf: false, oneOf: true - accept_content_type = 'application/json' - - with patch.object(urllib3.PoolManager, 'request') as mock_request: - payload = ( - 5 - ) - mock_request.return_value = self.response( - self.json_bytes(payload), - status=self.response_status - ) - with self.assertRaises((unit_test_api.ApiValueError, unit_test_api.ApiTypeError)): - self.api.post( - accept_content_types=(accept_content_type,) - ) - self.assert_pool_manager_request_called_with( - mock_request, - self.api_config.get_server_url('servers', None) + "/responseBody/postAllofCombinedWithAnyofOneofResponseBodyForContentTypes", - method='post'.upper(), - content_type=None, - accept_content_type=accept_content_type, - ) - - def test_allof_false_anyof_true_oneof_true_fails(self): - # allOf: false, anyOf: true, oneOf: true - accept_content_type = 'application/json' - - with patch.object(urllib3.PoolManager, 'request') as mock_request: - payload = ( - 15 - ) - mock_request.return_value = self.response( - self.json_bytes(payload), - status=self.response_status - ) - with self.assertRaises((unit_test_api.ApiValueError, unit_test_api.ApiTypeError)): - self.api.post( - accept_content_types=(accept_content_type,) - ) - self.assert_pool_manager_request_called_with( - mock_request, - self.api_config.get_server_url('servers', None) + "/responseBody/postAllofCombinedWithAnyofOneofResponseBodyForContentTypes", - method='post'.upper(), - content_type=None, - accept_content_type=accept_content_type, - ) - - def test_allof_true_anyof_true_oneof_false_fails(self): - # allOf: true, anyOf: true, oneOf: false - accept_content_type = 'application/json' - - with patch.object(urllib3.PoolManager, 'request') as mock_request: - payload = ( - 6 - ) - mock_request.return_value = self.response( - self.json_bytes(payload), - status=self.response_status - ) - with self.assertRaises((unit_test_api.ApiValueError, unit_test_api.ApiTypeError)): - self.api.post( - accept_content_types=(accept_content_type,) - ) - self.assert_pool_manager_request_called_with( - mock_request, - self.api_config.get_server_url('servers', None) + "/responseBody/postAllofCombinedWithAnyofOneofResponseBodyForContentTypes", - method='post'.upper(), - content_type=None, - accept_content_type=accept_content_type, - ) - - def test_allof_true_anyof_true_oneof_true_passes(self): - # allOf: true, anyOf: true, oneOf: true - accept_content_type = 'application/json' - - with patch.object(urllib3.PoolManager, 'request') as mock_request: - payload = ( - 30 - ) - mock_request.return_value = self.response( - self.json_bytes(payload), - status=self.response_status - ) - api_response = self.api.post( - accept_content_types=(accept_content_type,) - ) - self.assert_pool_manager_request_called_with( - mock_request, - self.api_config.get_server_url('servers', None) + "/responseBody/postAllofCombinedWithAnyofOneofResponseBodyForContentTypes", - method='post'.upper(), - accept_content_type=accept_content_type, - ) - - assert isinstance(api_response.response, urllib3.HTTPResponse) - assert isinstance(api_response.body, self.response_body_schema) - deserialized_response_body = self.response_body_schema.from_openapi_data_( - payload, - configuration_=self.schema_config - ) - assert api_response.body == deserialized_response_body - - def test_allof_true_anyof_false_oneof_true_fails(self): - # allOf: true, anyOf: false, oneOf: true - accept_content_type = 'application/json' - - with patch.object(urllib3.PoolManager, 'request') as mock_request: - payload = ( - 10 - ) - mock_request.return_value = self.response( - self.json_bytes(payload), - status=self.response_status - ) - with self.assertRaises((unit_test_api.ApiValueError, unit_test_api.ApiTypeError)): - self.api.post( - accept_content_types=(accept_content_type,) - ) - self.assert_pool_manager_request_called_with( - mock_request, - self.api_config.get_server_url('servers', None) + "/responseBody/postAllofCombinedWithAnyofOneofResponseBodyForContentTypes", - method='post'.upper(), - content_type=None, - accept_content_type=accept_content_type, - ) - - def test_allof_false_anyof_true_oneof_false_fails(self): - # allOf: false, anyOf: true, oneOf: false - accept_content_type = 'application/json' - - with patch.object(urllib3.PoolManager, 'request') as mock_request: - payload = ( - 3 - ) - mock_request.return_value = self.response( - self.json_bytes(payload), - status=self.response_status - ) - with self.assertRaises((unit_test_api.ApiValueError, unit_test_api.ApiTypeError)): - self.api.post( - accept_content_types=(accept_content_type,) - ) - self.assert_pool_manager_request_called_with( - mock_request, - self.api_config.get_server_url('servers', None) + "/responseBody/postAllofCombinedWithAnyofOneofResponseBodyForContentTypes", - method='post'.upper(), - content_type=None, - accept_content_type=accept_content_type, - ) - - def test_allof_false_anyof_false_oneof_false_fails(self): - # allOf: false, anyOf: false, oneOf: false - accept_content_type = 'application/json' - - with patch.object(urllib3.PoolManager, 'request') as mock_request: - payload = ( - 1 - ) - mock_request.return_value = self.response( - self.json_bytes(payload), - status=self.response_status - ) - with self.assertRaises((unit_test_api.ApiValueError, unit_test_api.ApiTypeError)): - self.api.post( - accept_content_types=(accept_content_type,) - ) - self.assert_pool_manager_request_called_with( - mock_request, - self.api_config.get_server_url('servers', None) + "/responseBody/postAllofCombinedWithAnyofOneofResponseBodyForContentTypes", - method='post'.upper(), - content_type=None, - accept_content_type=accept_content_type, - ) - -if __name__ == '__main__': - unittest.main() diff --git a/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_response_body_post_allof_response_body_for_content_types/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_response_body_post_allof_response_body_for_content_types/__init__.py index cc6170da862..e69de29bb2d 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_response_body_post_allof_response_body_for_content_types/__init__.py +++ b/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_response_body_post_allof_response_body_for_content_types/__init__.py @@ -1,153 +0,0 @@ -# coding: utf-8 - -""" - - - Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator -""" - -import unittest -from unittest.mock import patch - -import urllib3 - -import unit_test_api -from unit_test_api.paths.response_body_post_allof_response_body_for_content_types.post import operation as post # noqa: E501 -from unit_test_api import schemas, api_client -from unit_test_api.configurations import api_configuration, schema_configuration - -from .. import ApiTestMixin - - -class TestPost(ApiTestMixin, unittest.TestCase): - """ - Post unit test stubs - """ - api_config = api_configuration.ApiConfiguration() - schema_config = schema_configuration.SchemaConfiguration() - used_api_client = api_client.ApiClient(configuration=api_config, schema_config=schema_config) - api = post.ApiForPost(api_client=used_api_client) # noqa: E501 - - response_status = 200 - response_body_schema = post.response_200.ResponseFor200.content["application/json"].schema - - def test_allof_passes(self): - # allOf - accept_content_type = 'application/json' - - with patch.object(urllib3.PoolManager, 'request') as mock_request: - payload = ( - { - "foo": - "baz", - "bar": - 2, - } - ) - mock_request.return_value = self.response( - self.json_bytes(payload), - status=self.response_status - ) - api_response = self.api.post( - accept_content_types=(accept_content_type,) - ) - self.assert_pool_manager_request_called_with( - mock_request, - self.api_config.get_server_url('servers', None) + "/responseBody/postAllofResponseBodyForContentTypes", - method='post'.upper(), - accept_content_type=accept_content_type, - ) - - assert isinstance(api_response.response, urllib3.HTTPResponse) - assert isinstance(api_response.body, self.response_body_schema) - deserialized_response_body = self.response_body_schema.from_openapi_data_( - payload, - configuration_=self.schema_config - ) - assert api_response.body == deserialized_response_body - - def test_mismatch_first_fails(self): - # mismatch first - accept_content_type = 'application/json' - - with patch.object(urllib3.PoolManager, 'request') as mock_request: - payload = ( - { - "bar": - 2, - } - ) - mock_request.return_value = self.response( - self.json_bytes(payload), - status=self.response_status - ) - with self.assertRaises((unit_test_api.ApiValueError, unit_test_api.ApiTypeError)): - self.api.post( - accept_content_types=(accept_content_type,) - ) - self.assert_pool_manager_request_called_with( - mock_request, - self.api_config.get_server_url('servers', None) + "/responseBody/postAllofResponseBodyForContentTypes", - method='post'.upper(), - content_type=None, - accept_content_type=accept_content_type, - ) - - def test_mismatch_second_fails(self): - # mismatch second - accept_content_type = 'application/json' - - with patch.object(urllib3.PoolManager, 'request') as mock_request: - payload = ( - { - "foo": - "baz", - } - ) - mock_request.return_value = self.response( - self.json_bytes(payload), - status=self.response_status - ) - with self.assertRaises((unit_test_api.ApiValueError, unit_test_api.ApiTypeError)): - self.api.post( - accept_content_types=(accept_content_type,) - ) - self.assert_pool_manager_request_called_with( - mock_request, - self.api_config.get_server_url('servers', None) + "/responseBody/postAllofResponseBodyForContentTypes", - method='post'.upper(), - content_type=None, - accept_content_type=accept_content_type, - ) - - def test_wrong_type_fails(self): - # wrong type - accept_content_type = 'application/json' - - with patch.object(urllib3.PoolManager, 'request') as mock_request: - payload = ( - { - "foo": - "baz", - "bar": - "quux", - } - ) - mock_request.return_value = self.response( - self.json_bytes(payload), - status=self.response_status - ) - with self.assertRaises((unit_test_api.ApiValueError, unit_test_api.ApiTypeError)): - self.api.post( - accept_content_types=(accept_content_type,) - ) - self.assert_pool_manager_request_called_with( - mock_request, - self.api_config.get_server_url('servers', None) + "/responseBody/postAllofResponseBodyForContentTypes", - method='post'.upper(), - content_type=None, - accept_content_type=accept_content_type, - ) - -if __name__ == '__main__': - unittest.main() diff --git a/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_response_body_post_allof_simple_types_response_body_for_content_types/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_response_body_post_allof_simple_types_response_body_for_content_types/__init__.py index 4254f960df1..e69de29bb2d 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_response_body_post_allof_simple_types_response_body_for_content_types/__init__.py +++ b/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_response_body_post_allof_simple_types_response_body_for_content_types/__init__.py @@ -1,89 +0,0 @@ -# coding: utf-8 - -""" - - - Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator -""" - -import unittest -from unittest.mock import patch - -import urllib3 - -import unit_test_api -from unit_test_api.paths.response_body_post_allof_simple_types_response_body_for_content_types.post import operation as post # noqa: E501 -from unit_test_api import schemas, api_client -from unit_test_api.configurations import api_configuration, schema_configuration - -from .. import ApiTestMixin - - -class TestPost(ApiTestMixin, unittest.TestCase): - """ - Post unit test stubs - """ - api_config = api_configuration.ApiConfiguration() - schema_config = schema_configuration.SchemaConfiguration() - used_api_client = api_client.ApiClient(configuration=api_config, schema_config=schema_config) - api = post.ApiForPost(api_client=used_api_client) # noqa: E501 - - response_status = 200 - response_body_schema = post.response_200.ResponseFor200.content["application/json"].schema - - def test_valid_passes(self): - # valid - accept_content_type = 'application/json' - - with patch.object(urllib3.PoolManager, 'request') as mock_request: - payload = ( - 25 - ) - mock_request.return_value = self.response( - self.json_bytes(payload), - status=self.response_status - ) - api_response = self.api.post( - accept_content_types=(accept_content_type,) - ) - self.assert_pool_manager_request_called_with( - mock_request, - self.api_config.get_server_url('servers', None) + "/responseBody/postAllofSimpleTypesResponseBodyForContentTypes", - method='post'.upper(), - accept_content_type=accept_content_type, - ) - - assert isinstance(api_response.response, urllib3.HTTPResponse) - assert isinstance(api_response.body, self.response_body_schema) - deserialized_response_body = self.response_body_schema.from_openapi_data_( - payload, - configuration_=self.schema_config - ) - assert api_response.body == deserialized_response_body - - def test_mismatch_one_fails(self): - # mismatch one - accept_content_type = 'application/json' - - with patch.object(urllib3.PoolManager, 'request') as mock_request: - payload = ( - 35 - ) - mock_request.return_value = self.response( - self.json_bytes(payload), - status=self.response_status - ) - with self.assertRaises((unit_test_api.ApiValueError, unit_test_api.ApiTypeError)): - self.api.post( - accept_content_types=(accept_content_type,) - ) - self.assert_pool_manager_request_called_with( - mock_request, - self.api_config.get_server_url('servers', None) + "/responseBody/postAllofSimpleTypesResponseBodyForContentTypes", - method='post'.upper(), - content_type=None, - accept_content_type=accept_content_type, - ) - -if __name__ == '__main__': - unittest.main() diff --git a/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_response_body_post_allof_with_base_schema_response_body_for_content_types/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_response_body_post_allof_with_base_schema_response_body_for_content_types/__init__.py index f10247f1d5a..e69de29bb2d 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_response_body_post_allof_with_base_schema_response_body_for_content_types/__init__.py +++ b/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_response_body_post_allof_with_base_schema_response_body_for_content_types/__init__.py @@ -1,186 +0,0 @@ -# coding: utf-8 - -""" - - - Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator -""" - -import unittest -from unittest.mock import patch - -import urllib3 - -import unit_test_api -from unit_test_api.paths.response_body_post_allof_with_base_schema_response_body_for_content_types.post import operation as post # noqa: E501 -from unit_test_api import schemas, api_client -from unit_test_api.configurations import api_configuration, schema_configuration - -from .. import ApiTestMixin - - -class TestPost(ApiTestMixin, unittest.TestCase): - """ - Post unit test stubs - """ - api_config = api_configuration.ApiConfiguration() - schema_config = schema_configuration.SchemaConfiguration() - used_api_client = api_client.ApiClient(configuration=api_config, schema_config=schema_config) - api = post.ApiForPost(api_client=used_api_client) # noqa: E501 - - response_status = 200 - response_body_schema = post.response_200.ResponseFor200.content["application/json"].schema - - def test_valid_passes(self): - # valid - accept_content_type = 'application/json' - - with patch.object(urllib3.PoolManager, 'request') as mock_request: - payload = ( - { - "foo": - "quux", - "bar": - 2, - "baz": - None, - } - ) - mock_request.return_value = self.response( - self.json_bytes(payload), - status=self.response_status - ) - api_response = self.api.post( - accept_content_types=(accept_content_type,) - ) - self.assert_pool_manager_request_called_with( - mock_request, - self.api_config.get_server_url('servers', None) + "/responseBody/postAllofWithBaseSchemaResponseBodyForContentTypes", - method='post'.upper(), - accept_content_type=accept_content_type, - ) - - assert isinstance(api_response.response, urllib3.HTTPResponse) - assert isinstance(api_response.body, self.response_body_schema) - deserialized_response_body = self.response_body_schema.from_openapi_data_( - payload, - configuration_=self.schema_config - ) - assert api_response.body == deserialized_response_body - - def test_mismatch_first_allof_fails(self): - # mismatch first allOf - accept_content_type = 'application/json' - - with patch.object(urllib3.PoolManager, 'request') as mock_request: - payload = ( - { - "bar": - 2, - "baz": - None, - } - ) - mock_request.return_value = self.response( - self.json_bytes(payload), - status=self.response_status - ) - with self.assertRaises((unit_test_api.ApiValueError, unit_test_api.ApiTypeError)): - self.api.post( - accept_content_types=(accept_content_type,) - ) - self.assert_pool_manager_request_called_with( - mock_request, - self.api_config.get_server_url('servers', None) + "/responseBody/postAllofWithBaseSchemaResponseBodyForContentTypes", - method='post'.upper(), - content_type=None, - accept_content_type=accept_content_type, - ) - - def test_mismatch_base_schema_fails(self): - # mismatch base schema - accept_content_type = 'application/json' - - with patch.object(urllib3.PoolManager, 'request') as mock_request: - payload = ( - { - "foo": - "quux", - "baz": - None, - } - ) - mock_request.return_value = self.response( - self.json_bytes(payload), - status=self.response_status - ) - with self.assertRaises((unit_test_api.ApiValueError, unit_test_api.ApiTypeError)): - self.api.post( - accept_content_types=(accept_content_type,) - ) - self.assert_pool_manager_request_called_with( - mock_request, - self.api_config.get_server_url('servers', None) + "/responseBody/postAllofWithBaseSchemaResponseBodyForContentTypes", - method='post'.upper(), - content_type=None, - accept_content_type=accept_content_type, - ) - - def test_mismatch_both_fails(self): - # mismatch both - accept_content_type = 'application/json' - - with patch.object(urllib3.PoolManager, 'request') as mock_request: - payload = ( - { - "bar": - 2, - } - ) - mock_request.return_value = self.response( - self.json_bytes(payload), - status=self.response_status - ) - with self.assertRaises((unit_test_api.ApiValueError, unit_test_api.ApiTypeError)): - self.api.post( - accept_content_types=(accept_content_type,) - ) - self.assert_pool_manager_request_called_with( - mock_request, - self.api_config.get_server_url('servers', None) + "/responseBody/postAllofWithBaseSchemaResponseBodyForContentTypes", - method='post'.upper(), - content_type=None, - accept_content_type=accept_content_type, - ) - - def test_mismatch_second_allof_fails(self): - # mismatch second allOf - accept_content_type = 'application/json' - - with patch.object(urllib3.PoolManager, 'request') as mock_request: - payload = ( - { - "foo": - "quux", - "bar": - 2, - } - ) - mock_request.return_value = self.response( - self.json_bytes(payload), - status=self.response_status - ) - with self.assertRaises((unit_test_api.ApiValueError, unit_test_api.ApiTypeError)): - self.api.post( - accept_content_types=(accept_content_type,) - ) - self.assert_pool_manager_request_called_with( - mock_request, - self.api_config.get_server_url('servers', None) + "/responseBody/postAllofWithBaseSchemaResponseBodyForContentTypes", - method='post'.upper(), - content_type=None, - accept_content_type=accept_content_type, - ) - -if __name__ == '__main__': - unittest.main() diff --git a/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_response_body_post_allof_with_one_empty_schema_response_body_for_content_types/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_response_body_post_allof_with_one_empty_schema_response_body_for_content_types/__init__.py index 941101100ed..e69de29bb2d 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_response_body_post_allof_with_one_empty_schema_response_body_for_content_types/__init__.py +++ b/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_response_body_post_allof_with_one_empty_schema_response_body_for_content_types/__init__.py @@ -1,65 +0,0 @@ -# coding: utf-8 - -""" - - - Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator -""" - -import unittest -from unittest.mock import patch - -import urllib3 - -import unit_test_api -from unit_test_api.paths.response_body_post_allof_with_one_empty_schema_response_body_for_content_types.post import operation as post # noqa: E501 -from unit_test_api import schemas, api_client -from unit_test_api.configurations import api_configuration, schema_configuration - -from .. import ApiTestMixin - - -class TestPost(ApiTestMixin, unittest.TestCase): - """ - Post unit test stubs - """ - api_config = api_configuration.ApiConfiguration() - schema_config = schema_configuration.SchemaConfiguration() - used_api_client = api_client.ApiClient(configuration=api_config, schema_config=schema_config) - api = post.ApiForPost(api_client=used_api_client) # noqa: E501 - - response_status = 200 - response_body_schema = post.response_200.ResponseFor200.content["application/json"].schema - - def test_any_data_is_valid_passes(self): - # any data is valid - accept_content_type = 'application/json' - - with patch.object(urllib3.PoolManager, 'request') as mock_request: - payload = ( - 1 - ) - mock_request.return_value = self.response( - self.json_bytes(payload), - status=self.response_status - ) - api_response = self.api.post( - accept_content_types=(accept_content_type,) - ) - self.assert_pool_manager_request_called_with( - mock_request, - self.api_config.get_server_url('servers', None) + "/responseBody/postAllofWithOneEmptySchemaResponseBodyForContentTypes", - method='post'.upper(), - accept_content_type=accept_content_type, - ) - - assert isinstance(api_response.response, urllib3.HTTPResponse) - assert isinstance(api_response.body, self.response_body_schema) - deserialized_response_body = self.response_body_schema.from_openapi_data_( - payload, - configuration_=self.schema_config - ) - assert api_response.body == deserialized_response_body - -if __name__ == '__main__': - unittest.main() diff --git a/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_response_body_post_allof_with_the_first_empty_schema_response_body_for_content_types/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_response_body_post_allof_with_the_first_empty_schema_response_body_for_content_types/__init__.py index d6daaee9455..e69de29bb2d 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_response_body_post_allof_with_the_first_empty_schema_response_body_for_content_types/__init__.py +++ b/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_response_body_post_allof_with_the_first_empty_schema_response_body_for_content_types/__init__.py @@ -1,89 +0,0 @@ -# coding: utf-8 - -""" - - - Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator -""" - -import unittest -from unittest.mock import patch - -import urllib3 - -import unit_test_api -from unit_test_api.paths.response_body_post_allof_with_the_first_empty_schema_response_body_for_content_types.post import operation as post # noqa: E501 -from unit_test_api import schemas, api_client -from unit_test_api.configurations import api_configuration, schema_configuration - -from .. import ApiTestMixin - - -class TestPost(ApiTestMixin, unittest.TestCase): - """ - Post unit test stubs - """ - api_config = api_configuration.ApiConfiguration() - schema_config = schema_configuration.SchemaConfiguration() - used_api_client = api_client.ApiClient(configuration=api_config, schema_config=schema_config) - api = post.ApiForPost(api_client=used_api_client) # noqa: E501 - - response_status = 200 - response_body_schema = post.response_200.ResponseFor200.content["application/json"].schema - - def test_string_is_invalid_fails(self): - # string is invalid - accept_content_type = 'application/json' - - with patch.object(urllib3.PoolManager, 'request') as mock_request: - payload = ( - "foo" - ) - mock_request.return_value = self.response( - self.json_bytes(payload), - status=self.response_status - ) - with self.assertRaises((unit_test_api.ApiValueError, unit_test_api.ApiTypeError)): - self.api.post( - accept_content_types=(accept_content_type,) - ) - self.assert_pool_manager_request_called_with( - mock_request, - self.api_config.get_server_url('servers', None) + "/responseBody/postAllofWithTheFirstEmptySchemaResponseBodyForContentTypes", - method='post'.upper(), - content_type=None, - accept_content_type=accept_content_type, - ) - - def test_number_is_valid_passes(self): - # number is valid - accept_content_type = 'application/json' - - with patch.object(urllib3.PoolManager, 'request') as mock_request: - payload = ( - 1 - ) - mock_request.return_value = self.response( - self.json_bytes(payload), - status=self.response_status - ) - api_response = self.api.post( - accept_content_types=(accept_content_type,) - ) - self.assert_pool_manager_request_called_with( - mock_request, - self.api_config.get_server_url('servers', None) + "/responseBody/postAllofWithTheFirstEmptySchemaResponseBodyForContentTypes", - method='post'.upper(), - accept_content_type=accept_content_type, - ) - - assert isinstance(api_response.response, urllib3.HTTPResponse) - assert isinstance(api_response.body, self.response_body_schema) - deserialized_response_body = self.response_body_schema.from_openapi_data_( - payload, - configuration_=self.schema_config - ) - assert api_response.body == deserialized_response_body - -if __name__ == '__main__': - unittest.main() diff --git a/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_response_body_post_allof_with_the_last_empty_schema_response_body_for_content_types/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_response_body_post_allof_with_the_last_empty_schema_response_body_for_content_types/__init__.py index 0c6d35e7ceb..e69de29bb2d 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_response_body_post_allof_with_the_last_empty_schema_response_body_for_content_types/__init__.py +++ b/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_response_body_post_allof_with_the_last_empty_schema_response_body_for_content_types/__init__.py @@ -1,89 +0,0 @@ -# coding: utf-8 - -""" - - - Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator -""" - -import unittest -from unittest.mock import patch - -import urllib3 - -import unit_test_api -from unit_test_api.paths.response_body_post_allof_with_the_last_empty_schema_response_body_for_content_types.post import operation as post # noqa: E501 -from unit_test_api import schemas, api_client -from unit_test_api.configurations import api_configuration, schema_configuration - -from .. import ApiTestMixin - - -class TestPost(ApiTestMixin, unittest.TestCase): - """ - Post unit test stubs - """ - api_config = api_configuration.ApiConfiguration() - schema_config = schema_configuration.SchemaConfiguration() - used_api_client = api_client.ApiClient(configuration=api_config, schema_config=schema_config) - api = post.ApiForPost(api_client=used_api_client) # noqa: E501 - - response_status = 200 - response_body_schema = post.response_200.ResponseFor200.content["application/json"].schema - - def test_string_is_invalid_fails(self): - # string is invalid - accept_content_type = 'application/json' - - with patch.object(urllib3.PoolManager, 'request') as mock_request: - payload = ( - "foo" - ) - mock_request.return_value = self.response( - self.json_bytes(payload), - status=self.response_status - ) - with self.assertRaises((unit_test_api.ApiValueError, unit_test_api.ApiTypeError)): - self.api.post( - accept_content_types=(accept_content_type,) - ) - self.assert_pool_manager_request_called_with( - mock_request, - self.api_config.get_server_url('servers', None) + "/responseBody/postAllofWithTheLastEmptySchemaResponseBodyForContentTypes", - method='post'.upper(), - content_type=None, - accept_content_type=accept_content_type, - ) - - def test_number_is_valid_passes(self): - # number is valid - accept_content_type = 'application/json' - - with patch.object(urllib3.PoolManager, 'request') as mock_request: - payload = ( - 1 - ) - mock_request.return_value = self.response( - self.json_bytes(payload), - status=self.response_status - ) - api_response = self.api.post( - accept_content_types=(accept_content_type,) - ) - self.assert_pool_manager_request_called_with( - mock_request, - self.api_config.get_server_url('servers', None) + "/responseBody/postAllofWithTheLastEmptySchemaResponseBodyForContentTypes", - method='post'.upper(), - accept_content_type=accept_content_type, - ) - - assert isinstance(api_response.response, urllib3.HTTPResponse) - assert isinstance(api_response.body, self.response_body_schema) - deserialized_response_body = self.response_body_schema.from_openapi_data_( - payload, - configuration_=self.schema_config - ) - assert api_response.body == deserialized_response_body - -if __name__ == '__main__': - unittest.main() diff --git a/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_response_body_post_allof_with_two_empty_schemas_response_body_for_content_types/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_response_body_post_allof_with_two_empty_schemas_response_body_for_content_types/__init__.py index 8ffc6cf4931..e69de29bb2d 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_response_body_post_allof_with_two_empty_schemas_response_body_for_content_types/__init__.py +++ b/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_response_body_post_allof_with_two_empty_schemas_response_body_for_content_types/__init__.py @@ -1,65 +0,0 @@ -# coding: utf-8 - -""" - - - Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator -""" - -import unittest -from unittest.mock import patch - -import urllib3 - -import unit_test_api -from unit_test_api.paths.response_body_post_allof_with_two_empty_schemas_response_body_for_content_types.post import operation as post # noqa: E501 -from unit_test_api import schemas, api_client -from unit_test_api.configurations import api_configuration, schema_configuration - -from .. import ApiTestMixin - - -class TestPost(ApiTestMixin, unittest.TestCase): - """ - Post unit test stubs - """ - api_config = api_configuration.ApiConfiguration() - schema_config = schema_configuration.SchemaConfiguration() - used_api_client = api_client.ApiClient(configuration=api_config, schema_config=schema_config) - api = post.ApiForPost(api_client=used_api_client) # noqa: E501 - - response_status = 200 - response_body_schema = post.response_200.ResponseFor200.content["application/json"].schema - - def test_any_data_is_valid_passes(self): - # any data is valid - accept_content_type = 'application/json' - - with patch.object(urllib3.PoolManager, 'request') as mock_request: - payload = ( - 1 - ) - mock_request.return_value = self.response( - self.json_bytes(payload), - status=self.response_status - ) - api_response = self.api.post( - accept_content_types=(accept_content_type,) - ) - self.assert_pool_manager_request_called_with( - mock_request, - self.api_config.get_server_url('servers', None) + "/responseBody/postAllofWithTwoEmptySchemasResponseBodyForContentTypes", - method='post'.upper(), - accept_content_type=accept_content_type, - ) - - assert isinstance(api_response.response, urllib3.HTTPResponse) - assert isinstance(api_response.body, self.response_body_schema) - deserialized_response_body = self.response_body_schema.from_openapi_data_( - payload, - configuration_=self.schema_config - ) - assert api_response.body == deserialized_response_body - -if __name__ == '__main__': - unittest.main() diff --git a/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_response_body_post_anyof_complex_types_response_body_for_content_types/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_response_body_post_anyof_complex_types_response_body_for_content_types/__init__.py index 5fdd984b4ac..e69de29bb2d 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_response_body_post_anyof_complex_types_response_body_for_content_types/__init__.py +++ b/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_response_body_post_anyof_complex_types_response_body_for_content_types/__init__.py @@ -1,165 +0,0 @@ -# coding: utf-8 - -""" - - - Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator -""" - -import unittest -from unittest.mock import patch - -import urllib3 - -import unit_test_api -from unit_test_api.paths.response_body_post_anyof_complex_types_response_body_for_content_types.post import operation as post # noqa: E501 -from unit_test_api import schemas, api_client -from unit_test_api.configurations import api_configuration, schema_configuration - -from .. import ApiTestMixin - - -class TestPost(ApiTestMixin, unittest.TestCase): - """ - Post unit test stubs - """ - api_config = api_configuration.ApiConfiguration() - schema_config = schema_configuration.SchemaConfiguration() - used_api_client = api_client.ApiClient(configuration=api_config, schema_config=schema_config) - api = post.ApiForPost(api_client=used_api_client) # noqa: E501 - - response_status = 200 - response_body_schema = post.response_200.ResponseFor200.content["application/json"].schema - - def test_second_anyof_valid_complex_passes(self): - # second anyOf valid (complex) - accept_content_type = 'application/json' - - with patch.object(urllib3.PoolManager, 'request') as mock_request: - payload = ( - { - "foo": - "baz", - } - ) - mock_request.return_value = self.response( - self.json_bytes(payload), - status=self.response_status - ) - api_response = self.api.post( - accept_content_types=(accept_content_type,) - ) - self.assert_pool_manager_request_called_with( - mock_request, - self.api_config.get_server_url('servers', None) + "/responseBody/postAnyofComplexTypesResponseBodyForContentTypes", - method='post'.upper(), - accept_content_type=accept_content_type, - ) - - assert isinstance(api_response.response, urllib3.HTTPResponse) - assert isinstance(api_response.body, self.response_body_schema) - deserialized_response_body = self.response_body_schema.from_openapi_data_( - payload, - configuration_=self.schema_config - ) - assert api_response.body == deserialized_response_body - - def test_neither_anyof_valid_complex_fails(self): - # neither anyOf valid (complex) - accept_content_type = 'application/json' - - with patch.object(urllib3.PoolManager, 'request') as mock_request: - payload = ( - { - "foo": - 2, - "bar": - "quux", - } - ) - mock_request.return_value = self.response( - self.json_bytes(payload), - status=self.response_status - ) - with self.assertRaises((unit_test_api.ApiValueError, unit_test_api.ApiTypeError)): - self.api.post( - accept_content_types=(accept_content_type,) - ) - self.assert_pool_manager_request_called_with( - mock_request, - self.api_config.get_server_url('servers', None) + "/responseBody/postAnyofComplexTypesResponseBodyForContentTypes", - method='post'.upper(), - content_type=None, - accept_content_type=accept_content_type, - ) - - def test_both_anyof_valid_complex_passes(self): - # both anyOf valid (complex) - accept_content_type = 'application/json' - - with patch.object(urllib3.PoolManager, 'request') as mock_request: - payload = ( - { - "foo": - "baz", - "bar": - 2, - } - ) - mock_request.return_value = self.response( - self.json_bytes(payload), - status=self.response_status - ) - api_response = self.api.post( - accept_content_types=(accept_content_type,) - ) - self.assert_pool_manager_request_called_with( - mock_request, - self.api_config.get_server_url('servers', None) + "/responseBody/postAnyofComplexTypesResponseBodyForContentTypes", - method='post'.upper(), - accept_content_type=accept_content_type, - ) - - assert isinstance(api_response.response, urllib3.HTTPResponse) - assert isinstance(api_response.body, self.response_body_schema) - deserialized_response_body = self.response_body_schema.from_openapi_data_( - payload, - configuration_=self.schema_config - ) - assert api_response.body == deserialized_response_body - - def test_first_anyof_valid_complex_passes(self): - # first anyOf valid (complex) - accept_content_type = 'application/json' - - with patch.object(urllib3.PoolManager, 'request') as mock_request: - payload = ( - { - "bar": - 2, - } - ) - mock_request.return_value = self.response( - self.json_bytes(payload), - status=self.response_status - ) - api_response = self.api.post( - accept_content_types=(accept_content_type,) - ) - self.assert_pool_manager_request_called_with( - mock_request, - self.api_config.get_server_url('servers', None) + "/responseBody/postAnyofComplexTypesResponseBodyForContentTypes", - method='post'.upper(), - accept_content_type=accept_content_type, - ) - - assert isinstance(api_response.response, urllib3.HTTPResponse) - assert isinstance(api_response.body, self.response_body_schema) - deserialized_response_body = self.response_body_schema.from_openapi_data_( - payload, - configuration_=self.schema_config - ) - assert api_response.body == deserialized_response_body - -if __name__ == '__main__': - unittest.main() diff --git a/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_response_body_post_anyof_response_body_for_content_types/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_response_body_post_anyof_response_body_for_content_types/__init__.py index ccea3c606b1..e69de29bb2d 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_response_body_post_anyof_response_body_for_content_types/__init__.py +++ b/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_response_body_post_anyof_response_body_for_content_types/__init__.py @@ -1,149 +0,0 @@ -# coding: utf-8 - -""" - - - Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator -""" - -import unittest -from unittest.mock import patch - -import urllib3 - -import unit_test_api -from unit_test_api.paths.response_body_post_anyof_response_body_for_content_types.post import operation as post # noqa: E501 -from unit_test_api import schemas, api_client -from unit_test_api.configurations import api_configuration, schema_configuration - -from .. import ApiTestMixin - - -class TestPost(ApiTestMixin, unittest.TestCase): - """ - Post unit test stubs - """ - api_config = api_configuration.ApiConfiguration() - schema_config = schema_configuration.SchemaConfiguration() - used_api_client = api_client.ApiClient(configuration=api_config, schema_config=schema_config) - api = post.ApiForPost(api_client=used_api_client) # noqa: E501 - - response_status = 200 - response_body_schema = post.response_200.ResponseFor200.content["application/json"].schema - - def test_second_anyof_valid_passes(self): - # second anyOf valid - accept_content_type = 'application/json' - - with patch.object(urllib3.PoolManager, 'request') as mock_request: - payload = ( - 2.5 - ) - mock_request.return_value = self.response( - self.json_bytes(payload), - status=self.response_status - ) - api_response = self.api.post( - accept_content_types=(accept_content_type,) - ) - self.assert_pool_manager_request_called_with( - mock_request, - self.api_config.get_server_url('servers', None) + "/responseBody/postAnyofResponseBodyForContentTypes", - method='post'.upper(), - accept_content_type=accept_content_type, - ) - - assert isinstance(api_response.response, urllib3.HTTPResponse) - assert isinstance(api_response.body, self.response_body_schema) - deserialized_response_body = self.response_body_schema.from_openapi_data_( - payload, - configuration_=self.schema_config - ) - assert api_response.body == deserialized_response_body - - def test_neither_anyof_valid_fails(self): - # neither anyOf valid - accept_content_type = 'application/json' - - with patch.object(urllib3.PoolManager, 'request') as mock_request: - payload = ( - 1.5 - ) - mock_request.return_value = self.response( - self.json_bytes(payload), - status=self.response_status - ) - with self.assertRaises((unit_test_api.ApiValueError, unit_test_api.ApiTypeError)): - self.api.post( - accept_content_types=(accept_content_type,) - ) - self.assert_pool_manager_request_called_with( - mock_request, - self.api_config.get_server_url('servers', None) + "/responseBody/postAnyofResponseBodyForContentTypes", - method='post'.upper(), - content_type=None, - accept_content_type=accept_content_type, - ) - - def test_both_anyof_valid_passes(self): - # both anyOf valid - accept_content_type = 'application/json' - - with patch.object(urllib3.PoolManager, 'request') as mock_request: - payload = ( - 3 - ) - mock_request.return_value = self.response( - self.json_bytes(payload), - status=self.response_status - ) - api_response = self.api.post( - accept_content_types=(accept_content_type,) - ) - self.assert_pool_manager_request_called_with( - mock_request, - self.api_config.get_server_url('servers', None) + "/responseBody/postAnyofResponseBodyForContentTypes", - method='post'.upper(), - accept_content_type=accept_content_type, - ) - - assert isinstance(api_response.response, urllib3.HTTPResponse) - assert isinstance(api_response.body, self.response_body_schema) - deserialized_response_body = self.response_body_schema.from_openapi_data_( - payload, - configuration_=self.schema_config - ) - assert api_response.body == deserialized_response_body - - def test_first_anyof_valid_passes(self): - # first anyOf valid - accept_content_type = 'application/json' - - with patch.object(urllib3.PoolManager, 'request') as mock_request: - payload = ( - 1 - ) - mock_request.return_value = self.response( - self.json_bytes(payload), - status=self.response_status - ) - api_response = self.api.post( - accept_content_types=(accept_content_type,) - ) - self.assert_pool_manager_request_called_with( - mock_request, - self.api_config.get_server_url('servers', None) + "/responseBody/postAnyofResponseBodyForContentTypes", - method='post'.upper(), - accept_content_type=accept_content_type, - ) - - assert isinstance(api_response.response, urllib3.HTTPResponse) - assert isinstance(api_response.body, self.response_body_schema) - deserialized_response_body = self.response_body_schema.from_openapi_data_( - payload, - configuration_=self.schema_config - ) - assert api_response.body == deserialized_response_body - -if __name__ == '__main__': - unittest.main() diff --git a/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_response_body_post_anyof_with_base_schema_response_body_for_content_types/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_response_body_post_anyof_with_base_schema_response_body_for_content_types/__init__.py index 998430f148b..e69de29bb2d 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_response_body_post_anyof_with_base_schema_response_body_for_content_types/__init__.py +++ b/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_response_body_post_anyof_with_base_schema_response_body_for_content_types/__init__.py @@ -1,113 +0,0 @@ -# coding: utf-8 - -""" - - - Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator -""" - -import unittest -from unittest.mock import patch - -import urllib3 - -import unit_test_api -from unit_test_api.paths.response_body_post_anyof_with_base_schema_response_body_for_content_types.post import operation as post # noqa: E501 -from unit_test_api import schemas, api_client -from unit_test_api.configurations import api_configuration, schema_configuration - -from .. import ApiTestMixin - - -class TestPost(ApiTestMixin, unittest.TestCase): - """ - Post unit test stubs - """ - api_config = api_configuration.ApiConfiguration() - schema_config = schema_configuration.SchemaConfiguration() - used_api_client = api_client.ApiClient(configuration=api_config, schema_config=schema_config) - api = post.ApiForPost(api_client=used_api_client) # noqa: E501 - - response_status = 200 - response_body_schema = post.response_200.ResponseFor200.content["application/json"].schema - - def test_one_anyof_valid_passes(self): - # one anyOf valid - accept_content_type = 'application/json' - - with patch.object(urllib3.PoolManager, 'request') as mock_request: - payload = ( - "foobar" - ) - mock_request.return_value = self.response( - self.json_bytes(payload), - status=self.response_status - ) - api_response = self.api.post( - accept_content_types=(accept_content_type,) - ) - self.assert_pool_manager_request_called_with( - mock_request, - self.api_config.get_server_url('servers', None) + "/responseBody/postAnyofWithBaseSchemaResponseBodyForContentTypes", - method='post'.upper(), - accept_content_type=accept_content_type, - ) - - assert isinstance(api_response.response, urllib3.HTTPResponse) - assert isinstance(api_response.body, self.response_body_schema) - deserialized_response_body = self.response_body_schema.from_openapi_data_( - payload, - configuration_=self.schema_config - ) - assert api_response.body == deserialized_response_body - - def test_both_anyof_invalid_fails(self): - # both anyOf invalid - accept_content_type = 'application/json' - - with patch.object(urllib3.PoolManager, 'request') as mock_request: - payload = ( - "foo" - ) - mock_request.return_value = self.response( - self.json_bytes(payload), - status=self.response_status - ) - with self.assertRaises((unit_test_api.ApiValueError, unit_test_api.ApiTypeError)): - self.api.post( - accept_content_types=(accept_content_type,) - ) - self.assert_pool_manager_request_called_with( - mock_request, - self.api_config.get_server_url('servers', None) + "/responseBody/postAnyofWithBaseSchemaResponseBodyForContentTypes", - method='post'.upper(), - content_type=None, - accept_content_type=accept_content_type, - ) - - def test_mismatch_base_schema_fails(self): - # mismatch base schema - accept_content_type = 'application/json' - - with patch.object(urllib3.PoolManager, 'request') as mock_request: - payload = ( - 3 - ) - mock_request.return_value = self.response( - self.json_bytes(payload), - status=self.response_status - ) - with self.assertRaises((unit_test_api.ApiValueError, unit_test_api.ApiTypeError)): - self.api.post( - accept_content_types=(accept_content_type,) - ) - self.assert_pool_manager_request_called_with( - mock_request, - self.api_config.get_server_url('servers', None) + "/responseBody/postAnyofWithBaseSchemaResponseBodyForContentTypes", - method='post'.upper(), - content_type=None, - accept_content_type=accept_content_type, - ) - -if __name__ == '__main__': - unittest.main() diff --git a/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_response_body_post_anyof_with_one_empty_schema_response_body_for_content_types/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_response_body_post_anyof_with_one_empty_schema_response_body_for_content_types/__init__.py index 11de507eeff..e69de29bb2d 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_response_body_post_anyof_with_one_empty_schema_response_body_for_content_types/__init__.py +++ b/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_response_body_post_anyof_with_one_empty_schema_response_body_for_content_types/__init__.py @@ -1,95 +0,0 @@ -# coding: utf-8 - -""" - - - Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator -""" - -import unittest -from unittest.mock import patch - -import urllib3 - -import unit_test_api -from unit_test_api.paths.response_body_post_anyof_with_one_empty_schema_response_body_for_content_types.post import operation as post # noqa: E501 -from unit_test_api import schemas, api_client -from unit_test_api.configurations import api_configuration, schema_configuration - -from .. import ApiTestMixin - - -class TestPost(ApiTestMixin, unittest.TestCase): - """ - Post unit test stubs - """ - api_config = api_configuration.ApiConfiguration() - schema_config = schema_configuration.SchemaConfiguration() - used_api_client = api_client.ApiClient(configuration=api_config, schema_config=schema_config) - api = post.ApiForPost(api_client=used_api_client) # noqa: E501 - - response_status = 200 - response_body_schema = post.response_200.ResponseFor200.content["application/json"].schema - - def test_string_is_valid_passes(self): - # string is valid - accept_content_type = 'application/json' - - with patch.object(urllib3.PoolManager, 'request') as mock_request: - payload = ( - "foo" - ) - mock_request.return_value = self.response( - self.json_bytes(payload), - status=self.response_status - ) - api_response = self.api.post( - accept_content_types=(accept_content_type,) - ) - self.assert_pool_manager_request_called_with( - mock_request, - self.api_config.get_server_url('servers', None) + "/responseBody/postAnyofWithOneEmptySchemaResponseBodyForContentTypes", - method='post'.upper(), - accept_content_type=accept_content_type, - ) - - assert isinstance(api_response.response, urllib3.HTTPResponse) - assert isinstance(api_response.body, self.response_body_schema) - deserialized_response_body = self.response_body_schema.from_openapi_data_( - payload, - configuration_=self.schema_config - ) - assert api_response.body == deserialized_response_body - - def test_number_is_valid_passes(self): - # number is valid - accept_content_type = 'application/json' - - with patch.object(urllib3.PoolManager, 'request') as mock_request: - payload = ( - 123 - ) - mock_request.return_value = self.response( - self.json_bytes(payload), - status=self.response_status - ) - api_response = self.api.post( - accept_content_types=(accept_content_type,) - ) - self.assert_pool_manager_request_called_with( - mock_request, - self.api_config.get_server_url('servers', None) + "/responseBody/postAnyofWithOneEmptySchemaResponseBodyForContentTypes", - method='post'.upper(), - accept_content_type=accept_content_type, - ) - - assert isinstance(api_response.response, urllib3.HTTPResponse) - assert isinstance(api_response.body, self.response_body_schema) - deserialized_response_body = self.response_body_schema.from_openapi_data_( - payload, - configuration_=self.schema_config - ) - assert api_response.body == deserialized_response_body - -if __name__ == '__main__': - unittest.main() diff --git a/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_response_body_post_array_type_matches_arrays_response_body_for_content_types/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_response_body_post_array_type_matches_arrays_response_body_for_content_types/__init__.py index c2e9a8e6ef4..e69de29bb2d 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_response_body_post_array_type_matches_arrays_response_body_for_content_types/__init__.py +++ b/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_response_body_post_array_type_matches_arrays_response_body_for_content_types/__init__.py @@ -1,211 +0,0 @@ -# coding: utf-8 - -""" - - - Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator -""" - -import unittest -from unittest.mock import patch - -import urllib3 - -import unit_test_api -from unit_test_api.paths.response_body_post_array_type_matches_arrays_response_body_for_content_types.post import operation as post # noqa: E501 -from unit_test_api import schemas, api_client -from unit_test_api.configurations import api_configuration, schema_configuration - -from .. import ApiTestMixin - - -class TestPost(ApiTestMixin, unittest.TestCase): - """ - Post unit test stubs - """ - api_config = api_configuration.ApiConfiguration() - schema_config = schema_configuration.SchemaConfiguration() - used_api_client = api_client.ApiClient(configuration=api_config, schema_config=schema_config) - api = post.ApiForPost(api_client=used_api_client) # noqa: E501 - - response_status = 200 - response_body_schema = post.response_200.ResponseFor200.content["application/json"].schema - - def test_a_float_is_not_an_array_fails(self): - # a float is not an array - accept_content_type = 'application/json' - - with patch.object(urllib3.PoolManager, 'request') as mock_request: - payload = ( - 1.1 - ) - mock_request.return_value = self.response( - self.json_bytes(payload), - status=self.response_status - ) - with self.assertRaises((unit_test_api.ApiValueError, unit_test_api.ApiTypeError)): - self.api.post( - accept_content_types=(accept_content_type,) - ) - self.assert_pool_manager_request_called_with( - mock_request, - self.api_config.get_server_url('servers', None) + "/responseBody/postArrayTypeMatchesArraysResponseBodyForContentTypes", - method='post'.upper(), - content_type=None, - accept_content_type=accept_content_type, - ) - - def test_a_boolean_is_not_an_array_fails(self): - # a boolean is not an array - accept_content_type = 'application/json' - - with patch.object(urllib3.PoolManager, 'request') as mock_request: - payload = ( - True - ) - mock_request.return_value = self.response( - self.json_bytes(payload), - status=self.response_status - ) - with self.assertRaises((unit_test_api.ApiValueError, unit_test_api.ApiTypeError)): - self.api.post( - accept_content_types=(accept_content_type,) - ) - self.assert_pool_manager_request_called_with( - mock_request, - self.api_config.get_server_url('servers', None) + "/responseBody/postArrayTypeMatchesArraysResponseBodyForContentTypes", - method='post'.upper(), - content_type=None, - accept_content_type=accept_content_type, - ) - - def test_null_is_not_an_array_fails(self): - # null is not an array - accept_content_type = 'application/json' - - with patch.object(urllib3.PoolManager, 'request') as mock_request: - payload = ( - None - ) - mock_request.return_value = self.response( - self.json_bytes(payload), - status=self.response_status - ) - with self.assertRaises((unit_test_api.ApiValueError, unit_test_api.ApiTypeError)): - self.api.post( - accept_content_types=(accept_content_type,) - ) - self.assert_pool_manager_request_called_with( - mock_request, - self.api_config.get_server_url('servers', None) + "/responseBody/postArrayTypeMatchesArraysResponseBodyForContentTypes", - method='post'.upper(), - content_type=None, - accept_content_type=accept_content_type, - ) - - def test_an_object_is_not_an_array_fails(self): - # an object is not an array - accept_content_type = 'application/json' - - with patch.object(urllib3.PoolManager, 'request') as mock_request: - payload = ( - { - } - ) - mock_request.return_value = self.response( - self.json_bytes(payload), - status=self.response_status - ) - with self.assertRaises((unit_test_api.ApiValueError, unit_test_api.ApiTypeError)): - self.api.post( - accept_content_types=(accept_content_type,) - ) - self.assert_pool_manager_request_called_with( - mock_request, - self.api_config.get_server_url('servers', None) + "/responseBody/postArrayTypeMatchesArraysResponseBodyForContentTypes", - method='post'.upper(), - content_type=None, - accept_content_type=accept_content_type, - ) - - def test_a_string_is_not_an_array_fails(self): - # a string is not an array - accept_content_type = 'application/json' - - with patch.object(urllib3.PoolManager, 'request') as mock_request: - payload = ( - "foo" - ) - mock_request.return_value = self.response( - self.json_bytes(payload), - status=self.response_status - ) - with self.assertRaises((unit_test_api.ApiValueError, unit_test_api.ApiTypeError)): - self.api.post( - accept_content_types=(accept_content_type,) - ) - self.assert_pool_manager_request_called_with( - mock_request, - self.api_config.get_server_url('servers', None) + "/responseBody/postArrayTypeMatchesArraysResponseBodyForContentTypes", - method='post'.upper(), - content_type=None, - accept_content_type=accept_content_type, - ) - - def test_an_array_is_an_array_passes(self): - # an array is an array - accept_content_type = 'application/json' - - with patch.object(urllib3.PoolManager, 'request') as mock_request: - payload = ( - [ - ] - ) - mock_request.return_value = self.response( - self.json_bytes(payload), - status=self.response_status - ) - api_response = self.api.post( - accept_content_types=(accept_content_type,) - ) - self.assert_pool_manager_request_called_with( - mock_request, - self.api_config.get_server_url('servers', None) + "/responseBody/postArrayTypeMatchesArraysResponseBodyForContentTypes", - method='post'.upper(), - accept_content_type=accept_content_type, - ) - - assert isinstance(api_response.response, urllib3.HTTPResponse) - assert isinstance(api_response.body, self.response_body_schema) - deserialized_response_body = self.response_body_schema.from_openapi_data_( - payload, - configuration_=self.schema_config - ) - assert api_response.body == deserialized_response_body - - def test_an_integer_is_not_an_array_fails(self): - # an integer is not an array - accept_content_type = 'application/json' - - with patch.object(urllib3.PoolManager, 'request') as mock_request: - payload = ( - 1 - ) - mock_request.return_value = self.response( - self.json_bytes(payload), - status=self.response_status - ) - with self.assertRaises((unit_test_api.ApiValueError, unit_test_api.ApiTypeError)): - self.api.post( - accept_content_types=(accept_content_type,) - ) - self.assert_pool_manager_request_called_with( - mock_request, - self.api_config.get_server_url('servers', None) + "/responseBody/postArrayTypeMatchesArraysResponseBodyForContentTypes", - method='post'.upper(), - content_type=None, - accept_content_type=accept_content_type, - ) - -if __name__ == '__main__': - unittest.main() diff --git a/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_response_body_post_boolean_type_matches_booleans_response_body_for_content_types/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_response_body_post_boolean_type_matches_booleans_response_body_for_content_types/__init__.py index ed32e44e7ec..e69de29bb2d 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_response_body_post_boolean_type_matches_booleans_response_body_for_content_types/__init__.py +++ b/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_response_body_post_boolean_type_matches_booleans_response_body_for_content_types/__init__.py @@ -1,289 +0,0 @@ -# coding: utf-8 - -""" - - - Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator -""" - -import unittest -from unittest.mock import patch - -import urllib3 - -import unit_test_api -from unit_test_api.paths.response_body_post_boolean_type_matches_booleans_response_body_for_content_types.post import operation as post # noqa: E501 -from unit_test_api import schemas, api_client -from unit_test_api.configurations import api_configuration, schema_configuration - -from .. import ApiTestMixin - - -class TestPost(ApiTestMixin, unittest.TestCase): - """ - Post unit test stubs - """ - api_config = api_configuration.ApiConfiguration() - schema_config = schema_configuration.SchemaConfiguration() - used_api_client = api_client.ApiClient(configuration=api_config, schema_config=schema_config) - api = post.ApiForPost(api_client=used_api_client) # noqa: E501 - - response_status = 200 - response_body_schema = post.response_200.ResponseFor200.content["application/json"].schema - - def test_an_empty_string_is_not_a_boolean_fails(self): - # an empty string is not a boolean - accept_content_type = 'application/json' - - with patch.object(urllib3.PoolManager, 'request') as mock_request: - payload = ( - "" - ) - mock_request.return_value = self.response( - self.json_bytes(payload), - status=self.response_status - ) - with self.assertRaises((unit_test_api.ApiValueError, unit_test_api.ApiTypeError)): - self.api.post( - accept_content_types=(accept_content_type,) - ) - self.assert_pool_manager_request_called_with( - mock_request, - self.api_config.get_server_url('servers', None) + "/responseBody/postBooleanTypeMatchesBooleansResponseBodyForContentTypes", - method='post'.upper(), - content_type=None, - accept_content_type=accept_content_type, - ) - - def test_a_float_is_not_a_boolean_fails(self): - # a float is not a boolean - accept_content_type = 'application/json' - - with patch.object(urllib3.PoolManager, 'request') as mock_request: - payload = ( - 1.1 - ) - mock_request.return_value = self.response( - self.json_bytes(payload), - status=self.response_status - ) - with self.assertRaises((unit_test_api.ApiValueError, unit_test_api.ApiTypeError)): - self.api.post( - accept_content_types=(accept_content_type,) - ) - self.assert_pool_manager_request_called_with( - mock_request, - self.api_config.get_server_url('servers', None) + "/responseBody/postBooleanTypeMatchesBooleansResponseBodyForContentTypes", - method='post'.upper(), - content_type=None, - accept_content_type=accept_content_type, - ) - - def test_null_is_not_a_boolean_fails(self): - # null is not a boolean - accept_content_type = 'application/json' - - with patch.object(urllib3.PoolManager, 'request') as mock_request: - payload = ( - None - ) - mock_request.return_value = self.response( - self.json_bytes(payload), - status=self.response_status - ) - with self.assertRaises((unit_test_api.ApiValueError, unit_test_api.ApiTypeError)): - self.api.post( - accept_content_types=(accept_content_type,) - ) - self.assert_pool_manager_request_called_with( - mock_request, - self.api_config.get_server_url('servers', None) + "/responseBody/postBooleanTypeMatchesBooleansResponseBodyForContentTypes", - method='post'.upper(), - content_type=None, - accept_content_type=accept_content_type, - ) - - def test_zero_is_not_a_boolean_fails(self): - # zero is not a boolean - accept_content_type = 'application/json' - - with patch.object(urllib3.PoolManager, 'request') as mock_request: - payload = ( - 0 - ) - mock_request.return_value = self.response( - self.json_bytes(payload), - status=self.response_status - ) - with self.assertRaises((unit_test_api.ApiValueError, unit_test_api.ApiTypeError)): - self.api.post( - accept_content_types=(accept_content_type,) - ) - self.assert_pool_manager_request_called_with( - mock_request, - self.api_config.get_server_url('servers', None) + "/responseBody/postBooleanTypeMatchesBooleansResponseBodyForContentTypes", - method='post'.upper(), - content_type=None, - accept_content_type=accept_content_type, - ) - - def test_an_array_is_not_a_boolean_fails(self): - # an array is not a boolean - accept_content_type = 'application/json' - - with patch.object(urllib3.PoolManager, 'request') as mock_request: - payload = ( - [ - ] - ) - mock_request.return_value = self.response( - self.json_bytes(payload), - status=self.response_status - ) - with self.assertRaises((unit_test_api.ApiValueError, unit_test_api.ApiTypeError)): - self.api.post( - accept_content_types=(accept_content_type,) - ) - self.assert_pool_manager_request_called_with( - mock_request, - self.api_config.get_server_url('servers', None) + "/responseBody/postBooleanTypeMatchesBooleansResponseBodyForContentTypes", - method='post'.upper(), - content_type=None, - accept_content_type=accept_content_type, - ) - - def test_a_string_is_not_a_boolean_fails(self): - # a string is not a boolean - accept_content_type = 'application/json' - - with patch.object(urllib3.PoolManager, 'request') as mock_request: - payload = ( - "foo" - ) - mock_request.return_value = self.response( - self.json_bytes(payload), - status=self.response_status - ) - with self.assertRaises((unit_test_api.ApiValueError, unit_test_api.ApiTypeError)): - self.api.post( - accept_content_types=(accept_content_type,) - ) - self.assert_pool_manager_request_called_with( - mock_request, - self.api_config.get_server_url('servers', None) + "/responseBody/postBooleanTypeMatchesBooleansResponseBodyForContentTypes", - method='post'.upper(), - content_type=None, - accept_content_type=accept_content_type, - ) - - def test_false_is_a_boolean_passes(self): - # false is a boolean - accept_content_type = 'application/json' - - with patch.object(urllib3.PoolManager, 'request') as mock_request: - payload = ( - False - ) - mock_request.return_value = self.response( - self.json_bytes(payload), - status=self.response_status - ) - api_response = self.api.post( - accept_content_types=(accept_content_type,) - ) - self.assert_pool_manager_request_called_with( - mock_request, - self.api_config.get_server_url('servers', None) + "/responseBody/postBooleanTypeMatchesBooleansResponseBodyForContentTypes", - method='post'.upper(), - accept_content_type=accept_content_type, - ) - - assert isinstance(api_response.response, urllib3.HTTPResponse) - assert isinstance(api_response.body, self.response_body_schema) - deserialized_response_body = self.response_body_schema.from_openapi_data_( - payload, - configuration_=self.schema_config - ) - assert api_response.body == deserialized_response_body - - def test_an_integer_is_not_a_boolean_fails(self): - # an integer is not a boolean - accept_content_type = 'application/json' - - with patch.object(urllib3.PoolManager, 'request') as mock_request: - payload = ( - 1 - ) - mock_request.return_value = self.response( - self.json_bytes(payload), - status=self.response_status - ) - with self.assertRaises((unit_test_api.ApiValueError, unit_test_api.ApiTypeError)): - self.api.post( - accept_content_types=(accept_content_type,) - ) - self.assert_pool_manager_request_called_with( - mock_request, - self.api_config.get_server_url('servers', None) + "/responseBody/postBooleanTypeMatchesBooleansResponseBodyForContentTypes", - method='post'.upper(), - content_type=None, - accept_content_type=accept_content_type, - ) - - def test_true_is_a_boolean_passes(self): - # true is a boolean - accept_content_type = 'application/json' - - with patch.object(urllib3.PoolManager, 'request') as mock_request: - payload = ( - True - ) - mock_request.return_value = self.response( - self.json_bytes(payload), - status=self.response_status - ) - api_response = self.api.post( - accept_content_types=(accept_content_type,) - ) - self.assert_pool_manager_request_called_with( - mock_request, - self.api_config.get_server_url('servers', None) + "/responseBody/postBooleanTypeMatchesBooleansResponseBodyForContentTypes", - method='post'.upper(), - accept_content_type=accept_content_type, - ) - - assert isinstance(api_response.response, urllib3.HTTPResponse) - assert isinstance(api_response.body, self.response_body_schema) - deserialized_response_body = self.response_body_schema.from_openapi_data_( - payload, - configuration_=self.schema_config - ) - assert api_response.body == deserialized_response_body - - def test_an_object_is_not_a_boolean_fails(self): - # an object is not a boolean - accept_content_type = 'application/json' - - with patch.object(urllib3.PoolManager, 'request') as mock_request: - payload = ( - { - } - ) - mock_request.return_value = self.response( - self.json_bytes(payload), - status=self.response_status - ) - with self.assertRaises((unit_test_api.ApiValueError, unit_test_api.ApiTypeError)): - self.api.post( - accept_content_types=(accept_content_type,) - ) - self.assert_pool_manager_request_called_with( - mock_request, - self.api_config.get_server_url('servers', None) + "/responseBody/postBooleanTypeMatchesBooleansResponseBodyForContentTypes", - method='post'.upper(), - content_type=None, - accept_content_type=accept_content_type, - ) - -if __name__ == '__main__': - unittest.main() diff --git a/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_response_body_post_by_int_response_body_for_content_types/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_response_body_post_by_int_response_body_for_content_types/__init__.py index f327131eac8..e69de29bb2d 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_response_body_post_by_int_response_body_for_content_types/__init__.py +++ b/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_response_body_post_by_int_response_body_for_content_types/__init__.py @@ -1,119 +0,0 @@ -# coding: utf-8 - -""" - - - Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator -""" - -import unittest -from unittest.mock import patch - -import urllib3 - -import unit_test_api -from unit_test_api.paths.response_body_post_by_int_response_body_for_content_types.post import operation as post # noqa: E501 -from unit_test_api import schemas, api_client -from unit_test_api.configurations import api_configuration, schema_configuration - -from .. import ApiTestMixin - - -class TestPost(ApiTestMixin, unittest.TestCase): - """ - Post unit test stubs - """ - api_config = api_configuration.ApiConfiguration() - schema_config = schema_configuration.SchemaConfiguration() - used_api_client = api_client.ApiClient(configuration=api_config, schema_config=schema_config) - api = post.ApiForPost(api_client=used_api_client) # noqa: E501 - - response_status = 200 - response_body_schema = post.response_200.ResponseFor200.content["application/json"].schema - - def test_int_by_int_fail_fails(self): - # int by int fail - accept_content_type = 'application/json' - - with patch.object(urllib3.PoolManager, 'request') as mock_request: - payload = ( - 7 - ) - mock_request.return_value = self.response( - self.json_bytes(payload), - status=self.response_status - ) - with self.assertRaises((unit_test_api.ApiValueError, unit_test_api.ApiTypeError)): - self.api.post( - accept_content_types=(accept_content_type,) - ) - self.assert_pool_manager_request_called_with( - mock_request, - self.api_config.get_server_url('servers', None) + "/responseBody/postByIntResponseBodyForContentTypes", - method='post'.upper(), - content_type=None, - accept_content_type=accept_content_type, - ) - - def test_int_by_int_passes(self): - # int by int - accept_content_type = 'application/json' - - with patch.object(urllib3.PoolManager, 'request') as mock_request: - payload = ( - 10 - ) - mock_request.return_value = self.response( - self.json_bytes(payload), - status=self.response_status - ) - api_response = self.api.post( - accept_content_types=(accept_content_type,) - ) - self.assert_pool_manager_request_called_with( - mock_request, - self.api_config.get_server_url('servers', None) + "/responseBody/postByIntResponseBodyForContentTypes", - method='post'.upper(), - accept_content_type=accept_content_type, - ) - - assert isinstance(api_response.response, urllib3.HTTPResponse) - assert isinstance(api_response.body, self.response_body_schema) - deserialized_response_body = self.response_body_schema.from_openapi_data_( - payload, - configuration_=self.schema_config - ) - assert api_response.body == deserialized_response_body - - def test_ignores_non_numbers_passes(self): - # ignores non-numbers - accept_content_type = 'application/json' - - with patch.object(urllib3.PoolManager, 'request') as mock_request: - payload = ( - "foo" - ) - mock_request.return_value = self.response( - self.json_bytes(payload), - status=self.response_status - ) - api_response = self.api.post( - accept_content_types=(accept_content_type,) - ) - self.assert_pool_manager_request_called_with( - mock_request, - self.api_config.get_server_url('servers', None) + "/responseBody/postByIntResponseBodyForContentTypes", - method='post'.upper(), - accept_content_type=accept_content_type, - ) - - assert isinstance(api_response.response, urllib3.HTTPResponse) - assert isinstance(api_response.body, self.response_body_schema) - deserialized_response_body = self.response_body_schema.from_openapi_data_( - payload, - configuration_=self.schema_config - ) - assert api_response.body == deserialized_response_body - -if __name__ == '__main__': - unittest.main() diff --git a/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_response_body_post_by_number_response_body_for_content_types/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_response_body_post_by_number_response_body_for_content_types/__init__.py index 643583a9b57..e69de29bb2d 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_response_body_post_by_number_response_body_for_content_types/__init__.py +++ b/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_response_body_post_by_number_response_body_for_content_types/__init__.py @@ -1,119 +0,0 @@ -# coding: utf-8 - -""" - - - Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator -""" - -import unittest -from unittest.mock import patch - -import urllib3 - -import unit_test_api -from unit_test_api.paths.response_body_post_by_number_response_body_for_content_types.post import operation as post # noqa: E501 -from unit_test_api import schemas, api_client -from unit_test_api.configurations import api_configuration, schema_configuration - -from .. import ApiTestMixin - - -class TestPost(ApiTestMixin, unittest.TestCase): - """ - Post unit test stubs - """ - api_config = api_configuration.ApiConfiguration() - schema_config = schema_configuration.SchemaConfiguration() - used_api_client = api_client.ApiClient(configuration=api_config, schema_config=schema_config) - api = post.ApiForPost(api_client=used_api_client) # noqa: E501 - - response_status = 200 - response_body_schema = post.response_200.ResponseFor200.content["application/json"].schema - - def test_45_is_multiple_of15_passes(self): - # 4.5 is multiple of 1.5 - accept_content_type = 'application/json' - - with patch.object(urllib3.PoolManager, 'request') as mock_request: - payload = ( - 4.5 - ) - mock_request.return_value = self.response( - self.json_bytes(payload), - status=self.response_status - ) - api_response = self.api.post( - accept_content_types=(accept_content_type,) - ) - self.assert_pool_manager_request_called_with( - mock_request, - self.api_config.get_server_url('servers', None) + "/responseBody/postByNumberResponseBodyForContentTypes", - method='post'.upper(), - accept_content_type=accept_content_type, - ) - - assert isinstance(api_response.response, urllib3.HTTPResponse) - assert isinstance(api_response.body, self.response_body_schema) - deserialized_response_body = self.response_body_schema.from_openapi_data_( - payload, - configuration_=self.schema_config - ) - assert api_response.body == deserialized_response_body - - def test_35_is_not_multiple_of15_fails(self): - # 35 is not multiple of 1.5 - accept_content_type = 'application/json' - - with patch.object(urllib3.PoolManager, 'request') as mock_request: - payload = ( - 35 - ) - mock_request.return_value = self.response( - self.json_bytes(payload), - status=self.response_status - ) - with self.assertRaises((unit_test_api.ApiValueError, unit_test_api.ApiTypeError)): - self.api.post( - accept_content_types=(accept_content_type,) - ) - self.assert_pool_manager_request_called_with( - mock_request, - self.api_config.get_server_url('servers', None) + "/responseBody/postByNumberResponseBodyForContentTypes", - method='post'.upper(), - content_type=None, - accept_content_type=accept_content_type, - ) - - def test_zero_is_multiple_of_anything_passes(self): - # zero is multiple of anything - accept_content_type = 'application/json' - - with patch.object(urllib3.PoolManager, 'request') as mock_request: - payload = ( - 0 - ) - mock_request.return_value = self.response( - self.json_bytes(payload), - status=self.response_status - ) - api_response = self.api.post( - accept_content_types=(accept_content_type,) - ) - self.assert_pool_manager_request_called_with( - mock_request, - self.api_config.get_server_url('servers', None) + "/responseBody/postByNumberResponseBodyForContentTypes", - method='post'.upper(), - accept_content_type=accept_content_type, - ) - - assert isinstance(api_response.response, urllib3.HTTPResponse) - assert isinstance(api_response.body, self.response_body_schema) - deserialized_response_body = self.response_body_schema.from_openapi_data_( - payload, - configuration_=self.schema_config - ) - assert api_response.body == deserialized_response_body - -if __name__ == '__main__': - unittest.main() diff --git a/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_response_body_post_by_small_number_response_body_for_content_types/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_response_body_post_by_small_number_response_body_for_content_types/__init__.py index ea2438319c9..e69de29bb2d 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_response_body_post_by_small_number_response_body_for_content_types/__init__.py +++ b/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_response_body_post_by_small_number_response_body_for_content_types/__init__.py @@ -1,89 +0,0 @@ -# coding: utf-8 - -""" - - - Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator -""" - -import unittest -from unittest.mock import patch - -import urllib3 - -import unit_test_api -from unit_test_api.paths.response_body_post_by_small_number_response_body_for_content_types.post import operation as post # noqa: E501 -from unit_test_api import schemas, api_client -from unit_test_api.configurations import api_configuration, schema_configuration - -from .. import ApiTestMixin - - -class TestPost(ApiTestMixin, unittest.TestCase): - """ - Post unit test stubs - """ - api_config = api_configuration.ApiConfiguration() - schema_config = schema_configuration.SchemaConfiguration() - used_api_client = api_client.ApiClient(configuration=api_config, schema_config=schema_config) - api = post.ApiForPost(api_client=used_api_client) # noqa: E501 - - response_status = 200 - response_body_schema = post.response_200.ResponseFor200.content["application/json"].schema - - def test_000751_is_not_multiple_of00001_fails(self): - # 0.00751 is not multiple of 0.0001 - accept_content_type = 'application/json' - - with patch.object(urllib3.PoolManager, 'request') as mock_request: - payload = ( - 0.00751 - ) - mock_request.return_value = self.response( - self.json_bytes(payload), - status=self.response_status - ) - with self.assertRaises((unit_test_api.ApiValueError, unit_test_api.ApiTypeError)): - self.api.post( - accept_content_types=(accept_content_type,) - ) - self.assert_pool_manager_request_called_with( - mock_request, - self.api_config.get_server_url('servers', None) + "/responseBody/postBySmallNumberResponseBodyForContentTypes", - method='post'.upper(), - content_type=None, - accept_content_type=accept_content_type, - ) - - def test_00075_is_multiple_of00001_passes(self): - # 0.0075 is multiple of 0.0001 - accept_content_type = 'application/json' - - with patch.object(urllib3.PoolManager, 'request') as mock_request: - payload = ( - 0.0075 - ) - mock_request.return_value = self.response( - self.json_bytes(payload), - status=self.response_status - ) - api_response = self.api.post( - accept_content_types=(accept_content_type,) - ) - self.assert_pool_manager_request_called_with( - mock_request, - self.api_config.get_server_url('servers', None) + "/responseBody/postBySmallNumberResponseBodyForContentTypes", - method='post'.upper(), - accept_content_type=accept_content_type, - ) - - assert isinstance(api_response.response, urllib3.HTTPResponse) - assert isinstance(api_response.body, self.response_body_schema) - deserialized_response_body = self.response_body_schema.from_openapi_data_( - payload, - configuration_=self.schema_config - ) - assert api_response.body == deserialized_response_body - -if __name__ == '__main__': - unittest.main() diff --git a/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_response_body_post_date_time_format_response_body_for_content_types/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_response_body_post_date_time_format_response_body_for_content_types/__init__.py index adffb1eb530..e69de29bb2d 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_response_body_post_date_time_format_response_body_for_content_types/__init__.py +++ b/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_response_body_post_date_time_format_response_body_for_content_types/__init__.py @@ -1,217 +0,0 @@ -# coding: utf-8 - -""" - - - Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator -""" - -import unittest -from unittest.mock import patch - -import urllib3 - -import unit_test_api -from unit_test_api.paths.response_body_post_date_time_format_response_body_for_content_types.post import operation as post # noqa: E501 -from unit_test_api import schemas, api_client -from unit_test_api.configurations import api_configuration, schema_configuration - -from .. import ApiTestMixin - - -class TestPost(ApiTestMixin, unittest.TestCase): - """ - Post unit test stubs - """ - api_config = api_configuration.ApiConfiguration() - schema_config = schema_configuration.SchemaConfiguration() - used_api_client = api_client.ApiClient(configuration=api_config, schema_config=schema_config) - api = post.ApiForPost(api_client=used_api_client) # noqa: E501 - - response_status = 200 - response_body_schema = post.response_200.ResponseFor200.content["application/json"].schema - - def test_all_string_formats_ignore_objects_passes(self): - # all string formats ignore objects - accept_content_type = 'application/json' - - with patch.object(urllib3.PoolManager, 'request') as mock_request: - payload = ( - { - } - ) - mock_request.return_value = self.response( - self.json_bytes(payload), - status=self.response_status - ) - api_response = self.api.post( - accept_content_types=(accept_content_type,) - ) - self.assert_pool_manager_request_called_with( - mock_request, - self.api_config.get_server_url('servers', None) + "/responseBody/postDateTimeFormatResponseBodyForContentTypes", - method='post'.upper(), - accept_content_type=accept_content_type, - ) - - assert isinstance(api_response.response, urllib3.HTTPResponse) - assert isinstance(api_response.body, self.response_body_schema) - deserialized_response_body = self.response_body_schema.from_openapi_data_( - payload, - configuration_=self.schema_config - ) - assert api_response.body == deserialized_response_body - - def test_all_string_formats_ignore_booleans_passes(self): - # all string formats ignore booleans - accept_content_type = 'application/json' - - with patch.object(urllib3.PoolManager, 'request') as mock_request: - payload = ( - False - ) - mock_request.return_value = self.response( - self.json_bytes(payload), - status=self.response_status - ) - api_response = self.api.post( - accept_content_types=(accept_content_type,) - ) - self.assert_pool_manager_request_called_with( - mock_request, - self.api_config.get_server_url('servers', None) + "/responseBody/postDateTimeFormatResponseBodyForContentTypes", - method='post'.upper(), - accept_content_type=accept_content_type, - ) - - assert isinstance(api_response.response, urllib3.HTTPResponse) - assert isinstance(api_response.body, self.response_body_schema) - deserialized_response_body = self.response_body_schema.from_openapi_data_( - payload, - configuration_=self.schema_config - ) - assert api_response.body == deserialized_response_body - - def test_all_string_formats_ignore_integers_passes(self): - # all string formats ignore integers - accept_content_type = 'application/json' - - with patch.object(urllib3.PoolManager, 'request') as mock_request: - payload = ( - 12 - ) - mock_request.return_value = self.response( - self.json_bytes(payload), - status=self.response_status - ) - api_response = self.api.post( - accept_content_types=(accept_content_type,) - ) - self.assert_pool_manager_request_called_with( - mock_request, - self.api_config.get_server_url('servers', None) + "/responseBody/postDateTimeFormatResponseBodyForContentTypes", - method='post'.upper(), - accept_content_type=accept_content_type, - ) - - assert isinstance(api_response.response, urllib3.HTTPResponse) - assert isinstance(api_response.body, self.response_body_schema) - deserialized_response_body = self.response_body_schema.from_openapi_data_( - payload, - configuration_=self.schema_config - ) - assert api_response.body == deserialized_response_body - - def test_all_string_formats_ignore_floats_passes(self): - # all string formats ignore floats - accept_content_type = 'application/json' - - with patch.object(urllib3.PoolManager, 'request') as mock_request: - payload = ( - 13.7 - ) - mock_request.return_value = self.response( - self.json_bytes(payload), - status=self.response_status - ) - api_response = self.api.post( - accept_content_types=(accept_content_type,) - ) - self.assert_pool_manager_request_called_with( - mock_request, - self.api_config.get_server_url('servers', None) + "/responseBody/postDateTimeFormatResponseBodyForContentTypes", - method='post'.upper(), - accept_content_type=accept_content_type, - ) - - assert isinstance(api_response.response, urllib3.HTTPResponse) - assert isinstance(api_response.body, self.response_body_schema) - deserialized_response_body = self.response_body_schema.from_openapi_data_( - payload, - configuration_=self.schema_config - ) - assert api_response.body == deserialized_response_body - - def test_all_string_formats_ignore_arrays_passes(self): - # all string formats ignore arrays - accept_content_type = 'application/json' - - with patch.object(urllib3.PoolManager, 'request') as mock_request: - payload = ( - [ - ] - ) - mock_request.return_value = self.response( - self.json_bytes(payload), - status=self.response_status - ) - api_response = self.api.post( - accept_content_types=(accept_content_type,) - ) - self.assert_pool_manager_request_called_with( - mock_request, - self.api_config.get_server_url('servers', None) + "/responseBody/postDateTimeFormatResponseBodyForContentTypes", - method='post'.upper(), - accept_content_type=accept_content_type, - ) - - assert isinstance(api_response.response, urllib3.HTTPResponse) - assert isinstance(api_response.body, self.response_body_schema) - deserialized_response_body = self.response_body_schema.from_openapi_data_( - payload, - configuration_=self.schema_config - ) - assert api_response.body == deserialized_response_body - - def test_all_string_formats_ignore_nulls_passes(self): - # all string formats ignore nulls - accept_content_type = 'application/json' - - with patch.object(urllib3.PoolManager, 'request') as mock_request: - payload = ( - None - ) - mock_request.return_value = self.response( - self.json_bytes(payload), - status=self.response_status - ) - api_response = self.api.post( - accept_content_types=(accept_content_type,) - ) - self.assert_pool_manager_request_called_with( - mock_request, - self.api_config.get_server_url('servers', None) + "/responseBody/postDateTimeFormatResponseBodyForContentTypes", - method='post'.upper(), - accept_content_type=accept_content_type, - ) - - assert isinstance(api_response.response, urllib3.HTTPResponse) - assert isinstance(api_response.body, self.response_body_schema) - deserialized_response_body = self.response_body_schema.from_openapi_data_( - payload, - configuration_=self.schema_config - ) - assert api_response.body == deserialized_response_body - -if __name__ == '__main__': - unittest.main() diff --git a/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_response_body_post_email_format_response_body_for_content_types/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_response_body_post_email_format_response_body_for_content_types/__init__.py index ed132edd91b..e69de29bb2d 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_response_body_post_email_format_response_body_for_content_types/__init__.py +++ b/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_response_body_post_email_format_response_body_for_content_types/__init__.py @@ -1,217 +0,0 @@ -# coding: utf-8 - -""" - - - Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator -""" - -import unittest -from unittest.mock import patch - -import urllib3 - -import unit_test_api -from unit_test_api.paths.response_body_post_email_format_response_body_for_content_types.post import operation as post # noqa: E501 -from unit_test_api import schemas, api_client -from unit_test_api.configurations import api_configuration, schema_configuration - -from .. import ApiTestMixin - - -class TestPost(ApiTestMixin, unittest.TestCase): - """ - Post unit test stubs - """ - api_config = api_configuration.ApiConfiguration() - schema_config = schema_configuration.SchemaConfiguration() - used_api_client = api_client.ApiClient(configuration=api_config, schema_config=schema_config) - api = post.ApiForPost(api_client=used_api_client) # noqa: E501 - - response_status = 200 - response_body_schema = post.response_200.ResponseFor200.content["application/json"].schema - - def test_all_string_formats_ignore_objects_passes(self): - # all string formats ignore objects - accept_content_type = 'application/json' - - with patch.object(urllib3.PoolManager, 'request') as mock_request: - payload = ( - { - } - ) - mock_request.return_value = self.response( - self.json_bytes(payload), - status=self.response_status - ) - api_response = self.api.post( - accept_content_types=(accept_content_type,) - ) - self.assert_pool_manager_request_called_with( - mock_request, - self.api_config.get_server_url('servers', None) + "/responseBody/postEmailFormatResponseBodyForContentTypes", - method='post'.upper(), - accept_content_type=accept_content_type, - ) - - assert isinstance(api_response.response, urllib3.HTTPResponse) - assert isinstance(api_response.body, self.response_body_schema) - deserialized_response_body = self.response_body_schema.from_openapi_data_( - payload, - configuration_=self.schema_config - ) - assert api_response.body == deserialized_response_body - - def test_all_string_formats_ignore_booleans_passes(self): - # all string formats ignore booleans - accept_content_type = 'application/json' - - with patch.object(urllib3.PoolManager, 'request') as mock_request: - payload = ( - False - ) - mock_request.return_value = self.response( - self.json_bytes(payload), - status=self.response_status - ) - api_response = self.api.post( - accept_content_types=(accept_content_type,) - ) - self.assert_pool_manager_request_called_with( - mock_request, - self.api_config.get_server_url('servers', None) + "/responseBody/postEmailFormatResponseBodyForContentTypes", - method='post'.upper(), - accept_content_type=accept_content_type, - ) - - assert isinstance(api_response.response, urllib3.HTTPResponse) - assert isinstance(api_response.body, self.response_body_schema) - deserialized_response_body = self.response_body_schema.from_openapi_data_( - payload, - configuration_=self.schema_config - ) - assert api_response.body == deserialized_response_body - - def test_all_string_formats_ignore_integers_passes(self): - # all string formats ignore integers - accept_content_type = 'application/json' - - with patch.object(urllib3.PoolManager, 'request') as mock_request: - payload = ( - 12 - ) - mock_request.return_value = self.response( - self.json_bytes(payload), - status=self.response_status - ) - api_response = self.api.post( - accept_content_types=(accept_content_type,) - ) - self.assert_pool_manager_request_called_with( - mock_request, - self.api_config.get_server_url('servers', None) + "/responseBody/postEmailFormatResponseBodyForContentTypes", - method='post'.upper(), - accept_content_type=accept_content_type, - ) - - assert isinstance(api_response.response, urllib3.HTTPResponse) - assert isinstance(api_response.body, self.response_body_schema) - deserialized_response_body = self.response_body_schema.from_openapi_data_( - payload, - configuration_=self.schema_config - ) - assert api_response.body == deserialized_response_body - - def test_all_string_formats_ignore_floats_passes(self): - # all string formats ignore floats - accept_content_type = 'application/json' - - with patch.object(urllib3.PoolManager, 'request') as mock_request: - payload = ( - 13.7 - ) - mock_request.return_value = self.response( - self.json_bytes(payload), - status=self.response_status - ) - api_response = self.api.post( - accept_content_types=(accept_content_type,) - ) - self.assert_pool_manager_request_called_with( - mock_request, - self.api_config.get_server_url('servers', None) + "/responseBody/postEmailFormatResponseBodyForContentTypes", - method='post'.upper(), - accept_content_type=accept_content_type, - ) - - assert isinstance(api_response.response, urllib3.HTTPResponse) - assert isinstance(api_response.body, self.response_body_schema) - deserialized_response_body = self.response_body_schema.from_openapi_data_( - payload, - configuration_=self.schema_config - ) - assert api_response.body == deserialized_response_body - - def test_all_string_formats_ignore_arrays_passes(self): - # all string formats ignore arrays - accept_content_type = 'application/json' - - with patch.object(urllib3.PoolManager, 'request') as mock_request: - payload = ( - [ - ] - ) - mock_request.return_value = self.response( - self.json_bytes(payload), - status=self.response_status - ) - api_response = self.api.post( - accept_content_types=(accept_content_type,) - ) - self.assert_pool_manager_request_called_with( - mock_request, - self.api_config.get_server_url('servers', None) + "/responseBody/postEmailFormatResponseBodyForContentTypes", - method='post'.upper(), - accept_content_type=accept_content_type, - ) - - assert isinstance(api_response.response, urllib3.HTTPResponse) - assert isinstance(api_response.body, self.response_body_schema) - deserialized_response_body = self.response_body_schema.from_openapi_data_( - payload, - configuration_=self.schema_config - ) - assert api_response.body == deserialized_response_body - - def test_all_string_formats_ignore_nulls_passes(self): - # all string formats ignore nulls - accept_content_type = 'application/json' - - with patch.object(urllib3.PoolManager, 'request') as mock_request: - payload = ( - None - ) - mock_request.return_value = self.response( - self.json_bytes(payload), - status=self.response_status - ) - api_response = self.api.post( - accept_content_types=(accept_content_type,) - ) - self.assert_pool_manager_request_called_with( - mock_request, - self.api_config.get_server_url('servers', None) + "/responseBody/postEmailFormatResponseBodyForContentTypes", - method='post'.upper(), - accept_content_type=accept_content_type, - ) - - assert isinstance(api_response.response, urllib3.HTTPResponse) - assert isinstance(api_response.body, self.response_body_schema) - deserialized_response_body = self.response_body_schema.from_openapi_data_( - payload, - configuration_=self.schema_config - ) - assert api_response.body == deserialized_response_body - -if __name__ == '__main__': - unittest.main() diff --git a/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_response_body_post_enum_with0_does_not_match_false_response_body_for_content_types/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_response_body_post_enum_with0_does_not_match_false_response_body_for_content_types/__init__.py index 54e1c102ad7..e69de29bb2d 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_response_body_post_enum_with0_does_not_match_false_response_body_for_content_types/__init__.py +++ b/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_response_body_post_enum_with0_does_not_match_false_response_body_for_content_types/__init__.py @@ -1,119 +0,0 @@ -# coding: utf-8 - -""" - - - Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator -""" - -import unittest -from unittest.mock import patch - -import urllib3 - -import unit_test_api -from unit_test_api.paths.response_body_post_enum_with0_does_not_match_false_response_body_for_content_types.post import operation as post # noqa: E501 -from unit_test_api import schemas, api_client -from unit_test_api.configurations import api_configuration, schema_configuration - -from .. import ApiTestMixin - - -class TestPost(ApiTestMixin, unittest.TestCase): - """ - Post unit test stubs - """ - api_config = api_configuration.ApiConfiguration() - schema_config = schema_configuration.SchemaConfiguration() - used_api_client = api_client.ApiClient(configuration=api_config, schema_config=schema_config) - api = post.ApiForPost(api_client=used_api_client) # noqa: E501 - - response_status = 200 - response_body_schema = post.response_200.ResponseFor200.content["application/json"].schema - - def test_integer_zero_is_valid_passes(self): - # integer zero is valid - accept_content_type = 'application/json' - - with patch.object(urllib3.PoolManager, 'request') as mock_request: - payload = ( - 0 - ) - mock_request.return_value = self.response( - self.json_bytes(payload), - status=self.response_status - ) - api_response = self.api.post( - accept_content_types=(accept_content_type,) - ) - self.assert_pool_manager_request_called_with( - mock_request, - self.api_config.get_server_url('servers', None) + "/responseBody/postEnumWith0DoesNotMatchFalseResponseBodyForContentTypes", - method='post'.upper(), - accept_content_type=accept_content_type, - ) - - assert isinstance(api_response.response, urllib3.HTTPResponse) - assert isinstance(api_response.body, self.response_body_schema) - deserialized_response_body = self.response_body_schema.from_openapi_data_( - payload, - configuration_=self.schema_config - ) - assert api_response.body == deserialized_response_body - - def test_float_zero_is_valid_passes(self): - # float zero is valid - accept_content_type = 'application/json' - - with patch.object(urllib3.PoolManager, 'request') as mock_request: - payload = ( - 0.0 - ) - mock_request.return_value = self.response( - self.json_bytes(payload), - status=self.response_status - ) - api_response = self.api.post( - accept_content_types=(accept_content_type,) - ) - self.assert_pool_manager_request_called_with( - mock_request, - self.api_config.get_server_url('servers', None) + "/responseBody/postEnumWith0DoesNotMatchFalseResponseBodyForContentTypes", - method='post'.upper(), - accept_content_type=accept_content_type, - ) - - assert isinstance(api_response.response, urllib3.HTTPResponse) - assert isinstance(api_response.body, self.response_body_schema) - deserialized_response_body = self.response_body_schema.from_openapi_data_( - payload, - configuration_=self.schema_config - ) - assert api_response.body == deserialized_response_body - - def test_false_is_invalid_fails(self): - # false is invalid - accept_content_type = 'application/json' - - with patch.object(urllib3.PoolManager, 'request') as mock_request: - payload = ( - False - ) - mock_request.return_value = self.response( - self.json_bytes(payload), - status=self.response_status - ) - with self.assertRaises((unit_test_api.ApiValueError, unit_test_api.ApiTypeError)): - self.api.post( - accept_content_types=(accept_content_type,) - ) - self.assert_pool_manager_request_called_with( - mock_request, - self.api_config.get_server_url('servers', None) + "/responseBody/postEnumWith0DoesNotMatchFalseResponseBodyForContentTypes", - method='post'.upper(), - content_type=None, - accept_content_type=accept_content_type, - ) - -if __name__ == '__main__': - unittest.main() diff --git a/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_response_body_post_enum_with1_does_not_match_true_response_body_for_content_types/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_response_body_post_enum_with1_does_not_match_true_response_body_for_content_types/__init__.py index 642899522cb..e69de29bb2d 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_response_body_post_enum_with1_does_not_match_true_response_body_for_content_types/__init__.py +++ b/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_response_body_post_enum_with1_does_not_match_true_response_body_for_content_types/__init__.py @@ -1,119 +0,0 @@ -# coding: utf-8 - -""" - - - Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator -""" - -import unittest -from unittest.mock import patch - -import urllib3 - -import unit_test_api -from unit_test_api.paths.response_body_post_enum_with1_does_not_match_true_response_body_for_content_types.post import operation as post # noqa: E501 -from unit_test_api import schemas, api_client -from unit_test_api.configurations import api_configuration, schema_configuration - -from .. import ApiTestMixin - - -class TestPost(ApiTestMixin, unittest.TestCase): - """ - Post unit test stubs - """ - api_config = api_configuration.ApiConfiguration() - schema_config = schema_configuration.SchemaConfiguration() - used_api_client = api_client.ApiClient(configuration=api_config, schema_config=schema_config) - api = post.ApiForPost(api_client=used_api_client) # noqa: E501 - - response_status = 200 - response_body_schema = post.response_200.ResponseFor200.content["application/json"].schema - - def test_true_is_invalid_fails(self): - # true is invalid - accept_content_type = 'application/json' - - with patch.object(urllib3.PoolManager, 'request') as mock_request: - payload = ( - True - ) - mock_request.return_value = self.response( - self.json_bytes(payload), - status=self.response_status - ) - with self.assertRaises((unit_test_api.ApiValueError, unit_test_api.ApiTypeError)): - self.api.post( - accept_content_types=(accept_content_type,) - ) - self.assert_pool_manager_request_called_with( - mock_request, - self.api_config.get_server_url('servers', None) + "/responseBody/postEnumWith1DoesNotMatchTrueResponseBodyForContentTypes", - method='post'.upper(), - content_type=None, - accept_content_type=accept_content_type, - ) - - def test_integer_one_is_valid_passes(self): - # integer one is valid - accept_content_type = 'application/json' - - with patch.object(urllib3.PoolManager, 'request') as mock_request: - payload = ( - 1 - ) - mock_request.return_value = self.response( - self.json_bytes(payload), - status=self.response_status - ) - api_response = self.api.post( - accept_content_types=(accept_content_type,) - ) - self.assert_pool_manager_request_called_with( - mock_request, - self.api_config.get_server_url('servers', None) + "/responseBody/postEnumWith1DoesNotMatchTrueResponseBodyForContentTypes", - method='post'.upper(), - accept_content_type=accept_content_type, - ) - - assert isinstance(api_response.response, urllib3.HTTPResponse) - assert isinstance(api_response.body, self.response_body_schema) - deserialized_response_body = self.response_body_schema.from_openapi_data_( - payload, - configuration_=self.schema_config - ) - assert api_response.body == deserialized_response_body - - def test_float_one_is_valid_passes(self): - # float one is valid - accept_content_type = 'application/json' - - with patch.object(urllib3.PoolManager, 'request') as mock_request: - payload = ( - 1.0 - ) - mock_request.return_value = self.response( - self.json_bytes(payload), - status=self.response_status - ) - api_response = self.api.post( - accept_content_types=(accept_content_type,) - ) - self.assert_pool_manager_request_called_with( - mock_request, - self.api_config.get_server_url('servers', None) + "/responseBody/postEnumWith1DoesNotMatchTrueResponseBodyForContentTypes", - method='post'.upper(), - accept_content_type=accept_content_type, - ) - - assert isinstance(api_response.response, urllib3.HTTPResponse) - assert isinstance(api_response.body, self.response_body_schema) - deserialized_response_body = self.response_body_schema.from_openapi_data_( - payload, - configuration_=self.schema_config - ) - assert api_response.body == deserialized_response_body - -if __name__ == '__main__': - unittest.main() diff --git a/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_response_body_post_enum_with_escaped_characters_response_body_for_content_types/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_response_body_post_enum_with_escaped_characters_response_body_for_content_types/__init__.py index 4adf5660698..e69de29bb2d 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_response_body_post_enum_with_escaped_characters_response_body_for_content_types/__init__.py +++ b/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_response_body_post_enum_with_escaped_characters_response_body_for_content_types/__init__.py @@ -1,119 +0,0 @@ -# coding: utf-8 - -""" - - - Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator -""" - -import unittest -from unittest.mock import patch - -import urllib3 - -import unit_test_api -from unit_test_api.paths.response_body_post_enum_with_escaped_characters_response_body_for_content_types.post import operation as post # noqa: E501 -from unit_test_api import schemas, api_client -from unit_test_api.configurations import api_configuration, schema_configuration - -from .. import ApiTestMixin - - -class TestPost(ApiTestMixin, unittest.TestCase): - """ - Post unit test stubs - """ - api_config = api_configuration.ApiConfiguration() - schema_config = schema_configuration.SchemaConfiguration() - used_api_client = api_client.ApiClient(configuration=api_config, schema_config=schema_config) - api = post.ApiForPost(api_client=used_api_client) # noqa: E501 - - response_status = 200 - response_body_schema = post.response_200.ResponseFor200.content["application/json"].schema - - def test_member2_is_valid_passes(self): - # member 2 is valid - accept_content_type = 'application/json' - - with patch.object(urllib3.PoolManager, 'request') as mock_request: - payload = ( - "foo\rbar" - ) - mock_request.return_value = self.response( - self.json_bytes(payload), - status=self.response_status - ) - api_response = self.api.post( - accept_content_types=(accept_content_type,) - ) - self.assert_pool_manager_request_called_with( - mock_request, - self.api_config.get_server_url('servers', None) + "/responseBody/postEnumWithEscapedCharactersResponseBodyForContentTypes", - method='post'.upper(), - accept_content_type=accept_content_type, - ) - - assert isinstance(api_response.response, urllib3.HTTPResponse) - assert isinstance(api_response.body, self.response_body_schema) - deserialized_response_body = self.response_body_schema.from_openapi_data_( - payload, - configuration_=self.schema_config - ) - assert api_response.body == deserialized_response_body - - def test_member1_is_valid_passes(self): - # member 1 is valid - accept_content_type = 'application/json' - - with patch.object(urllib3.PoolManager, 'request') as mock_request: - payload = ( - "foo\nbar" - ) - mock_request.return_value = self.response( - self.json_bytes(payload), - status=self.response_status - ) - api_response = self.api.post( - accept_content_types=(accept_content_type,) - ) - self.assert_pool_manager_request_called_with( - mock_request, - self.api_config.get_server_url('servers', None) + "/responseBody/postEnumWithEscapedCharactersResponseBodyForContentTypes", - method='post'.upper(), - accept_content_type=accept_content_type, - ) - - assert isinstance(api_response.response, urllib3.HTTPResponse) - assert isinstance(api_response.body, self.response_body_schema) - deserialized_response_body = self.response_body_schema.from_openapi_data_( - payload, - configuration_=self.schema_config - ) - assert api_response.body == deserialized_response_body - - def test_another_string_is_invalid_fails(self): - # another string is invalid - accept_content_type = 'application/json' - - with patch.object(urllib3.PoolManager, 'request') as mock_request: - payload = ( - "abc" - ) - mock_request.return_value = self.response( - self.json_bytes(payload), - status=self.response_status - ) - with self.assertRaises((unit_test_api.ApiValueError, unit_test_api.ApiTypeError)): - self.api.post( - accept_content_types=(accept_content_type,) - ) - self.assert_pool_manager_request_called_with( - mock_request, - self.api_config.get_server_url('servers', None) + "/responseBody/postEnumWithEscapedCharactersResponseBodyForContentTypes", - method='post'.upper(), - content_type=None, - accept_content_type=accept_content_type, - ) - -if __name__ == '__main__': - unittest.main() diff --git a/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_response_body_post_enum_with_false_does_not_match0_response_body_for_content_types/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_response_body_post_enum_with_false_does_not_match0_response_body_for_content_types/__init__.py index 2e6a3878b34..e69de29bb2d 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_response_body_post_enum_with_false_does_not_match0_response_body_for_content_types/__init__.py +++ b/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_response_body_post_enum_with_false_does_not_match0_response_body_for_content_types/__init__.py @@ -1,113 +0,0 @@ -# coding: utf-8 - -""" - - - Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator -""" - -import unittest -from unittest.mock import patch - -import urllib3 - -import unit_test_api -from unit_test_api.paths.response_body_post_enum_with_false_does_not_match0_response_body_for_content_types.post import operation as post # noqa: E501 -from unit_test_api import schemas, api_client -from unit_test_api.configurations import api_configuration, schema_configuration - -from .. import ApiTestMixin - - -class TestPost(ApiTestMixin, unittest.TestCase): - """ - Post unit test stubs - """ - api_config = api_configuration.ApiConfiguration() - schema_config = schema_configuration.SchemaConfiguration() - used_api_client = api_client.ApiClient(configuration=api_config, schema_config=schema_config) - api = post.ApiForPost(api_client=used_api_client) # noqa: E501 - - response_status = 200 - response_body_schema = post.response_200.ResponseFor200.content["application/json"].schema - - def test_false_is_valid_passes(self): - # false is valid - accept_content_type = 'application/json' - - with patch.object(urllib3.PoolManager, 'request') as mock_request: - payload = ( - False - ) - mock_request.return_value = self.response( - self.json_bytes(payload), - status=self.response_status - ) - api_response = self.api.post( - accept_content_types=(accept_content_type,) - ) - self.assert_pool_manager_request_called_with( - mock_request, - self.api_config.get_server_url('servers', None) + "/responseBody/postEnumWithFalseDoesNotMatch0ResponseBodyForContentTypes", - method='post'.upper(), - accept_content_type=accept_content_type, - ) - - assert isinstance(api_response.response, urllib3.HTTPResponse) - assert isinstance(api_response.body, self.response_body_schema) - deserialized_response_body = self.response_body_schema.from_openapi_data_( - payload, - configuration_=self.schema_config - ) - assert api_response.body == deserialized_response_body - - def test_float_zero_is_invalid_fails(self): - # float zero is invalid - accept_content_type = 'application/json' - - with patch.object(urllib3.PoolManager, 'request') as mock_request: - payload = ( - 0.0 - ) - mock_request.return_value = self.response( - self.json_bytes(payload), - status=self.response_status - ) - with self.assertRaises((unit_test_api.ApiValueError, unit_test_api.ApiTypeError)): - self.api.post( - accept_content_types=(accept_content_type,) - ) - self.assert_pool_manager_request_called_with( - mock_request, - self.api_config.get_server_url('servers', None) + "/responseBody/postEnumWithFalseDoesNotMatch0ResponseBodyForContentTypes", - method='post'.upper(), - content_type=None, - accept_content_type=accept_content_type, - ) - - def test_integer_zero_is_invalid_fails(self): - # integer zero is invalid - accept_content_type = 'application/json' - - with patch.object(urllib3.PoolManager, 'request') as mock_request: - payload = ( - 0 - ) - mock_request.return_value = self.response( - self.json_bytes(payload), - status=self.response_status - ) - with self.assertRaises((unit_test_api.ApiValueError, unit_test_api.ApiTypeError)): - self.api.post( - accept_content_types=(accept_content_type,) - ) - self.assert_pool_manager_request_called_with( - mock_request, - self.api_config.get_server_url('servers', None) + "/responseBody/postEnumWithFalseDoesNotMatch0ResponseBodyForContentTypes", - method='post'.upper(), - content_type=None, - accept_content_type=accept_content_type, - ) - -if __name__ == '__main__': - unittest.main() diff --git a/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_response_body_post_enum_with_true_does_not_match1_response_body_for_content_types/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_response_body_post_enum_with_true_does_not_match1_response_body_for_content_types/__init__.py index ed0b547790a..e69de29bb2d 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_response_body_post_enum_with_true_does_not_match1_response_body_for_content_types/__init__.py +++ b/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_response_body_post_enum_with_true_does_not_match1_response_body_for_content_types/__init__.py @@ -1,113 +0,0 @@ -# coding: utf-8 - -""" - - - Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator -""" - -import unittest -from unittest.mock import patch - -import urllib3 - -import unit_test_api -from unit_test_api.paths.response_body_post_enum_with_true_does_not_match1_response_body_for_content_types.post import operation as post # noqa: E501 -from unit_test_api import schemas, api_client -from unit_test_api.configurations import api_configuration, schema_configuration - -from .. import ApiTestMixin - - -class TestPost(ApiTestMixin, unittest.TestCase): - """ - Post unit test stubs - """ - api_config = api_configuration.ApiConfiguration() - schema_config = schema_configuration.SchemaConfiguration() - used_api_client = api_client.ApiClient(configuration=api_config, schema_config=schema_config) - api = post.ApiForPost(api_client=used_api_client) # noqa: E501 - - response_status = 200 - response_body_schema = post.response_200.ResponseFor200.content["application/json"].schema - - def test_float_one_is_invalid_fails(self): - # float one is invalid - accept_content_type = 'application/json' - - with patch.object(urllib3.PoolManager, 'request') as mock_request: - payload = ( - 1.0 - ) - mock_request.return_value = self.response( - self.json_bytes(payload), - status=self.response_status - ) - with self.assertRaises((unit_test_api.ApiValueError, unit_test_api.ApiTypeError)): - self.api.post( - accept_content_types=(accept_content_type,) - ) - self.assert_pool_manager_request_called_with( - mock_request, - self.api_config.get_server_url('servers', None) + "/responseBody/postEnumWithTrueDoesNotMatch1ResponseBodyForContentTypes", - method='post'.upper(), - content_type=None, - accept_content_type=accept_content_type, - ) - - def test_true_is_valid_passes(self): - # true is valid - accept_content_type = 'application/json' - - with patch.object(urllib3.PoolManager, 'request') as mock_request: - payload = ( - True - ) - mock_request.return_value = self.response( - self.json_bytes(payload), - status=self.response_status - ) - api_response = self.api.post( - accept_content_types=(accept_content_type,) - ) - self.assert_pool_manager_request_called_with( - mock_request, - self.api_config.get_server_url('servers', None) + "/responseBody/postEnumWithTrueDoesNotMatch1ResponseBodyForContentTypes", - method='post'.upper(), - accept_content_type=accept_content_type, - ) - - assert isinstance(api_response.response, urllib3.HTTPResponse) - assert isinstance(api_response.body, self.response_body_schema) - deserialized_response_body = self.response_body_schema.from_openapi_data_( - payload, - configuration_=self.schema_config - ) - assert api_response.body == deserialized_response_body - - def test_integer_one_is_invalid_fails(self): - # integer one is invalid - accept_content_type = 'application/json' - - with patch.object(urllib3.PoolManager, 'request') as mock_request: - payload = ( - 1 - ) - mock_request.return_value = self.response( - self.json_bytes(payload), - status=self.response_status - ) - with self.assertRaises((unit_test_api.ApiValueError, unit_test_api.ApiTypeError)): - self.api.post( - accept_content_types=(accept_content_type,) - ) - self.assert_pool_manager_request_called_with( - mock_request, - self.api_config.get_server_url('servers', None) + "/responseBody/postEnumWithTrueDoesNotMatch1ResponseBodyForContentTypes", - method='post'.upper(), - content_type=None, - accept_content_type=accept_content_type, - ) - -if __name__ == '__main__': - unittest.main() diff --git a/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_response_body_post_enums_in_properties_response_body_for_content_types/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_response_body_post_enums_in_properties_response_body_for_content_types/__init__.py index 2816bed34cc..e69de29bb2d 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_response_body_post_enums_in_properties_response_body_for_content_types/__init__.py +++ b/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_response_body_post_enums_in_properties_response_body_for_content_types/__init__.py @@ -1,213 +0,0 @@ -# coding: utf-8 - -""" - - - Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator -""" - -import unittest -from unittest.mock import patch - -import urllib3 - -import unit_test_api -from unit_test_api.paths.response_body_post_enums_in_properties_response_body_for_content_types.post import operation as post # noqa: E501 -from unit_test_api import schemas, api_client -from unit_test_api.configurations import api_configuration, schema_configuration - -from .. import ApiTestMixin - - -class TestPost(ApiTestMixin, unittest.TestCase): - """ - Post unit test stubs - """ - api_config = api_configuration.ApiConfiguration() - schema_config = schema_configuration.SchemaConfiguration() - used_api_client = api_client.ApiClient(configuration=api_config, schema_config=schema_config) - api = post.ApiForPost(api_client=used_api_client) # noqa: E501 - - response_status = 200 - response_body_schema = post.response_200.ResponseFor200.content["application/json"].schema - - def test_missing_optional_property_is_valid_passes(self): - # missing optional property is valid - accept_content_type = 'application/json' - - with patch.object(urllib3.PoolManager, 'request') as mock_request: - payload = ( - { - "bar": - "bar", - } - ) - mock_request.return_value = self.response( - self.json_bytes(payload), - status=self.response_status - ) - api_response = self.api.post( - accept_content_types=(accept_content_type,) - ) - self.assert_pool_manager_request_called_with( - mock_request, - self.api_config.get_server_url('servers', None) + "/responseBody/postEnumsInPropertiesResponseBodyForContentTypes", - method='post'.upper(), - accept_content_type=accept_content_type, - ) - - assert isinstance(api_response.response, urllib3.HTTPResponse) - assert isinstance(api_response.body, self.response_body_schema) - deserialized_response_body = self.response_body_schema.from_openapi_data_( - payload, - configuration_=self.schema_config - ) - assert api_response.body == deserialized_response_body - - def test_wrong_foo_value_fails(self): - # wrong foo value - accept_content_type = 'application/json' - - with patch.object(urllib3.PoolManager, 'request') as mock_request: - payload = ( - { - "foo": - "foot", - "bar": - "bar", - } - ) - mock_request.return_value = self.response( - self.json_bytes(payload), - status=self.response_status - ) - with self.assertRaises((unit_test_api.ApiValueError, unit_test_api.ApiTypeError)): - self.api.post( - accept_content_types=(accept_content_type,) - ) - self.assert_pool_manager_request_called_with( - mock_request, - self.api_config.get_server_url('servers', None) + "/responseBody/postEnumsInPropertiesResponseBodyForContentTypes", - method='post'.upper(), - content_type=None, - accept_content_type=accept_content_type, - ) - - def test_both_properties_are_valid_passes(self): - # both properties are valid - accept_content_type = 'application/json' - - with patch.object(urllib3.PoolManager, 'request') as mock_request: - payload = ( - { - "foo": - "foo", - "bar": - "bar", - } - ) - mock_request.return_value = self.response( - self.json_bytes(payload), - status=self.response_status - ) - api_response = self.api.post( - accept_content_types=(accept_content_type,) - ) - self.assert_pool_manager_request_called_with( - mock_request, - self.api_config.get_server_url('servers', None) + "/responseBody/postEnumsInPropertiesResponseBodyForContentTypes", - method='post'.upper(), - accept_content_type=accept_content_type, - ) - - assert isinstance(api_response.response, urllib3.HTTPResponse) - assert isinstance(api_response.body, self.response_body_schema) - deserialized_response_body = self.response_body_schema.from_openapi_data_( - payload, - configuration_=self.schema_config - ) - assert api_response.body == deserialized_response_body - - def test_wrong_bar_value_fails(self): - # wrong bar value - accept_content_type = 'application/json' - - with patch.object(urllib3.PoolManager, 'request') as mock_request: - payload = ( - { - "foo": - "foo", - "bar": - "bart", - } - ) - mock_request.return_value = self.response( - self.json_bytes(payload), - status=self.response_status - ) - with self.assertRaises((unit_test_api.ApiValueError, unit_test_api.ApiTypeError)): - self.api.post( - accept_content_types=(accept_content_type,) - ) - self.assert_pool_manager_request_called_with( - mock_request, - self.api_config.get_server_url('servers', None) + "/responseBody/postEnumsInPropertiesResponseBodyForContentTypes", - method='post'.upper(), - content_type=None, - accept_content_type=accept_content_type, - ) - - def test_missing_all_properties_is_invalid_fails(self): - # missing all properties is invalid - accept_content_type = 'application/json' - - with patch.object(urllib3.PoolManager, 'request') as mock_request: - payload = ( - { - } - ) - mock_request.return_value = self.response( - self.json_bytes(payload), - status=self.response_status - ) - with self.assertRaises((unit_test_api.ApiValueError, unit_test_api.ApiTypeError)): - self.api.post( - accept_content_types=(accept_content_type,) - ) - self.assert_pool_manager_request_called_with( - mock_request, - self.api_config.get_server_url('servers', None) + "/responseBody/postEnumsInPropertiesResponseBodyForContentTypes", - method='post'.upper(), - content_type=None, - accept_content_type=accept_content_type, - ) - - def test_missing_required_property_is_invalid_fails(self): - # missing required property is invalid - accept_content_type = 'application/json' - - with patch.object(urllib3.PoolManager, 'request') as mock_request: - payload = ( - { - "foo": - "foo", - } - ) - mock_request.return_value = self.response( - self.json_bytes(payload), - status=self.response_status - ) - with self.assertRaises((unit_test_api.ApiValueError, unit_test_api.ApiTypeError)): - self.api.post( - accept_content_types=(accept_content_type,) - ) - self.assert_pool_manager_request_called_with( - mock_request, - self.api_config.get_server_url('servers', None) + "/responseBody/postEnumsInPropertiesResponseBodyForContentTypes", - method='post'.upper(), - content_type=None, - accept_content_type=accept_content_type, - ) - -if __name__ == '__main__': - unittest.main() diff --git a/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_response_body_post_forbidden_property_response_body_for_content_types/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_response_body_post_forbidden_property_response_body_for_content_types/__init__.py index 7fa9d72465d..e69de29bb2d 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_response_body_post_forbidden_property_response_body_for_content_types/__init__.py +++ b/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_response_body_post_forbidden_property_response_body_for_content_types/__init__.py @@ -1,99 +0,0 @@ -# coding: utf-8 - -""" - - - Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator -""" - -import unittest -from unittest.mock import patch - -import urllib3 - -import unit_test_api -from unit_test_api.paths.response_body_post_forbidden_property_response_body_for_content_types.post import operation as post # noqa: E501 -from unit_test_api import schemas, api_client -from unit_test_api.configurations import api_configuration, schema_configuration - -from .. import ApiTestMixin - - -class TestPost(ApiTestMixin, unittest.TestCase): - """ - Post unit test stubs - """ - api_config = api_configuration.ApiConfiguration() - schema_config = schema_configuration.SchemaConfiguration() - used_api_client = api_client.ApiClient(configuration=api_config, schema_config=schema_config) - api = post.ApiForPost(api_client=used_api_client) # noqa: E501 - - response_status = 200 - response_body_schema = post.response_200.ResponseFor200.content["application/json"].schema - - def test_property_present_fails(self): - # property present - accept_content_type = 'application/json' - - with patch.object(urllib3.PoolManager, 'request') as mock_request: - payload = ( - { - "foo": - 1, - "bar": - 2, - } - ) - mock_request.return_value = self.response( - self.json_bytes(payload), - status=self.response_status - ) - with self.assertRaises((unit_test_api.ApiValueError, unit_test_api.ApiTypeError)): - self.api.post( - accept_content_types=(accept_content_type,) - ) - self.assert_pool_manager_request_called_with( - mock_request, - self.api_config.get_server_url('servers', None) + "/responseBody/postForbiddenPropertyResponseBodyForContentTypes", - method='post'.upper(), - content_type=None, - accept_content_type=accept_content_type, - ) - - def test_property_absent_passes(self): - # property absent - accept_content_type = 'application/json' - - with patch.object(urllib3.PoolManager, 'request') as mock_request: - payload = ( - { - "bar": - 1, - "baz": - 2, - } - ) - mock_request.return_value = self.response( - self.json_bytes(payload), - status=self.response_status - ) - api_response = self.api.post( - accept_content_types=(accept_content_type,) - ) - self.assert_pool_manager_request_called_with( - mock_request, - self.api_config.get_server_url('servers', None) + "/responseBody/postForbiddenPropertyResponseBodyForContentTypes", - method='post'.upper(), - accept_content_type=accept_content_type, - ) - - assert isinstance(api_response.response, urllib3.HTTPResponse) - assert isinstance(api_response.body, self.response_body_schema) - deserialized_response_body = self.response_body_schema.from_openapi_data_( - payload, - configuration_=self.schema_config - ) - assert api_response.body == deserialized_response_body - -if __name__ == '__main__': - unittest.main() diff --git a/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_response_body_post_hostname_format_response_body_for_content_types/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_response_body_post_hostname_format_response_body_for_content_types/__init__.py index 6c11a617489..e69de29bb2d 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_response_body_post_hostname_format_response_body_for_content_types/__init__.py +++ b/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_response_body_post_hostname_format_response_body_for_content_types/__init__.py @@ -1,217 +0,0 @@ -# coding: utf-8 - -""" - - - Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator -""" - -import unittest -from unittest.mock import patch - -import urllib3 - -import unit_test_api -from unit_test_api.paths.response_body_post_hostname_format_response_body_for_content_types.post import operation as post # noqa: E501 -from unit_test_api import schemas, api_client -from unit_test_api.configurations import api_configuration, schema_configuration - -from .. import ApiTestMixin - - -class TestPost(ApiTestMixin, unittest.TestCase): - """ - Post unit test stubs - """ - api_config = api_configuration.ApiConfiguration() - schema_config = schema_configuration.SchemaConfiguration() - used_api_client = api_client.ApiClient(configuration=api_config, schema_config=schema_config) - api = post.ApiForPost(api_client=used_api_client) # noqa: E501 - - response_status = 200 - response_body_schema = post.response_200.ResponseFor200.content["application/json"].schema - - def test_all_string_formats_ignore_objects_passes(self): - # all string formats ignore objects - accept_content_type = 'application/json' - - with patch.object(urllib3.PoolManager, 'request') as mock_request: - payload = ( - { - } - ) - mock_request.return_value = self.response( - self.json_bytes(payload), - status=self.response_status - ) - api_response = self.api.post( - accept_content_types=(accept_content_type,) - ) - self.assert_pool_manager_request_called_with( - mock_request, - self.api_config.get_server_url('servers', None) + "/responseBody/postHostnameFormatResponseBodyForContentTypes", - method='post'.upper(), - accept_content_type=accept_content_type, - ) - - assert isinstance(api_response.response, urllib3.HTTPResponse) - assert isinstance(api_response.body, self.response_body_schema) - deserialized_response_body = self.response_body_schema.from_openapi_data_( - payload, - configuration_=self.schema_config - ) - assert api_response.body == deserialized_response_body - - def test_all_string_formats_ignore_booleans_passes(self): - # all string formats ignore booleans - accept_content_type = 'application/json' - - with patch.object(urllib3.PoolManager, 'request') as mock_request: - payload = ( - False - ) - mock_request.return_value = self.response( - self.json_bytes(payload), - status=self.response_status - ) - api_response = self.api.post( - accept_content_types=(accept_content_type,) - ) - self.assert_pool_manager_request_called_with( - mock_request, - self.api_config.get_server_url('servers', None) + "/responseBody/postHostnameFormatResponseBodyForContentTypes", - method='post'.upper(), - accept_content_type=accept_content_type, - ) - - assert isinstance(api_response.response, urllib3.HTTPResponse) - assert isinstance(api_response.body, self.response_body_schema) - deserialized_response_body = self.response_body_schema.from_openapi_data_( - payload, - configuration_=self.schema_config - ) - assert api_response.body == deserialized_response_body - - def test_all_string_formats_ignore_integers_passes(self): - # all string formats ignore integers - accept_content_type = 'application/json' - - with patch.object(urllib3.PoolManager, 'request') as mock_request: - payload = ( - 12 - ) - mock_request.return_value = self.response( - self.json_bytes(payload), - status=self.response_status - ) - api_response = self.api.post( - accept_content_types=(accept_content_type,) - ) - self.assert_pool_manager_request_called_with( - mock_request, - self.api_config.get_server_url('servers', None) + "/responseBody/postHostnameFormatResponseBodyForContentTypes", - method='post'.upper(), - accept_content_type=accept_content_type, - ) - - assert isinstance(api_response.response, urllib3.HTTPResponse) - assert isinstance(api_response.body, self.response_body_schema) - deserialized_response_body = self.response_body_schema.from_openapi_data_( - payload, - configuration_=self.schema_config - ) - assert api_response.body == deserialized_response_body - - def test_all_string_formats_ignore_floats_passes(self): - # all string formats ignore floats - accept_content_type = 'application/json' - - with patch.object(urllib3.PoolManager, 'request') as mock_request: - payload = ( - 13.7 - ) - mock_request.return_value = self.response( - self.json_bytes(payload), - status=self.response_status - ) - api_response = self.api.post( - accept_content_types=(accept_content_type,) - ) - self.assert_pool_manager_request_called_with( - mock_request, - self.api_config.get_server_url('servers', None) + "/responseBody/postHostnameFormatResponseBodyForContentTypes", - method='post'.upper(), - accept_content_type=accept_content_type, - ) - - assert isinstance(api_response.response, urllib3.HTTPResponse) - assert isinstance(api_response.body, self.response_body_schema) - deserialized_response_body = self.response_body_schema.from_openapi_data_( - payload, - configuration_=self.schema_config - ) - assert api_response.body == deserialized_response_body - - def test_all_string_formats_ignore_arrays_passes(self): - # all string formats ignore arrays - accept_content_type = 'application/json' - - with patch.object(urllib3.PoolManager, 'request') as mock_request: - payload = ( - [ - ] - ) - mock_request.return_value = self.response( - self.json_bytes(payload), - status=self.response_status - ) - api_response = self.api.post( - accept_content_types=(accept_content_type,) - ) - self.assert_pool_manager_request_called_with( - mock_request, - self.api_config.get_server_url('servers', None) + "/responseBody/postHostnameFormatResponseBodyForContentTypes", - method='post'.upper(), - accept_content_type=accept_content_type, - ) - - assert isinstance(api_response.response, urllib3.HTTPResponse) - assert isinstance(api_response.body, self.response_body_schema) - deserialized_response_body = self.response_body_schema.from_openapi_data_( - payload, - configuration_=self.schema_config - ) - assert api_response.body == deserialized_response_body - - def test_all_string_formats_ignore_nulls_passes(self): - # all string formats ignore nulls - accept_content_type = 'application/json' - - with patch.object(urllib3.PoolManager, 'request') as mock_request: - payload = ( - None - ) - mock_request.return_value = self.response( - self.json_bytes(payload), - status=self.response_status - ) - api_response = self.api.post( - accept_content_types=(accept_content_type,) - ) - self.assert_pool_manager_request_called_with( - mock_request, - self.api_config.get_server_url('servers', None) + "/responseBody/postHostnameFormatResponseBodyForContentTypes", - method='post'.upper(), - accept_content_type=accept_content_type, - ) - - assert isinstance(api_response.response, urllib3.HTTPResponse) - assert isinstance(api_response.body, self.response_body_schema) - deserialized_response_body = self.response_body_schema.from_openapi_data_( - payload, - configuration_=self.schema_config - ) - assert api_response.body == deserialized_response_body - -if __name__ == '__main__': - unittest.main() diff --git a/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_response_body_post_integer_type_matches_integers_response_body_for_content_types/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_response_body_post_integer_type_matches_integers_response_body_for_content_types/__init__.py index 8b46fa7bc8a..e69de29bb2d 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_response_body_post_integer_type_matches_integers_response_body_for_content_types/__init__.py +++ b/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_response_body_post_integer_type_matches_integers_response_body_for_content_types/__init__.py @@ -1,265 +0,0 @@ -# coding: utf-8 - -""" - - - Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator -""" - -import unittest -from unittest.mock import patch - -import urllib3 - -import unit_test_api -from unit_test_api.paths.response_body_post_integer_type_matches_integers_response_body_for_content_types.post import operation as post # noqa: E501 -from unit_test_api import schemas, api_client -from unit_test_api.configurations import api_configuration, schema_configuration - -from .. import ApiTestMixin - - -class TestPost(ApiTestMixin, unittest.TestCase): - """ - Post unit test stubs - """ - api_config = api_configuration.ApiConfiguration() - schema_config = schema_configuration.SchemaConfiguration() - used_api_client = api_client.ApiClient(configuration=api_config, schema_config=schema_config) - api = post.ApiForPost(api_client=used_api_client) # noqa: E501 - - response_status = 200 - response_body_schema = post.response_200.ResponseFor200.content["application/json"].schema - - def test_an_object_is_not_an_integer_fails(self): - # an object is not an integer - accept_content_type = 'application/json' - - with patch.object(urllib3.PoolManager, 'request') as mock_request: - payload = ( - { - } - ) - mock_request.return_value = self.response( - self.json_bytes(payload), - status=self.response_status - ) - with self.assertRaises((unit_test_api.ApiValueError, unit_test_api.ApiTypeError)): - self.api.post( - accept_content_types=(accept_content_type,) - ) - self.assert_pool_manager_request_called_with( - mock_request, - self.api_config.get_server_url('servers', None) + "/responseBody/postIntegerTypeMatchesIntegersResponseBodyForContentTypes", - method='post'.upper(), - content_type=None, - accept_content_type=accept_content_type, - ) - - def test_a_string_is_not_an_integer_fails(self): - # a string is not an integer - accept_content_type = 'application/json' - - with patch.object(urllib3.PoolManager, 'request') as mock_request: - payload = ( - "foo" - ) - mock_request.return_value = self.response( - self.json_bytes(payload), - status=self.response_status - ) - with self.assertRaises((unit_test_api.ApiValueError, unit_test_api.ApiTypeError)): - self.api.post( - accept_content_types=(accept_content_type,) - ) - self.assert_pool_manager_request_called_with( - mock_request, - self.api_config.get_server_url('servers', None) + "/responseBody/postIntegerTypeMatchesIntegersResponseBodyForContentTypes", - method='post'.upper(), - content_type=None, - accept_content_type=accept_content_type, - ) - - def test_null_is_not_an_integer_fails(self): - # null is not an integer - accept_content_type = 'application/json' - - with patch.object(urllib3.PoolManager, 'request') as mock_request: - payload = ( - None - ) - mock_request.return_value = self.response( - self.json_bytes(payload), - status=self.response_status - ) - with self.assertRaises((unit_test_api.ApiValueError, unit_test_api.ApiTypeError)): - self.api.post( - accept_content_types=(accept_content_type,) - ) - self.assert_pool_manager_request_called_with( - mock_request, - self.api_config.get_server_url('servers', None) + "/responseBody/postIntegerTypeMatchesIntegersResponseBodyForContentTypes", - method='post'.upper(), - content_type=None, - accept_content_type=accept_content_type, - ) - - def test_a_float_with_zero_fractional_part_is_an_integer_passes(self): - # a float with zero fractional part is an integer - accept_content_type = 'application/json' - - with patch.object(urllib3.PoolManager, 'request') as mock_request: - payload = ( - 1.0 - ) - mock_request.return_value = self.response( - self.json_bytes(payload), - status=self.response_status - ) - api_response = self.api.post( - accept_content_types=(accept_content_type,) - ) - self.assert_pool_manager_request_called_with( - mock_request, - self.api_config.get_server_url('servers', None) + "/responseBody/postIntegerTypeMatchesIntegersResponseBodyForContentTypes", - method='post'.upper(), - accept_content_type=accept_content_type, - ) - - assert isinstance(api_response.response, urllib3.HTTPResponse) - assert isinstance(api_response.body, self.response_body_schema) - deserialized_response_body = self.response_body_schema.from_openapi_data_( - payload, - configuration_=self.schema_config - ) - assert api_response.body == deserialized_response_body - - def test_a_float_is_not_an_integer_fails(self): - # a float is not an integer - accept_content_type = 'application/json' - - with patch.object(urllib3.PoolManager, 'request') as mock_request: - payload = ( - 1.1 - ) - mock_request.return_value = self.response( - self.json_bytes(payload), - status=self.response_status - ) - with self.assertRaises((unit_test_api.ApiValueError, unit_test_api.ApiTypeError)): - self.api.post( - accept_content_types=(accept_content_type,) - ) - self.assert_pool_manager_request_called_with( - mock_request, - self.api_config.get_server_url('servers', None) + "/responseBody/postIntegerTypeMatchesIntegersResponseBodyForContentTypes", - method='post'.upper(), - content_type=None, - accept_content_type=accept_content_type, - ) - - def test_a_boolean_is_not_an_integer_fails(self): - # a boolean is not an integer - accept_content_type = 'application/json' - - with patch.object(urllib3.PoolManager, 'request') as mock_request: - payload = ( - True - ) - mock_request.return_value = self.response( - self.json_bytes(payload), - status=self.response_status - ) - with self.assertRaises((unit_test_api.ApiValueError, unit_test_api.ApiTypeError)): - self.api.post( - accept_content_types=(accept_content_type,) - ) - self.assert_pool_manager_request_called_with( - mock_request, - self.api_config.get_server_url('servers', None) + "/responseBody/postIntegerTypeMatchesIntegersResponseBodyForContentTypes", - method='post'.upper(), - content_type=None, - accept_content_type=accept_content_type, - ) - - def test_an_integer_is_an_integer_passes(self): - # an integer is an integer - accept_content_type = 'application/json' - - with patch.object(urllib3.PoolManager, 'request') as mock_request: - payload = ( - 1 - ) - mock_request.return_value = self.response( - self.json_bytes(payload), - status=self.response_status - ) - api_response = self.api.post( - accept_content_types=(accept_content_type,) - ) - self.assert_pool_manager_request_called_with( - mock_request, - self.api_config.get_server_url('servers', None) + "/responseBody/postIntegerTypeMatchesIntegersResponseBodyForContentTypes", - method='post'.upper(), - accept_content_type=accept_content_type, - ) - - assert isinstance(api_response.response, urllib3.HTTPResponse) - assert isinstance(api_response.body, self.response_body_schema) - deserialized_response_body = self.response_body_schema.from_openapi_data_( - payload, - configuration_=self.schema_config - ) - assert api_response.body == deserialized_response_body - - def test_a_string_is_still_not_an_integer_even_if_it_looks_like_one_fails(self): - # a string is still not an integer, even if it looks like one - accept_content_type = 'application/json' - - with patch.object(urllib3.PoolManager, 'request') as mock_request: - payload = ( - "1" - ) - mock_request.return_value = self.response( - self.json_bytes(payload), - status=self.response_status - ) - with self.assertRaises((unit_test_api.ApiValueError, unit_test_api.ApiTypeError)): - self.api.post( - accept_content_types=(accept_content_type,) - ) - self.assert_pool_manager_request_called_with( - mock_request, - self.api_config.get_server_url('servers', None) + "/responseBody/postIntegerTypeMatchesIntegersResponseBodyForContentTypes", - method='post'.upper(), - content_type=None, - accept_content_type=accept_content_type, - ) - - def test_an_array_is_not_an_integer_fails(self): - # an array is not an integer - accept_content_type = 'application/json' - - with patch.object(urllib3.PoolManager, 'request') as mock_request: - payload = ( - [ - ] - ) - mock_request.return_value = self.response( - self.json_bytes(payload), - status=self.response_status - ) - with self.assertRaises((unit_test_api.ApiValueError, unit_test_api.ApiTypeError)): - self.api.post( - accept_content_types=(accept_content_type,) - ) - self.assert_pool_manager_request_called_with( - mock_request, - self.api_config.get_server_url('servers', None) + "/responseBody/postIntegerTypeMatchesIntegersResponseBodyForContentTypes", - method='post'.upper(), - content_type=None, - accept_content_type=accept_content_type, - ) - -if __name__ == '__main__': - unittest.main() diff --git a/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_response_body_post_invalid_instance_should_not_raise_error_when_float_division_inf_response_body_for_content_types/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_response_body_post_invalid_instance_should_not_raise_error_when_float_division_inf_response_body_for_content_types/__init__.py index 9557fed5897..e69de29bb2d 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_response_body_post_invalid_instance_should_not_raise_error_when_float_division_inf_response_body_for_content_types/__init__.py +++ b/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_response_body_post_invalid_instance_should_not_raise_error_when_float_division_inf_response_body_for_content_types/__init__.py @@ -1,89 +0,0 @@ -# coding: utf-8 - -""" - - - Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator -""" - -import unittest -from unittest.mock import patch - -import urllib3 - -import unit_test_api -from unit_test_api.paths.response_body_post_invalid_instance_should_not_raise_error_when_float_division_inf_response_body_for_content_types.post import operation as post # noqa: E501 -from unit_test_api import schemas, api_client -from unit_test_api.configurations import api_configuration, schema_configuration - -from .. import ApiTestMixin - - -class TestPost(ApiTestMixin, unittest.TestCase): - """ - Post unit test stubs - """ - api_config = api_configuration.ApiConfiguration() - schema_config = schema_configuration.SchemaConfiguration() - used_api_client = api_client.ApiClient(configuration=api_config, schema_config=schema_config) - api = post.ApiForPost(api_client=used_api_client) # noqa: E501 - - response_status = 200 - response_body_schema = post.response_200.ResponseFor200.content["application/json"].schema - - def test_always_invalid_but_naive_implementations_may_raise_an_overflow_error_fails(self): - # always invalid, but naive implementations may raise an overflow error - accept_content_type = 'application/json' - - with patch.object(urllib3.PoolManager, 'request') as mock_request: - payload = ( - 1.0E308 - ) - mock_request.return_value = self.response( - self.json_bytes(payload), - status=self.response_status - ) - with self.assertRaises((unit_test_api.ApiValueError, unit_test_api.ApiTypeError)): - self.api.post( - accept_content_types=(accept_content_type,) - ) - self.assert_pool_manager_request_called_with( - mock_request, - self.api_config.get_server_url('servers', None) + "/responseBody/postInvalidInstanceShouldNotRaiseErrorWhenFloatDivisionInfResponseBodyForContentTypes", - method='post'.upper(), - content_type=None, - accept_content_type=accept_content_type, - ) - - def test_valid_integer_with_multipleof_float_passes(self): - # valid integer with multipleOf float - accept_content_type = 'application/json' - - with patch.object(urllib3.PoolManager, 'request') as mock_request: - payload = ( - 123456789 - ) - mock_request.return_value = self.response( - self.json_bytes(payload), - status=self.response_status - ) - api_response = self.api.post( - accept_content_types=(accept_content_type,) - ) - self.assert_pool_manager_request_called_with( - mock_request, - self.api_config.get_server_url('servers', None) + "/responseBody/postInvalidInstanceShouldNotRaiseErrorWhenFloatDivisionInfResponseBodyForContentTypes", - method='post'.upper(), - accept_content_type=accept_content_type, - ) - - assert isinstance(api_response.response, urllib3.HTTPResponse) - assert isinstance(api_response.body, self.response_body_schema) - deserialized_response_body = self.response_body_schema.from_openapi_data_( - payload, - configuration_=self.schema_config - ) - assert api_response.body == deserialized_response_body - -if __name__ == '__main__': - unittest.main() diff --git a/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_response_body_post_invalid_string_value_for_default_response_body_for_content_types/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_response_body_post_invalid_string_value_for_default_response_body_for_content_types/__init__.py index 8b3b7d7f5ab..e69de29bb2d 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_response_body_post_invalid_string_value_for_default_response_body_for_content_types/__init__.py +++ b/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_response_body_post_invalid_string_value_for_default_response_body_for_content_types/__init__.py @@ -1,99 +0,0 @@ -# coding: utf-8 - -""" - - - Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator -""" - -import unittest -from unittest.mock import patch - -import urllib3 - -import unit_test_api -from unit_test_api.paths.response_body_post_invalid_string_value_for_default_response_body_for_content_types.post import operation as post # noqa: E501 -from unit_test_api import schemas, api_client -from unit_test_api.configurations import api_configuration, schema_configuration - -from .. import ApiTestMixin - - -class TestPost(ApiTestMixin, unittest.TestCase): - """ - Post unit test stubs - """ - api_config = api_configuration.ApiConfiguration() - schema_config = schema_configuration.SchemaConfiguration() - used_api_client = api_client.ApiClient(configuration=api_config, schema_config=schema_config) - api = post.ApiForPost(api_client=used_api_client) # noqa: E501 - - response_status = 200 - response_body_schema = post.response_200.ResponseFor200.content["application/json"].schema - - def test_valid_when_property_is_specified_passes(self): - # valid when property is specified - accept_content_type = 'application/json' - - with patch.object(urllib3.PoolManager, 'request') as mock_request: - payload = ( - { - "bar": - "good", - } - ) - mock_request.return_value = self.response( - self.json_bytes(payload), - status=self.response_status - ) - api_response = self.api.post( - accept_content_types=(accept_content_type,) - ) - self.assert_pool_manager_request_called_with( - mock_request, - self.api_config.get_server_url('servers', None) + "/responseBody/postInvalidStringValueForDefaultResponseBodyForContentTypes", - method='post'.upper(), - accept_content_type=accept_content_type, - ) - - assert isinstance(api_response.response, urllib3.HTTPResponse) - assert isinstance(api_response.body, self.response_body_schema) - deserialized_response_body = self.response_body_schema.from_openapi_data_( - payload, - configuration_=self.schema_config - ) - assert api_response.body == deserialized_response_body - - def test_still_valid_when_the_invalid_default_is_used_passes(self): - # still valid when the invalid default is used - accept_content_type = 'application/json' - - with patch.object(urllib3.PoolManager, 'request') as mock_request: - payload = ( - { - } - ) - mock_request.return_value = self.response( - self.json_bytes(payload), - status=self.response_status - ) - api_response = self.api.post( - accept_content_types=(accept_content_type,) - ) - self.assert_pool_manager_request_called_with( - mock_request, - self.api_config.get_server_url('servers', None) + "/responseBody/postInvalidStringValueForDefaultResponseBodyForContentTypes", - method='post'.upper(), - accept_content_type=accept_content_type, - ) - - assert isinstance(api_response.response, urllib3.HTTPResponse) - assert isinstance(api_response.body, self.response_body_schema) - deserialized_response_body = self.response_body_schema.from_openapi_data_( - payload, - configuration_=self.schema_config - ) - assert api_response.body == deserialized_response_body - -if __name__ == '__main__': - unittest.main() diff --git a/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_response_body_post_ipv4_format_response_body_for_content_types/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_response_body_post_ipv4_format_response_body_for_content_types/__init__.py index 3edfea896ac..e69de29bb2d 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_response_body_post_ipv4_format_response_body_for_content_types/__init__.py +++ b/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_response_body_post_ipv4_format_response_body_for_content_types/__init__.py @@ -1,217 +0,0 @@ -# coding: utf-8 - -""" - - - Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator -""" - -import unittest -from unittest.mock import patch - -import urllib3 - -import unit_test_api -from unit_test_api.paths.response_body_post_ipv4_format_response_body_for_content_types.post import operation as post # noqa: E501 -from unit_test_api import schemas, api_client -from unit_test_api.configurations import api_configuration, schema_configuration - -from .. import ApiTestMixin - - -class TestPost(ApiTestMixin, unittest.TestCase): - """ - Post unit test stubs - """ - api_config = api_configuration.ApiConfiguration() - schema_config = schema_configuration.SchemaConfiguration() - used_api_client = api_client.ApiClient(configuration=api_config, schema_config=schema_config) - api = post.ApiForPost(api_client=used_api_client) # noqa: E501 - - response_status = 200 - response_body_schema = post.response_200.ResponseFor200.content["application/json"].schema - - def test_all_string_formats_ignore_objects_passes(self): - # all string formats ignore objects - accept_content_type = 'application/json' - - with patch.object(urllib3.PoolManager, 'request') as mock_request: - payload = ( - { - } - ) - mock_request.return_value = self.response( - self.json_bytes(payload), - status=self.response_status - ) - api_response = self.api.post( - accept_content_types=(accept_content_type,) - ) - self.assert_pool_manager_request_called_with( - mock_request, - self.api_config.get_server_url('servers', None) + "/responseBody/postIpv4FormatResponseBodyForContentTypes", - method='post'.upper(), - accept_content_type=accept_content_type, - ) - - assert isinstance(api_response.response, urllib3.HTTPResponse) - assert isinstance(api_response.body, self.response_body_schema) - deserialized_response_body = self.response_body_schema.from_openapi_data_( - payload, - configuration_=self.schema_config - ) - assert api_response.body == deserialized_response_body - - def test_all_string_formats_ignore_booleans_passes(self): - # all string formats ignore booleans - accept_content_type = 'application/json' - - with patch.object(urllib3.PoolManager, 'request') as mock_request: - payload = ( - False - ) - mock_request.return_value = self.response( - self.json_bytes(payload), - status=self.response_status - ) - api_response = self.api.post( - accept_content_types=(accept_content_type,) - ) - self.assert_pool_manager_request_called_with( - mock_request, - self.api_config.get_server_url('servers', None) + "/responseBody/postIpv4FormatResponseBodyForContentTypes", - method='post'.upper(), - accept_content_type=accept_content_type, - ) - - assert isinstance(api_response.response, urllib3.HTTPResponse) - assert isinstance(api_response.body, self.response_body_schema) - deserialized_response_body = self.response_body_schema.from_openapi_data_( - payload, - configuration_=self.schema_config - ) - assert api_response.body == deserialized_response_body - - def test_all_string_formats_ignore_integers_passes(self): - # all string formats ignore integers - accept_content_type = 'application/json' - - with patch.object(urllib3.PoolManager, 'request') as mock_request: - payload = ( - 12 - ) - mock_request.return_value = self.response( - self.json_bytes(payload), - status=self.response_status - ) - api_response = self.api.post( - accept_content_types=(accept_content_type,) - ) - self.assert_pool_manager_request_called_with( - mock_request, - self.api_config.get_server_url('servers', None) + "/responseBody/postIpv4FormatResponseBodyForContentTypes", - method='post'.upper(), - accept_content_type=accept_content_type, - ) - - assert isinstance(api_response.response, urllib3.HTTPResponse) - assert isinstance(api_response.body, self.response_body_schema) - deserialized_response_body = self.response_body_schema.from_openapi_data_( - payload, - configuration_=self.schema_config - ) - assert api_response.body == deserialized_response_body - - def test_all_string_formats_ignore_floats_passes(self): - # all string formats ignore floats - accept_content_type = 'application/json' - - with patch.object(urllib3.PoolManager, 'request') as mock_request: - payload = ( - 13.7 - ) - mock_request.return_value = self.response( - self.json_bytes(payload), - status=self.response_status - ) - api_response = self.api.post( - accept_content_types=(accept_content_type,) - ) - self.assert_pool_manager_request_called_with( - mock_request, - self.api_config.get_server_url('servers', None) + "/responseBody/postIpv4FormatResponseBodyForContentTypes", - method='post'.upper(), - accept_content_type=accept_content_type, - ) - - assert isinstance(api_response.response, urllib3.HTTPResponse) - assert isinstance(api_response.body, self.response_body_schema) - deserialized_response_body = self.response_body_schema.from_openapi_data_( - payload, - configuration_=self.schema_config - ) - assert api_response.body == deserialized_response_body - - def test_all_string_formats_ignore_arrays_passes(self): - # all string formats ignore arrays - accept_content_type = 'application/json' - - with patch.object(urllib3.PoolManager, 'request') as mock_request: - payload = ( - [ - ] - ) - mock_request.return_value = self.response( - self.json_bytes(payload), - status=self.response_status - ) - api_response = self.api.post( - accept_content_types=(accept_content_type,) - ) - self.assert_pool_manager_request_called_with( - mock_request, - self.api_config.get_server_url('servers', None) + "/responseBody/postIpv4FormatResponseBodyForContentTypes", - method='post'.upper(), - accept_content_type=accept_content_type, - ) - - assert isinstance(api_response.response, urllib3.HTTPResponse) - assert isinstance(api_response.body, self.response_body_schema) - deserialized_response_body = self.response_body_schema.from_openapi_data_( - payload, - configuration_=self.schema_config - ) - assert api_response.body == deserialized_response_body - - def test_all_string_formats_ignore_nulls_passes(self): - # all string formats ignore nulls - accept_content_type = 'application/json' - - with patch.object(urllib3.PoolManager, 'request') as mock_request: - payload = ( - None - ) - mock_request.return_value = self.response( - self.json_bytes(payload), - status=self.response_status - ) - api_response = self.api.post( - accept_content_types=(accept_content_type,) - ) - self.assert_pool_manager_request_called_with( - mock_request, - self.api_config.get_server_url('servers', None) + "/responseBody/postIpv4FormatResponseBodyForContentTypes", - method='post'.upper(), - accept_content_type=accept_content_type, - ) - - assert isinstance(api_response.response, urllib3.HTTPResponse) - assert isinstance(api_response.body, self.response_body_schema) - deserialized_response_body = self.response_body_schema.from_openapi_data_( - payload, - configuration_=self.schema_config - ) - assert api_response.body == deserialized_response_body - -if __name__ == '__main__': - unittest.main() diff --git a/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_response_body_post_ipv6_format_response_body_for_content_types/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_response_body_post_ipv6_format_response_body_for_content_types/__init__.py index 50fdbaf381e..e69de29bb2d 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_response_body_post_ipv6_format_response_body_for_content_types/__init__.py +++ b/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_response_body_post_ipv6_format_response_body_for_content_types/__init__.py @@ -1,217 +0,0 @@ -# coding: utf-8 - -""" - - - Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator -""" - -import unittest -from unittest.mock import patch - -import urllib3 - -import unit_test_api -from unit_test_api.paths.response_body_post_ipv6_format_response_body_for_content_types.post import operation as post # noqa: E501 -from unit_test_api import schemas, api_client -from unit_test_api.configurations import api_configuration, schema_configuration - -from .. import ApiTestMixin - - -class TestPost(ApiTestMixin, unittest.TestCase): - """ - Post unit test stubs - """ - api_config = api_configuration.ApiConfiguration() - schema_config = schema_configuration.SchemaConfiguration() - used_api_client = api_client.ApiClient(configuration=api_config, schema_config=schema_config) - api = post.ApiForPost(api_client=used_api_client) # noqa: E501 - - response_status = 200 - response_body_schema = post.response_200.ResponseFor200.content["application/json"].schema - - def test_all_string_formats_ignore_objects_passes(self): - # all string formats ignore objects - accept_content_type = 'application/json' - - with patch.object(urllib3.PoolManager, 'request') as mock_request: - payload = ( - { - } - ) - mock_request.return_value = self.response( - self.json_bytes(payload), - status=self.response_status - ) - api_response = self.api.post( - accept_content_types=(accept_content_type,) - ) - self.assert_pool_manager_request_called_with( - mock_request, - self.api_config.get_server_url('servers', None) + "/responseBody/postIpv6FormatResponseBodyForContentTypes", - method='post'.upper(), - accept_content_type=accept_content_type, - ) - - assert isinstance(api_response.response, urllib3.HTTPResponse) - assert isinstance(api_response.body, self.response_body_schema) - deserialized_response_body = self.response_body_schema.from_openapi_data_( - payload, - configuration_=self.schema_config - ) - assert api_response.body == deserialized_response_body - - def test_all_string_formats_ignore_booleans_passes(self): - # all string formats ignore booleans - accept_content_type = 'application/json' - - with patch.object(urllib3.PoolManager, 'request') as mock_request: - payload = ( - False - ) - mock_request.return_value = self.response( - self.json_bytes(payload), - status=self.response_status - ) - api_response = self.api.post( - accept_content_types=(accept_content_type,) - ) - self.assert_pool_manager_request_called_with( - mock_request, - self.api_config.get_server_url('servers', None) + "/responseBody/postIpv6FormatResponseBodyForContentTypes", - method='post'.upper(), - accept_content_type=accept_content_type, - ) - - assert isinstance(api_response.response, urllib3.HTTPResponse) - assert isinstance(api_response.body, self.response_body_schema) - deserialized_response_body = self.response_body_schema.from_openapi_data_( - payload, - configuration_=self.schema_config - ) - assert api_response.body == deserialized_response_body - - def test_all_string_formats_ignore_integers_passes(self): - # all string formats ignore integers - accept_content_type = 'application/json' - - with patch.object(urllib3.PoolManager, 'request') as mock_request: - payload = ( - 12 - ) - mock_request.return_value = self.response( - self.json_bytes(payload), - status=self.response_status - ) - api_response = self.api.post( - accept_content_types=(accept_content_type,) - ) - self.assert_pool_manager_request_called_with( - mock_request, - self.api_config.get_server_url('servers', None) + "/responseBody/postIpv6FormatResponseBodyForContentTypes", - method='post'.upper(), - accept_content_type=accept_content_type, - ) - - assert isinstance(api_response.response, urllib3.HTTPResponse) - assert isinstance(api_response.body, self.response_body_schema) - deserialized_response_body = self.response_body_schema.from_openapi_data_( - payload, - configuration_=self.schema_config - ) - assert api_response.body == deserialized_response_body - - def test_all_string_formats_ignore_floats_passes(self): - # all string formats ignore floats - accept_content_type = 'application/json' - - with patch.object(urllib3.PoolManager, 'request') as mock_request: - payload = ( - 13.7 - ) - mock_request.return_value = self.response( - self.json_bytes(payload), - status=self.response_status - ) - api_response = self.api.post( - accept_content_types=(accept_content_type,) - ) - self.assert_pool_manager_request_called_with( - mock_request, - self.api_config.get_server_url('servers', None) + "/responseBody/postIpv6FormatResponseBodyForContentTypes", - method='post'.upper(), - accept_content_type=accept_content_type, - ) - - assert isinstance(api_response.response, urllib3.HTTPResponse) - assert isinstance(api_response.body, self.response_body_schema) - deserialized_response_body = self.response_body_schema.from_openapi_data_( - payload, - configuration_=self.schema_config - ) - assert api_response.body == deserialized_response_body - - def test_all_string_formats_ignore_arrays_passes(self): - # all string formats ignore arrays - accept_content_type = 'application/json' - - with patch.object(urllib3.PoolManager, 'request') as mock_request: - payload = ( - [ - ] - ) - mock_request.return_value = self.response( - self.json_bytes(payload), - status=self.response_status - ) - api_response = self.api.post( - accept_content_types=(accept_content_type,) - ) - self.assert_pool_manager_request_called_with( - mock_request, - self.api_config.get_server_url('servers', None) + "/responseBody/postIpv6FormatResponseBodyForContentTypes", - method='post'.upper(), - accept_content_type=accept_content_type, - ) - - assert isinstance(api_response.response, urllib3.HTTPResponse) - assert isinstance(api_response.body, self.response_body_schema) - deserialized_response_body = self.response_body_schema.from_openapi_data_( - payload, - configuration_=self.schema_config - ) - assert api_response.body == deserialized_response_body - - def test_all_string_formats_ignore_nulls_passes(self): - # all string formats ignore nulls - accept_content_type = 'application/json' - - with patch.object(urllib3.PoolManager, 'request') as mock_request: - payload = ( - None - ) - mock_request.return_value = self.response( - self.json_bytes(payload), - status=self.response_status - ) - api_response = self.api.post( - accept_content_types=(accept_content_type,) - ) - self.assert_pool_manager_request_called_with( - mock_request, - self.api_config.get_server_url('servers', None) + "/responseBody/postIpv6FormatResponseBodyForContentTypes", - method='post'.upper(), - accept_content_type=accept_content_type, - ) - - assert isinstance(api_response.response, urllib3.HTTPResponse) - assert isinstance(api_response.body, self.response_body_schema) - deserialized_response_body = self.response_body_schema.from_openapi_data_( - payload, - configuration_=self.schema_config - ) - assert api_response.body == deserialized_response_body - -if __name__ == '__main__': - unittest.main() diff --git a/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_response_body_post_json_pointer_format_response_body_for_content_types/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_response_body_post_json_pointer_format_response_body_for_content_types/__init__.py index c576c1aacd8..e69de29bb2d 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_response_body_post_json_pointer_format_response_body_for_content_types/__init__.py +++ b/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_response_body_post_json_pointer_format_response_body_for_content_types/__init__.py @@ -1,217 +0,0 @@ -# coding: utf-8 - -""" - - - Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator -""" - -import unittest -from unittest.mock import patch - -import urllib3 - -import unit_test_api -from unit_test_api.paths.response_body_post_json_pointer_format_response_body_for_content_types.post import operation as post # noqa: E501 -from unit_test_api import schemas, api_client -from unit_test_api.configurations import api_configuration, schema_configuration - -from .. import ApiTestMixin - - -class TestPost(ApiTestMixin, unittest.TestCase): - """ - Post unit test stubs - """ - api_config = api_configuration.ApiConfiguration() - schema_config = schema_configuration.SchemaConfiguration() - used_api_client = api_client.ApiClient(configuration=api_config, schema_config=schema_config) - api = post.ApiForPost(api_client=used_api_client) # noqa: E501 - - response_status = 200 - response_body_schema = post.response_200.ResponseFor200.content["application/json"].schema - - def test_all_string_formats_ignore_objects_passes(self): - # all string formats ignore objects - accept_content_type = 'application/json' - - with patch.object(urllib3.PoolManager, 'request') as mock_request: - payload = ( - { - } - ) - mock_request.return_value = self.response( - self.json_bytes(payload), - status=self.response_status - ) - api_response = self.api.post( - accept_content_types=(accept_content_type,) - ) - self.assert_pool_manager_request_called_with( - mock_request, - self.api_config.get_server_url('servers', None) + "/responseBody/postJsonPointerFormatResponseBodyForContentTypes", - method='post'.upper(), - accept_content_type=accept_content_type, - ) - - assert isinstance(api_response.response, urllib3.HTTPResponse) - assert isinstance(api_response.body, self.response_body_schema) - deserialized_response_body = self.response_body_schema.from_openapi_data_( - payload, - configuration_=self.schema_config - ) - assert api_response.body == deserialized_response_body - - def test_all_string_formats_ignore_booleans_passes(self): - # all string formats ignore booleans - accept_content_type = 'application/json' - - with patch.object(urllib3.PoolManager, 'request') as mock_request: - payload = ( - False - ) - mock_request.return_value = self.response( - self.json_bytes(payload), - status=self.response_status - ) - api_response = self.api.post( - accept_content_types=(accept_content_type,) - ) - self.assert_pool_manager_request_called_with( - mock_request, - self.api_config.get_server_url('servers', None) + "/responseBody/postJsonPointerFormatResponseBodyForContentTypes", - method='post'.upper(), - accept_content_type=accept_content_type, - ) - - assert isinstance(api_response.response, urllib3.HTTPResponse) - assert isinstance(api_response.body, self.response_body_schema) - deserialized_response_body = self.response_body_schema.from_openapi_data_( - payload, - configuration_=self.schema_config - ) - assert api_response.body == deserialized_response_body - - def test_all_string_formats_ignore_integers_passes(self): - # all string formats ignore integers - accept_content_type = 'application/json' - - with patch.object(urllib3.PoolManager, 'request') as mock_request: - payload = ( - 12 - ) - mock_request.return_value = self.response( - self.json_bytes(payload), - status=self.response_status - ) - api_response = self.api.post( - accept_content_types=(accept_content_type,) - ) - self.assert_pool_manager_request_called_with( - mock_request, - self.api_config.get_server_url('servers', None) + "/responseBody/postJsonPointerFormatResponseBodyForContentTypes", - method='post'.upper(), - accept_content_type=accept_content_type, - ) - - assert isinstance(api_response.response, urllib3.HTTPResponse) - assert isinstance(api_response.body, self.response_body_schema) - deserialized_response_body = self.response_body_schema.from_openapi_data_( - payload, - configuration_=self.schema_config - ) - assert api_response.body == deserialized_response_body - - def test_all_string_formats_ignore_floats_passes(self): - # all string formats ignore floats - accept_content_type = 'application/json' - - with patch.object(urllib3.PoolManager, 'request') as mock_request: - payload = ( - 13.7 - ) - mock_request.return_value = self.response( - self.json_bytes(payload), - status=self.response_status - ) - api_response = self.api.post( - accept_content_types=(accept_content_type,) - ) - self.assert_pool_manager_request_called_with( - mock_request, - self.api_config.get_server_url('servers', None) + "/responseBody/postJsonPointerFormatResponseBodyForContentTypes", - method='post'.upper(), - accept_content_type=accept_content_type, - ) - - assert isinstance(api_response.response, urllib3.HTTPResponse) - assert isinstance(api_response.body, self.response_body_schema) - deserialized_response_body = self.response_body_schema.from_openapi_data_( - payload, - configuration_=self.schema_config - ) - assert api_response.body == deserialized_response_body - - def test_all_string_formats_ignore_arrays_passes(self): - # all string formats ignore arrays - accept_content_type = 'application/json' - - with patch.object(urllib3.PoolManager, 'request') as mock_request: - payload = ( - [ - ] - ) - mock_request.return_value = self.response( - self.json_bytes(payload), - status=self.response_status - ) - api_response = self.api.post( - accept_content_types=(accept_content_type,) - ) - self.assert_pool_manager_request_called_with( - mock_request, - self.api_config.get_server_url('servers', None) + "/responseBody/postJsonPointerFormatResponseBodyForContentTypes", - method='post'.upper(), - accept_content_type=accept_content_type, - ) - - assert isinstance(api_response.response, urllib3.HTTPResponse) - assert isinstance(api_response.body, self.response_body_schema) - deserialized_response_body = self.response_body_schema.from_openapi_data_( - payload, - configuration_=self.schema_config - ) - assert api_response.body == deserialized_response_body - - def test_all_string_formats_ignore_nulls_passes(self): - # all string formats ignore nulls - accept_content_type = 'application/json' - - with patch.object(urllib3.PoolManager, 'request') as mock_request: - payload = ( - None - ) - mock_request.return_value = self.response( - self.json_bytes(payload), - status=self.response_status - ) - api_response = self.api.post( - accept_content_types=(accept_content_type,) - ) - self.assert_pool_manager_request_called_with( - mock_request, - self.api_config.get_server_url('servers', None) + "/responseBody/postJsonPointerFormatResponseBodyForContentTypes", - method='post'.upper(), - accept_content_type=accept_content_type, - ) - - assert isinstance(api_response.response, urllib3.HTTPResponse) - assert isinstance(api_response.body, self.response_body_schema) - deserialized_response_body = self.response_body_schema.from_openapi_data_( - payload, - configuration_=self.schema_config - ) - assert api_response.body == deserialized_response_body - -if __name__ == '__main__': - unittest.main() diff --git a/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_response_body_post_maximum_validation_response_body_for_content_types/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_response_body_post_maximum_validation_response_body_for_content_types/__init__.py index 82bc89cbdcd..e69de29bb2d 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_response_body_post_maximum_validation_response_body_for_content_types/__init__.py +++ b/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_response_body_post_maximum_validation_response_body_for_content_types/__init__.py @@ -1,149 +0,0 @@ -# coding: utf-8 - -""" - - - Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator -""" - -import unittest -from unittest.mock import patch - -import urllib3 - -import unit_test_api -from unit_test_api.paths.response_body_post_maximum_validation_response_body_for_content_types.post import operation as post # noqa: E501 -from unit_test_api import schemas, api_client -from unit_test_api.configurations import api_configuration, schema_configuration - -from .. import ApiTestMixin - - -class TestPost(ApiTestMixin, unittest.TestCase): - """ - Post unit test stubs - """ - api_config = api_configuration.ApiConfiguration() - schema_config = schema_configuration.SchemaConfiguration() - used_api_client = api_client.ApiClient(configuration=api_config, schema_config=schema_config) - api = post.ApiForPost(api_client=used_api_client) # noqa: E501 - - response_status = 200 - response_body_schema = post.response_200.ResponseFor200.content["application/json"].schema - - def test_below_the_maximum_is_valid_passes(self): - # below the maximum is valid - accept_content_type = 'application/json' - - with patch.object(urllib3.PoolManager, 'request') as mock_request: - payload = ( - 2.6 - ) - mock_request.return_value = self.response( - self.json_bytes(payload), - status=self.response_status - ) - api_response = self.api.post( - accept_content_types=(accept_content_type,) - ) - self.assert_pool_manager_request_called_with( - mock_request, - self.api_config.get_server_url('servers', None) + "/responseBody/postMaximumValidationResponseBodyForContentTypes", - method='post'.upper(), - accept_content_type=accept_content_type, - ) - - assert isinstance(api_response.response, urllib3.HTTPResponse) - assert isinstance(api_response.body, self.response_body_schema) - deserialized_response_body = self.response_body_schema.from_openapi_data_( - payload, - configuration_=self.schema_config - ) - assert api_response.body == deserialized_response_body - - def test_boundary_point_is_valid_passes(self): - # boundary point is valid - accept_content_type = 'application/json' - - with patch.object(urllib3.PoolManager, 'request') as mock_request: - payload = ( - 3.0 - ) - mock_request.return_value = self.response( - self.json_bytes(payload), - status=self.response_status - ) - api_response = self.api.post( - accept_content_types=(accept_content_type,) - ) - self.assert_pool_manager_request_called_with( - mock_request, - self.api_config.get_server_url('servers', None) + "/responseBody/postMaximumValidationResponseBodyForContentTypes", - method='post'.upper(), - accept_content_type=accept_content_type, - ) - - assert isinstance(api_response.response, urllib3.HTTPResponse) - assert isinstance(api_response.body, self.response_body_schema) - deserialized_response_body = self.response_body_schema.from_openapi_data_( - payload, - configuration_=self.schema_config - ) - assert api_response.body == deserialized_response_body - - def test_above_the_maximum_is_invalid_fails(self): - # above the maximum is invalid - accept_content_type = 'application/json' - - with patch.object(urllib3.PoolManager, 'request') as mock_request: - payload = ( - 3.5 - ) - mock_request.return_value = self.response( - self.json_bytes(payload), - status=self.response_status - ) - with self.assertRaises((unit_test_api.ApiValueError, unit_test_api.ApiTypeError)): - self.api.post( - accept_content_types=(accept_content_type,) - ) - self.assert_pool_manager_request_called_with( - mock_request, - self.api_config.get_server_url('servers', None) + "/responseBody/postMaximumValidationResponseBodyForContentTypes", - method='post'.upper(), - content_type=None, - accept_content_type=accept_content_type, - ) - - def test_ignores_non_numbers_passes(self): - # ignores non-numbers - accept_content_type = 'application/json' - - with patch.object(urllib3.PoolManager, 'request') as mock_request: - payload = ( - "x" - ) - mock_request.return_value = self.response( - self.json_bytes(payload), - status=self.response_status - ) - api_response = self.api.post( - accept_content_types=(accept_content_type,) - ) - self.assert_pool_manager_request_called_with( - mock_request, - self.api_config.get_server_url('servers', None) + "/responseBody/postMaximumValidationResponseBodyForContentTypes", - method='post'.upper(), - accept_content_type=accept_content_type, - ) - - assert isinstance(api_response.response, urllib3.HTTPResponse) - assert isinstance(api_response.body, self.response_body_schema) - deserialized_response_body = self.response_body_schema.from_openapi_data_( - payload, - configuration_=self.schema_config - ) - assert api_response.body == deserialized_response_body - -if __name__ == '__main__': - unittest.main() diff --git a/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_response_body_post_maximum_validation_with_unsigned_integer_response_body_for_content_types/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_response_body_post_maximum_validation_with_unsigned_integer_response_body_for_content_types/__init__.py index 8cf94c7364f..e69de29bb2d 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_response_body_post_maximum_validation_with_unsigned_integer_response_body_for_content_types/__init__.py +++ b/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_response_body_post_maximum_validation_with_unsigned_integer_response_body_for_content_types/__init__.py @@ -1,149 +0,0 @@ -# coding: utf-8 - -""" - - - Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator -""" - -import unittest -from unittest.mock import patch - -import urllib3 - -import unit_test_api -from unit_test_api.paths.response_body_post_maximum_validation_with_unsigned_integer_response_body_for_content_types.post import operation as post # noqa: E501 -from unit_test_api import schemas, api_client -from unit_test_api.configurations import api_configuration, schema_configuration - -from .. import ApiTestMixin - - -class TestPost(ApiTestMixin, unittest.TestCase): - """ - Post unit test stubs - """ - api_config = api_configuration.ApiConfiguration() - schema_config = schema_configuration.SchemaConfiguration() - used_api_client = api_client.ApiClient(configuration=api_config, schema_config=schema_config) - api = post.ApiForPost(api_client=used_api_client) # noqa: E501 - - response_status = 200 - response_body_schema = post.response_200.ResponseFor200.content["application/json"].schema - - def test_below_the_maximum_is_invalid_passes(self): - # below the maximum is invalid - accept_content_type = 'application/json' - - with patch.object(urllib3.PoolManager, 'request') as mock_request: - payload = ( - 299.97 - ) - mock_request.return_value = self.response( - self.json_bytes(payload), - status=self.response_status - ) - api_response = self.api.post( - accept_content_types=(accept_content_type,) - ) - self.assert_pool_manager_request_called_with( - mock_request, - self.api_config.get_server_url('servers', None) + "/responseBody/postMaximumValidationWithUnsignedIntegerResponseBodyForContentTypes", - method='post'.upper(), - accept_content_type=accept_content_type, - ) - - assert isinstance(api_response.response, urllib3.HTTPResponse) - assert isinstance(api_response.body, self.response_body_schema) - deserialized_response_body = self.response_body_schema.from_openapi_data_( - payload, - configuration_=self.schema_config - ) - assert api_response.body == deserialized_response_body - - def test_above_the_maximum_is_invalid_fails(self): - # above the maximum is invalid - accept_content_type = 'application/json' - - with patch.object(urllib3.PoolManager, 'request') as mock_request: - payload = ( - 300.5 - ) - mock_request.return_value = self.response( - self.json_bytes(payload), - status=self.response_status - ) - with self.assertRaises((unit_test_api.ApiValueError, unit_test_api.ApiTypeError)): - self.api.post( - accept_content_types=(accept_content_type,) - ) - self.assert_pool_manager_request_called_with( - mock_request, - self.api_config.get_server_url('servers', None) + "/responseBody/postMaximumValidationWithUnsignedIntegerResponseBodyForContentTypes", - method='post'.upper(), - content_type=None, - accept_content_type=accept_content_type, - ) - - def test_boundary_point_integer_is_valid_passes(self): - # boundary point integer is valid - accept_content_type = 'application/json' - - with patch.object(urllib3.PoolManager, 'request') as mock_request: - payload = ( - 300 - ) - mock_request.return_value = self.response( - self.json_bytes(payload), - status=self.response_status - ) - api_response = self.api.post( - accept_content_types=(accept_content_type,) - ) - self.assert_pool_manager_request_called_with( - mock_request, - self.api_config.get_server_url('servers', None) + "/responseBody/postMaximumValidationWithUnsignedIntegerResponseBodyForContentTypes", - method='post'.upper(), - accept_content_type=accept_content_type, - ) - - assert isinstance(api_response.response, urllib3.HTTPResponse) - assert isinstance(api_response.body, self.response_body_schema) - deserialized_response_body = self.response_body_schema.from_openapi_data_( - payload, - configuration_=self.schema_config - ) - assert api_response.body == deserialized_response_body - - def test_boundary_point_float_is_valid_passes(self): - # boundary point float is valid - accept_content_type = 'application/json' - - with patch.object(urllib3.PoolManager, 'request') as mock_request: - payload = ( - 300.0 - ) - mock_request.return_value = self.response( - self.json_bytes(payload), - status=self.response_status - ) - api_response = self.api.post( - accept_content_types=(accept_content_type,) - ) - self.assert_pool_manager_request_called_with( - mock_request, - self.api_config.get_server_url('servers', None) + "/responseBody/postMaximumValidationWithUnsignedIntegerResponseBodyForContentTypes", - method='post'.upper(), - accept_content_type=accept_content_type, - ) - - assert isinstance(api_response.response, urllib3.HTTPResponse) - assert isinstance(api_response.body, self.response_body_schema) - deserialized_response_body = self.response_body_schema.from_openapi_data_( - payload, - configuration_=self.schema_config - ) - assert api_response.body == deserialized_response_body - -if __name__ == '__main__': - unittest.main() diff --git a/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_response_body_post_maxitems_validation_response_body_for_content_types/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_response_body_post_maxitems_validation_response_body_for_content_types/__init__.py index 1b453dfe07c..e69de29bb2d 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_response_body_post_maxitems_validation_response_body_for_content_types/__init__.py +++ b/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_response_body_post_maxitems_validation_response_body_for_content_types/__init__.py @@ -1,158 +0,0 @@ -# coding: utf-8 - -""" - - - Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator -""" - -import unittest -from unittest.mock import patch - -import urllib3 - -import unit_test_api -from unit_test_api.paths.response_body_post_maxitems_validation_response_body_for_content_types.post import operation as post # noqa: E501 -from unit_test_api import schemas, api_client -from unit_test_api.configurations import api_configuration, schema_configuration - -from .. import ApiTestMixin - - -class TestPost(ApiTestMixin, unittest.TestCase): - """ - Post unit test stubs - """ - api_config = api_configuration.ApiConfiguration() - schema_config = schema_configuration.SchemaConfiguration() - used_api_client = api_client.ApiClient(configuration=api_config, schema_config=schema_config) - api = post.ApiForPost(api_client=used_api_client) # noqa: E501 - - response_status = 200 - response_body_schema = post.response_200.ResponseFor200.content["application/json"].schema - - def test_too_long_is_invalid_fails(self): - # too long is invalid - accept_content_type = 'application/json' - - with patch.object(urllib3.PoolManager, 'request') as mock_request: - payload = ( - [ - 1, - 2, - 3, - ] - ) - mock_request.return_value = self.response( - self.json_bytes(payload), - status=self.response_status - ) - with self.assertRaises((unit_test_api.ApiValueError, unit_test_api.ApiTypeError)): - self.api.post( - accept_content_types=(accept_content_type,) - ) - self.assert_pool_manager_request_called_with( - mock_request, - self.api_config.get_server_url('servers', None) + "/responseBody/postMaxitemsValidationResponseBodyForContentTypes", - method='post'.upper(), - content_type=None, - accept_content_type=accept_content_type, - ) - - def test_ignores_non_arrays_passes(self): - # ignores non-arrays - accept_content_type = 'application/json' - - with patch.object(urllib3.PoolManager, 'request') as mock_request: - payload = ( - "foobar" - ) - mock_request.return_value = self.response( - self.json_bytes(payload), - status=self.response_status - ) - api_response = self.api.post( - accept_content_types=(accept_content_type,) - ) - self.assert_pool_manager_request_called_with( - mock_request, - self.api_config.get_server_url('servers', None) + "/responseBody/postMaxitemsValidationResponseBodyForContentTypes", - method='post'.upper(), - accept_content_type=accept_content_type, - ) - - assert isinstance(api_response.response, urllib3.HTTPResponse) - assert isinstance(api_response.body, self.response_body_schema) - deserialized_response_body = self.response_body_schema.from_openapi_data_( - payload, - configuration_=self.schema_config - ) - assert api_response.body == deserialized_response_body - - def test_shorter_is_valid_passes(self): - # shorter is valid - accept_content_type = 'application/json' - - with patch.object(urllib3.PoolManager, 'request') as mock_request: - payload = ( - [ - 1, - ] - ) - mock_request.return_value = self.response( - self.json_bytes(payload), - status=self.response_status - ) - api_response = self.api.post( - accept_content_types=(accept_content_type,) - ) - self.assert_pool_manager_request_called_with( - mock_request, - self.api_config.get_server_url('servers', None) + "/responseBody/postMaxitemsValidationResponseBodyForContentTypes", - method='post'.upper(), - accept_content_type=accept_content_type, - ) - - assert isinstance(api_response.response, urllib3.HTTPResponse) - assert isinstance(api_response.body, self.response_body_schema) - deserialized_response_body = self.response_body_schema.from_openapi_data_( - payload, - configuration_=self.schema_config - ) - assert api_response.body == deserialized_response_body - - def test_exact_length_is_valid_passes(self): - # exact length is valid - accept_content_type = 'application/json' - - with patch.object(urllib3.PoolManager, 'request') as mock_request: - payload = ( - [ - 1, - 2, - ] - ) - mock_request.return_value = self.response( - self.json_bytes(payload), - status=self.response_status - ) - api_response = self.api.post( - accept_content_types=(accept_content_type,) - ) - self.assert_pool_manager_request_called_with( - mock_request, - self.api_config.get_server_url('servers', None) + "/responseBody/postMaxitemsValidationResponseBodyForContentTypes", - method='post'.upper(), - accept_content_type=accept_content_type, - ) - - assert isinstance(api_response.response, urllib3.HTTPResponse) - assert isinstance(api_response.body, self.response_body_schema) - deserialized_response_body = self.response_body_schema.from_openapi_data_( - payload, - configuration_=self.schema_config - ) - assert api_response.body == deserialized_response_body - -if __name__ == '__main__': - unittest.main() diff --git a/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_response_body_post_maxlength_validation_response_body_for_content_types/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_response_body_post_maxlength_validation_response_body_for_content_types/__init__.py index 09056d486bd..e69de29bb2d 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_response_body_post_maxlength_validation_response_body_for_content_types/__init__.py +++ b/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_response_body_post_maxlength_validation_response_body_for_content_types/__init__.py @@ -1,179 +0,0 @@ -# coding: utf-8 - -""" - - - Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator -""" - -import unittest -from unittest.mock import patch - -import urllib3 - -import unit_test_api -from unit_test_api.paths.response_body_post_maxlength_validation_response_body_for_content_types.post import operation as post # noqa: E501 -from unit_test_api import schemas, api_client -from unit_test_api.configurations import api_configuration, schema_configuration - -from .. import ApiTestMixin - - -class TestPost(ApiTestMixin, unittest.TestCase): - """ - Post unit test stubs - """ - api_config = api_configuration.ApiConfiguration() - schema_config = schema_configuration.SchemaConfiguration() - used_api_client = api_client.ApiClient(configuration=api_config, schema_config=schema_config) - api = post.ApiForPost(api_client=used_api_client) # noqa: E501 - - response_status = 200 - response_body_schema = post.response_200.ResponseFor200.content["application/json"].schema - - def test_too_long_is_invalid_fails(self): - # too long is invalid - accept_content_type = 'application/json' - - with patch.object(urllib3.PoolManager, 'request') as mock_request: - payload = ( - "foo" - ) - mock_request.return_value = self.response( - self.json_bytes(payload), - status=self.response_status - ) - with self.assertRaises((unit_test_api.ApiValueError, unit_test_api.ApiTypeError)): - self.api.post( - accept_content_types=(accept_content_type,) - ) - self.assert_pool_manager_request_called_with( - mock_request, - self.api_config.get_server_url('servers', None) + "/responseBody/postMaxlengthValidationResponseBodyForContentTypes", - method='post'.upper(), - content_type=None, - accept_content_type=accept_content_type, - ) - - def test_ignores_non_strings_passes(self): - # ignores non-strings - accept_content_type = 'application/json' - - with patch.object(urllib3.PoolManager, 'request') as mock_request: - payload = ( - 100 - ) - mock_request.return_value = self.response( - self.json_bytes(payload), - status=self.response_status - ) - api_response = self.api.post( - accept_content_types=(accept_content_type,) - ) - self.assert_pool_manager_request_called_with( - mock_request, - self.api_config.get_server_url('servers', None) + "/responseBody/postMaxlengthValidationResponseBodyForContentTypes", - method='post'.upper(), - accept_content_type=accept_content_type, - ) - - assert isinstance(api_response.response, urllib3.HTTPResponse) - assert isinstance(api_response.body, self.response_body_schema) - deserialized_response_body = self.response_body_schema.from_openapi_data_( - payload, - configuration_=self.schema_config - ) - assert api_response.body == deserialized_response_body - - def test_shorter_is_valid_passes(self): - # shorter is valid - accept_content_type = 'application/json' - - with patch.object(urllib3.PoolManager, 'request') as mock_request: - payload = ( - "f" - ) - mock_request.return_value = self.response( - self.json_bytes(payload), - status=self.response_status - ) - api_response = self.api.post( - accept_content_types=(accept_content_type,) - ) - self.assert_pool_manager_request_called_with( - mock_request, - self.api_config.get_server_url('servers', None) + "/responseBody/postMaxlengthValidationResponseBodyForContentTypes", - method='post'.upper(), - accept_content_type=accept_content_type, - ) - - assert isinstance(api_response.response, urllib3.HTTPResponse) - assert isinstance(api_response.body, self.response_body_schema) - deserialized_response_body = self.response_body_schema.from_openapi_data_( - payload, - configuration_=self.schema_config - ) - assert api_response.body == deserialized_response_body - - def test_two_supplementary_unicode_code_points_is_long_enough_passes(self): - # two supplementary Unicode code points is long enough - accept_content_type = 'application/json' - - with patch.object(urllib3.PoolManager, 'request') as mock_request: - payload = ( - "💩💩" - ) - mock_request.return_value = self.response( - self.json_bytes(payload), - status=self.response_status - ) - api_response = self.api.post( - accept_content_types=(accept_content_type,) - ) - self.assert_pool_manager_request_called_with( - mock_request, - self.api_config.get_server_url('servers', None) + "/responseBody/postMaxlengthValidationResponseBodyForContentTypes", - method='post'.upper(), - accept_content_type=accept_content_type, - ) - - assert isinstance(api_response.response, urllib3.HTTPResponse) - assert isinstance(api_response.body, self.response_body_schema) - deserialized_response_body = self.response_body_schema.from_openapi_data_( - payload, - configuration_=self.schema_config - ) - assert api_response.body == deserialized_response_body - - def test_exact_length_is_valid_passes(self): - # exact length is valid - accept_content_type = 'application/json' - - with patch.object(urllib3.PoolManager, 'request') as mock_request: - payload = ( - "fo" - ) - mock_request.return_value = self.response( - self.json_bytes(payload), - status=self.response_status - ) - api_response = self.api.post( - accept_content_types=(accept_content_type,) - ) - self.assert_pool_manager_request_called_with( - mock_request, - self.api_config.get_server_url('servers', None) + "/responseBody/postMaxlengthValidationResponseBodyForContentTypes", - method='post'.upper(), - accept_content_type=accept_content_type, - ) - - assert isinstance(api_response.response, urllib3.HTTPResponse) - assert isinstance(api_response.body, self.response_body_schema) - deserialized_response_body = self.response_body_schema.from_openapi_data_( - payload, - configuration_=self.schema_config - ) - assert api_response.body == deserialized_response_body - -if __name__ == '__main__': - unittest.main() diff --git a/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_response_body_post_maxproperties0_means_the_object_is_empty_response_body_for_content_types/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_response_body_post_maxproperties0_means_the_object_is_empty_response_body_for_content_types/__init__.py index a7d00e17dac..e69de29bb2d 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_response_body_post_maxproperties0_means_the_object_is_empty_response_body_for_content_types/__init__.py +++ b/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_response_body_post_maxproperties0_means_the_object_is_empty_response_body_for_content_types/__init__.py @@ -1,93 +0,0 @@ -# coding: utf-8 - -""" - - - Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator -""" - -import unittest -from unittest.mock import patch - -import urllib3 - -import unit_test_api -from unit_test_api.paths.response_body_post_maxproperties0_means_the_object_is_empty_response_body_for_content_types.post import operation as post # noqa: E501 -from unit_test_api import schemas, api_client -from unit_test_api.configurations import api_configuration, schema_configuration - -from .. import ApiTestMixin - - -class TestPost(ApiTestMixin, unittest.TestCase): - """ - Post unit test stubs - """ - api_config = api_configuration.ApiConfiguration() - schema_config = schema_configuration.SchemaConfiguration() - used_api_client = api_client.ApiClient(configuration=api_config, schema_config=schema_config) - api = post.ApiForPost(api_client=used_api_client) # noqa: E501 - - response_status = 200 - response_body_schema = post.response_200.ResponseFor200.content["application/json"].schema - - def test_no_properties_is_valid_passes(self): - # no properties is valid - accept_content_type = 'application/json' - - with patch.object(urllib3.PoolManager, 'request') as mock_request: - payload = ( - { - } - ) - mock_request.return_value = self.response( - self.json_bytes(payload), - status=self.response_status - ) - api_response = self.api.post( - accept_content_types=(accept_content_type,) - ) - self.assert_pool_manager_request_called_with( - mock_request, - self.api_config.get_server_url('servers', None) + "/responseBody/postMaxproperties0MeansTheObjectIsEmptyResponseBodyForContentTypes", - method='post'.upper(), - accept_content_type=accept_content_type, - ) - - assert isinstance(api_response.response, urllib3.HTTPResponse) - assert isinstance(api_response.body, self.response_body_schema) - deserialized_response_body = self.response_body_schema.from_openapi_data_( - payload, - configuration_=self.schema_config - ) - assert api_response.body == deserialized_response_body - - def test_one_property_is_invalid_fails(self): - # one property is invalid - accept_content_type = 'application/json' - - with patch.object(urllib3.PoolManager, 'request') as mock_request: - payload = ( - { - "foo": - 1, - } - ) - mock_request.return_value = self.response( - self.json_bytes(payload), - status=self.response_status - ) - with self.assertRaises((unit_test_api.ApiValueError, unit_test_api.ApiTypeError)): - self.api.post( - accept_content_types=(accept_content_type,) - ) - self.assert_pool_manager_request_called_with( - mock_request, - self.api_config.get_server_url('servers', None) + "/responseBody/postMaxproperties0MeansTheObjectIsEmptyResponseBodyForContentTypes", - method='post'.upper(), - content_type=None, - accept_content_type=accept_content_type, - ) - -if __name__ == '__main__': - unittest.main() diff --git a/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_response_body_post_maxproperties_validation_response_body_for_content_types/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_response_body_post_maxproperties_validation_response_body_for_content_types/__init__.py index 03cdfb61f1c..e69de29bb2d 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_response_body_post_maxproperties_validation_response_body_for_content_types/__init__.py +++ b/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_response_body_post_maxproperties_validation_response_body_for_content_types/__init__.py @@ -1,228 +0,0 @@ -# coding: utf-8 - -""" - - - Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator -""" - -import unittest -from unittest.mock import patch - -import urllib3 - -import unit_test_api -from unit_test_api.paths.response_body_post_maxproperties_validation_response_body_for_content_types.post import operation as post # noqa: E501 -from unit_test_api import schemas, api_client -from unit_test_api.configurations import api_configuration, schema_configuration - -from .. import ApiTestMixin - - -class TestPost(ApiTestMixin, unittest.TestCase): - """ - Post unit test stubs - """ - api_config = api_configuration.ApiConfiguration() - schema_config = schema_configuration.SchemaConfiguration() - used_api_client = api_client.ApiClient(configuration=api_config, schema_config=schema_config) - api = post.ApiForPost(api_client=used_api_client) # noqa: E501 - - response_status = 200 - response_body_schema = post.response_200.ResponseFor200.content["application/json"].schema - - def test_too_long_is_invalid_fails(self): - # too long is invalid - accept_content_type = 'application/json' - - with patch.object(urllib3.PoolManager, 'request') as mock_request: - payload = ( - { - "foo": - 1, - "bar": - 2, - "baz": - 3, - } - ) - mock_request.return_value = self.response( - self.json_bytes(payload), - status=self.response_status - ) - with self.assertRaises((unit_test_api.ApiValueError, unit_test_api.ApiTypeError)): - self.api.post( - accept_content_types=(accept_content_type,) - ) - self.assert_pool_manager_request_called_with( - mock_request, - self.api_config.get_server_url('servers', None) + "/responseBody/postMaxpropertiesValidationResponseBodyForContentTypes", - method='post'.upper(), - content_type=None, - accept_content_type=accept_content_type, - ) - - def test_ignores_arrays_passes(self): - # ignores arrays - accept_content_type = 'application/json' - - with patch.object(urllib3.PoolManager, 'request') as mock_request: - payload = ( - [ - 1, - 2, - 3, - ] - ) - mock_request.return_value = self.response( - self.json_bytes(payload), - status=self.response_status - ) - api_response = self.api.post( - accept_content_types=(accept_content_type,) - ) - self.assert_pool_manager_request_called_with( - mock_request, - self.api_config.get_server_url('servers', None) + "/responseBody/postMaxpropertiesValidationResponseBodyForContentTypes", - method='post'.upper(), - accept_content_type=accept_content_type, - ) - - assert isinstance(api_response.response, urllib3.HTTPResponse) - assert isinstance(api_response.body, self.response_body_schema) - deserialized_response_body = self.response_body_schema.from_openapi_data_( - payload, - configuration_=self.schema_config - ) - assert api_response.body == deserialized_response_body - - def test_ignores_other_non_objects_passes(self): - # ignores other non-objects - accept_content_type = 'application/json' - - with patch.object(urllib3.PoolManager, 'request') as mock_request: - payload = ( - 12 - ) - mock_request.return_value = self.response( - self.json_bytes(payload), - status=self.response_status - ) - api_response = self.api.post( - accept_content_types=(accept_content_type,) - ) - self.assert_pool_manager_request_called_with( - mock_request, - self.api_config.get_server_url('servers', None) + "/responseBody/postMaxpropertiesValidationResponseBodyForContentTypes", - method='post'.upper(), - accept_content_type=accept_content_type, - ) - - assert isinstance(api_response.response, urllib3.HTTPResponse) - assert isinstance(api_response.body, self.response_body_schema) - deserialized_response_body = self.response_body_schema.from_openapi_data_( - payload, - configuration_=self.schema_config - ) - assert api_response.body == deserialized_response_body - - def test_ignores_strings_passes(self): - # ignores strings - accept_content_type = 'application/json' - - with patch.object(urllib3.PoolManager, 'request') as mock_request: - payload = ( - "foobar" - ) - mock_request.return_value = self.response( - self.json_bytes(payload), - status=self.response_status - ) - api_response = self.api.post( - accept_content_types=(accept_content_type,) - ) - self.assert_pool_manager_request_called_with( - mock_request, - self.api_config.get_server_url('servers', None) + "/responseBody/postMaxpropertiesValidationResponseBodyForContentTypes", - method='post'.upper(), - accept_content_type=accept_content_type, - ) - - assert isinstance(api_response.response, urllib3.HTTPResponse) - assert isinstance(api_response.body, self.response_body_schema) - deserialized_response_body = self.response_body_schema.from_openapi_data_( - payload, - configuration_=self.schema_config - ) - assert api_response.body == deserialized_response_body - - def test_shorter_is_valid_passes(self): - # shorter is valid - accept_content_type = 'application/json' - - with patch.object(urllib3.PoolManager, 'request') as mock_request: - payload = ( - { - "foo": - 1, - } - ) - mock_request.return_value = self.response( - self.json_bytes(payload), - status=self.response_status - ) - api_response = self.api.post( - accept_content_types=(accept_content_type,) - ) - self.assert_pool_manager_request_called_with( - mock_request, - self.api_config.get_server_url('servers', None) + "/responseBody/postMaxpropertiesValidationResponseBodyForContentTypes", - method='post'.upper(), - accept_content_type=accept_content_type, - ) - - assert isinstance(api_response.response, urllib3.HTTPResponse) - assert isinstance(api_response.body, self.response_body_schema) - deserialized_response_body = self.response_body_schema.from_openapi_data_( - payload, - configuration_=self.schema_config - ) - assert api_response.body == deserialized_response_body - - def test_exact_length_is_valid_passes(self): - # exact length is valid - accept_content_type = 'application/json' - - with patch.object(urllib3.PoolManager, 'request') as mock_request: - payload = ( - { - "foo": - 1, - "bar": - 2, - } - ) - mock_request.return_value = self.response( - self.json_bytes(payload), - status=self.response_status - ) - api_response = self.api.post( - accept_content_types=(accept_content_type,) - ) - self.assert_pool_manager_request_called_with( - mock_request, - self.api_config.get_server_url('servers', None) + "/responseBody/postMaxpropertiesValidationResponseBodyForContentTypes", - method='post'.upper(), - accept_content_type=accept_content_type, - ) - - assert isinstance(api_response.response, urllib3.HTTPResponse) - assert isinstance(api_response.body, self.response_body_schema) - deserialized_response_body = self.response_body_schema.from_openapi_data_( - payload, - configuration_=self.schema_config - ) - assert api_response.body == deserialized_response_body - -if __name__ == '__main__': - unittest.main() diff --git a/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_response_body_post_minimum_validation_response_body_for_content_types/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_response_body_post_minimum_validation_response_body_for_content_types/__init__.py index b223888044a..e69de29bb2d 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_response_body_post_minimum_validation_response_body_for_content_types/__init__.py +++ b/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_response_body_post_minimum_validation_response_body_for_content_types/__init__.py @@ -1,149 +0,0 @@ -# coding: utf-8 - -""" - - - Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator -""" - -import unittest -from unittest.mock import patch - -import urllib3 - -import unit_test_api -from unit_test_api.paths.response_body_post_minimum_validation_response_body_for_content_types.post import operation as post # noqa: E501 -from unit_test_api import schemas, api_client -from unit_test_api.configurations import api_configuration, schema_configuration - -from .. import ApiTestMixin - - -class TestPost(ApiTestMixin, unittest.TestCase): - """ - Post unit test stubs - """ - api_config = api_configuration.ApiConfiguration() - schema_config = schema_configuration.SchemaConfiguration() - used_api_client = api_client.ApiClient(configuration=api_config, schema_config=schema_config) - api = post.ApiForPost(api_client=used_api_client) # noqa: E501 - - response_status = 200 - response_body_schema = post.response_200.ResponseFor200.content["application/json"].schema - - def test_boundary_point_is_valid_passes(self): - # boundary point is valid - accept_content_type = 'application/json' - - with patch.object(urllib3.PoolManager, 'request') as mock_request: - payload = ( - 1.1 - ) - mock_request.return_value = self.response( - self.json_bytes(payload), - status=self.response_status - ) - api_response = self.api.post( - accept_content_types=(accept_content_type,) - ) - self.assert_pool_manager_request_called_with( - mock_request, - self.api_config.get_server_url('servers', None) + "/responseBody/postMinimumValidationResponseBodyForContentTypes", - method='post'.upper(), - accept_content_type=accept_content_type, - ) - - assert isinstance(api_response.response, urllib3.HTTPResponse) - assert isinstance(api_response.body, self.response_body_schema) - deserialized_response_body = self.response_body_schema.from_openapi_data_( - payload, - configuration_=self.schema_config - ) - assert api_response.body == deserialized_response_body - - def test_below_the_minimum_is_invalid_fails(self): - # below the minimum is invalid - accept_content_type = 'application/json' - - with patch.object(urllib3.PoolManager, 'request') as mock_request: - payload = ( - 0.6 - ) - mock_request.return_value = self.response( - self.json_bytes(payload), - status=self.response_status - ) - with self.assertRaises((unit_test_api.ApiValueError, unit_test_api.ApiTypeError)): - self.api.post( - accept_content_types=(accept_content_type,) - ) - self.assert_pool_manager_request_called_with( - mock_request, - self.api_config.get_server_url('servers', None) + "/responseBody/postMinimumValidationResponseBodyForContentTypes", - method='post'.upper(), - content_type=None, - accept_content_type=accept_content_type, - ) - - def test_above_the_minimum_is_valid_passes(self): - # above the minimum is valid - accept_content_type = 'application/json' - - with patch.object(urllib3.PoolManager, 'request') as mock_request: - payload = ( - 2.6 - ) - mock_request.return_value = self.response( - self.json_bytes(payload), - status=self.response_status - ) - api_response = self.api.post( - accept_content_types=(accept_content_type,) - ) - self.assert_pool_manager_request_called_with( - mock_request, - self.api_config.get_server_url('servers', None) + "/responseBody/postMinimumValidationResponseBodyForContentTypes", - method='post'.upper(), - accept_content_type=accept_content_type, - ) - - assert isinstance(api_response.response, urllib3.HTTPResponse) - assert isinstance(api_response.body, self.response_body_schema) - deserialized_response_body = self.response_body_schema.from_openapi_data_( - payload, - configuration_=self.schema_config - ) - assert api_response.body == deserialized_response_body - - def test_ignores_non_numbers_passes(self): - # ignores non-numbers - accept_content_type = 'application/json' - - with patch.object(urllib3.PoolManager, 'request') as mock_request: - payload = ( - "x" - ) - mock_request.return_value = self.response( - self.json_bytes(payload), - status=self.response_status - ) - api_response = self.api.post( - accept_content_types=(accept_content_type,) - ) - self.assert_pool_manager_request_called_with( - mock_request, - self.api_config.get_server_url('servers', None) + "/responseBody/postMinimumValidationResponseBodyForContentTypes", - method='post'.upper(), - accept_content_type=accept_content_type, - ) - - assert isinstance(api_response.response, urllib3.HTTPResponse) - assert isinstance(api_response.body, self.response_body_schema) - deserialized_response_body = self.response_body_schema.from_openapi_data_( - payload, - configuration_=self.schema_config - ) - assert api_response.body == deserialized_response_body - -if __name__ == '__main__': - unittest.main() diff --git a/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_response_body_post_minimum_validation_with_signed_integer_response_body_for_content_types/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_response_body_post_minimum_validation_with_signed_integer_response_body_for_content_types/__init__.py index 018d13884d0..e69de29bb2d 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_response_body_post_minimum_validation_with_signed_integer_response_body_for_content_types/__init__.py +++ b/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_response_body_post_minimum_validation_with_signed_integer_response_body_for_content_types/__init__.py @@ -1,233 +0,0 @@ -# coding: utf-8 - -""" - - - Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator -""" - -import unittest -from unittest.mock import patch - -import urllib3 - -import unit_test_api -from unit_test_api.paths.response_body_post_minimum_validation_with_signed_integer_response_body_for_content_types.post import operation as post # noqa: E501 -from unit_test_api import schemas, api_client -from unit_test_api.configurations import api_configuration, schema_configuration - -from .. import ApiTestMixin - - -class TestPost(ApiTestMixin, unittest.TestCase): - """ - Post unit test stubs - """ - api_config = api_configuration.ApiConfiguration() - schema_config = schema_configuration.SchemaConfiguration() - used_api_client = api_client.ApiClient(configuration=api_config, schema_config=schema_config) - api = post.ApiForPost(api_client=used_api_client) # noqa: E501 - - response_status = 200 - response_body_schema = post.response_200.ResponseFor200.content["application/json"].schema - - def test_boundary_point_is_valid_passes(self): - # boundary point is valid - accept_content_type = 'application/json' - - with patch.object(urllib3.PoolManager, 'request') as mock_request: - payload = ( - -2 - ) - mock_request.return_value = self.response( - self.json_bytes(payload), - status=self.response_status - ) - api_response = self.api.post( - accept_content_types=(accept_content_type,) - ) - self.assert_pool_manager_request_called_with( - mock_request, - self.api_config.get_server_url('servers', None) + "/responseBody/postMinimumValidationWithSignedIntegerResponseBodyForContentTypes", - method='post'.upper(), - accept_content_type=accept_content_type, - ) - - assert isinstance(api_response.response, urllib3.HTTPResponse) - assert isinstance(api_response.body, self.response_body_schema) - deserialized_response_body = self.response_body_schema.from_openapi_data_( - payload, - configuration_=self.schema_config - ) - assert api_response.body == deserialized_response_body - - def test_positive_above_the_minimum_is_valid_passes(self): - # positive above the minimum is valid - accept_content_type = 'application/json' - - with patch.object(urllib3.PoolManager, 'request') as mock_request: - payload = ( - 0 - ) - mock_request.return_value = self.response( - self.json_bytes(payload), - status=self.response_status - ) - api_response = self.api.post( - accept_content_types=(accept_content_type,) - ) - self.assert_pool_manager_request_called_with( - mock_request, - self.api_config.get_server_url('servers', None) + "/responseBody/postMinimumValidationWithSignedIntegerResponseBodyForContentTypes", - method='post'.upper(), - accept_content_type=accept_content_type, - ) - - assert isinstance(api_response.response, urllib3.HTTPResponse) - assert isinstance(api_response.body, self.response_body_schema) - deserialized_response_body = self.response_body_schema.from_openapi_data_( - payload, - configuration_=self.schema_config - ) - assert api_response.body == deserialized_response_body - - def test_int_below_the_minimum_is_invalid_fails(self): - # int below the minimum is invalid - accept_content_type = 'application/json' - - with patch.object(urllib3.PoolManager, 'request') as mock_request: - payload = ( - -3 - ) - mock_request.return_value = self.response( - self.json_bytes(payload), - status=self.response_status - ) - with self.assertRaises((unit_test_api.ApiValueError, unit_test_api.ApiTypeError)): - self.api.post( - accept_content_types=(accept_content_type,) - ) - self.assert_pool_manager_request_called_with( - mock_request, - self.api_config.get_server_url('servers', None) + "/responseBody/postMinimumValidationWithSignedIntegerResponseBodyForContentTypes", - method='post'.upper(), - content_type=None, - accept_content_type=accept_content_type, - ) - - def test_float_below_the_minimum_is_invalid_fails(self): - # float below the minimum is invalid - accept_content_type = 'application/json' - - with patch.object(urllib3.PoolManager, 'request') as mock_request: - payload = ( - -2.0001 - ) - mock_request.return_value = self.response( - self.json_bytes(payload), - status=self.response_status - ) - with self.assertRaises((unit_test_api.ApiValueError, unit_test_api.ApiTypeError)): - self.api.post( - accept_content_types=(accept_content_type,) - ) - self.assert_pool_manager_request_called_with( - mock_request, - self.api_config.get_server_url('servers', None) + "/responseBody/postMinimumValidationWithSignedIntegerResponseBodyForContentTypes", - method='post'.upper(), - content_type=None, - accept_content_type=accept_content_type, - ) - - def test_boundary_point_with_float_is_valid_passes(self): - # boundary point with float is valid - accept_content_type = 'application/json' - - with patch.object(urllib3.PoolManager, 'request') as mock_request: - payload = ( - -2.0 - ) - mock_request.return_value = self.response( - self.json_bytes(payload), - status=self.response_status - ) - api_response = self.api.post( - accept_content_types=(accept_content_type,) - ) - self.assert_pool_manager_request_called_with( - mock_request, - self.api_config.get_server_url('servers', None) + "/responseBody/postMinimumValidationWithSignedIntegerResponseBodyForContentTypes", - method='post'.upper(), - accept_content_type=accept_content_type, - ) - - assert isinstance(api_response.response, urllib3.HTTPResponse) - assert isinstance(api_response.body, self.response_body_schema) - deserialized_response_body = self.response_body_schema.from_openapi_data_( - payload, - configuration_=self.schema_config - ) - assert api_response.body == deserialized_response_body - - def test_negative_above_the_minimum_is_valid_passes(self): - # negative above the minimum is valid - accept_content_type = 'application/json' - - with patch.object(urllib3.PoolManager, 'request') as mock_request: - payload = ( - -1 - ) - mock_request.return_value = self.response( - self.json_bytes(payload), - status=self.response_status - ) - api_response = self.api.post( - accept_content_types=(accept_content_type,) - ) - self.assert_pool_manager_request_called_with( - mock_request, - self.api_config.get_server_url('servers', None) + "/responseBody/postMinimumValidationWithSignedIntegerResponseBodyForContentTypes", - method='post'.upper(), - accept_content_type=accept_content_type, - ) - - assert isinstance(api_response.response, urllib3.HTTPResponse) - assert isinstance(api_response.body, self.response_body_schema) - deserialized_response_body = self.response_body_schema.from_openapi_data_( - payload, - configuration_=self.schema_config - ) - assert api_response.body == deserialized_response_body - - def test_ignores_non_numbers_passes(self): - # ignores non-numbers - accept_content_type = 'application/json' - - with patch.object(urllib3.PoolManager, 'request') as mock_request: - payload = ( - "x" - ) - mock_request.return_value = self.response( - self.json_bytes(payload), - status=self.response_status - ) - api_response = self.api.post( - accept_content_types=(accept_content_type,) - ) - self.assert_pool_manager_request_called_with( - mock_request, - self.api_config.get_server_url('servers', None) + "/responseBody/postMinimumValidationWithSignedIntegerResponseBodyForContentTypes", - method='post'.upper(), - accept_content_type=accept_content_type, - ) - - assert isinstance(api_response.response, urllib3.HTTPResponse) - assert isinstance(api_response.body, self.response_body_schema) - deserialized_response_body = self.response_body_schema.from_openapi_data_( - payload, - configuration_=self.schema_config - ) - assert api_response.body == deserialized_response_body - -if __name__ == '__main__': - unittest.main() diff --git a/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_response_body_post_minitems_validation_response_body_for_content_types/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_response_body_post_minitems_validation_response_body_for_content_types/__init__.py index 4b1eda14a83..e69de29bb2d 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_response_body_post_minitems_validation_response_body_for_content_types/__init__.py +++ b/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_response_body_post_minitems_validation_response_body_for_content_types/__init__.py @@ -1,155 +0,0 @@ -# coding: utf-8 - -""" - - - Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator -""" - -import unittest -from unittest.mock import patch - -import urllib3 - -import unit_test_api -from unit_test_api.paths.response_body_post_minitems_validation_response_body_for_content_types.post import operation as post # noqa: E501 -from unit_test_api import schemas, api_client -from unit_test_api.configurations import api_configuration, schema_configuration - -from .. import ApiTestMixin - - -class TestPost(ApiTestMixin, unittest.TestCase): - """ - Post unit test stubs - """ - api_config = api_configuration.ApiConfiguration() - schema_config = schema_configuration.SchemaConfiguration() - used_api_client = api_client.ApiClient(configuration=api_config, schema_config=schema_config) - api = post.ApiForPost(api_client=used_api_client) # noqa: E501 - - response_status = 200 - response_body_schema = post.response_200.ResponseFor200.content["application/json"].schema - - def test_too_short_is_invalid_fails(self): - # too short is invalid - accept_content_type = 'application/json' - - with patch.object(urllib3.PoolManager, 'request') as mock_request: - payload = ( - [ - ] - ) - mock_request.return_value = self.response( - self.json_bytes(payload), - status=self.response_status - ) - with self.assertRaises((unit_test_api.ApiValueError, unit_test_api.ApiTypeError)): - self.api.post( - accept_content_types=(accept_content_type,) - ) - self.assert_pool_manager_request_called_with( - mock_request, - self.api_config.get_server_url('servers', None) + "/responseBody/postMinitemsValidationResponseBodyForContentTypes", - method='post'.upper(), - content_type=None, - accept_content_type=accept_content_type, - ) - - def test_ignores_non_arrays_passes(self): - # ignores non-arrays - accept_content_type = 'application/json' - - with patch.object(urllib3.PoolManager, 'request') as mock_request: - payload = ( - "" - ) - mock_request.return_value = self.response( - self.json_bytes(payload), - status=self.response_status - ) - api_response = self.api.post( - accept_content_types=(accept_content_type,) - ) - self.assert_pool_manager_request_called_with( - mock_request, - self.api_config.get_server_url('servers', None) + "/responseBody/postMinitemsValidationResponseBodyForContentTypes", - method='post'.upper(), - accept_content_type=accept_content_type, - ) - - assert isinstance(api_response.response, urllib3.HTTPResponse) - assert isinstance(api_response.body, self.response_body_schema) - deserialized_response_body = self.response_body_schema.from_openapi_data_( - payload, - configuration_=self.schema_config - ) - assert api_response.body == deserialized_response_body - - def test_longer_is_valid_passes(self): - # longer is valid - accept_content_type = 'application/json' - - with patch.object(urllib3.PoolManager, 'request') as mock_request: - payload = ( - [ - 1, - 2, - ] - ) - mock_request.return_value = self.response( - self.json_bytes(payload), - status=self.response_status - ) - api_response = self.api.post( - accept_content_types=(accept_content_type,) - ) - self.assert_pool_manager_request_called_with( - mock_request, - self.api_config.get_server_url('servers', None) + "/responseBody/postMinitemsValidationResponseBodyForContentTypes", - method='post'.upper(), - accept_content_type=accept_content_type, - ) - - assert isinstance(api_response.response, urllib3.HTTPResponse) - assert isinstance(api_response.body, self.response_body_schema) - deserialized_response_body = self.response_body_schema.from_openapi_data_( - payload, - configuration_=self.schema_config - ) - assert api_response.body == deserialized_response_body - - def test_exact_length_is_valid_passes(self): - # exact length is valid - accept_content_type = 'application/json' - - with patch.object(urllib3.PoolManager, 'request') as mock_request: - payload = ( - [ - 1, - ] - ) - mock_request.return_value = self.response( - self.json_bytes(payload), - status=self.response_status - ) - api_response = self.api.post( - accept_content_types=(accept_content_type,) - ) - self.assert_pool_manager_request_called_with( - mock_request, - self.api_config.get_server_url('servers', None) + "/responseBody/postMinitemsValidationResponseBodyForContentTypes", - method='post'.upper(), - accept_content_type=accept_content_type, - ) - - assert isinstance(api_response.response, urllib3.HTTPResponse) - assert isinstance(api_response.body, self.response_body_schema) - deserialized_response_body = self.response_body_schema.from_openapi_data_( - payload, - configuration_=self.schema_config - ) - assert api_response.body == deserialized_response_body - -if __name__ == '__main__': - unittest.main() diff --git a/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_response_body_post_minlength_validation_response_body_for_content_types/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_response_body_post_minlength_validation_response_body_for_content_types/__init__.py index 09d4967f9dc..e69de29bb2d 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_response_body_post_minlength_validation_response_body_for_content_types/__init__.py +++ b/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_response_body_post_minlength_validation_response_body_for_content_types/__init__.py @@ -1,173 +0,0 @@ -# coding: utf-8 - -""" - - - Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator -""" - -import unittest -from unittest.mock import patch - -import urllib3 - -import unit_test_api -from unit_test_api.paths.response_body_post_minlength_validation_response_body_for_content_types.post import operation as post # noqa: E501 -from unit_test_api import schemas, api_client -from unit_test_api.configurations import api_configuration, schema_configuration - -from .. import ApiTestMixin - - -class TestPost(ApiTestMixin, unittest.TestCase): - """ - Post unit test stubs - """ - api_config = api_configuration.ApiConfiguration() - schema_config = schema_configuration.SchemaConfiguration() - used_api_client = api_client.ApiClient(configuration=api_config, schema_config=schema_config) - api = post.ApiForPost(api_client=used_api_client) # noqa: E501 - - response_status = 200 - response_body_schema = post.response_200.ResponseFor200.content["application/json"].schema - - def test_too_short_is_invalid_fails(self): - # too short is invalid - accept_content_type = 'application/json' - - with patch.object(urllib3.PoolManager, 'request') as mock_request: - payload = ( - "f" - ) - mock_request.return_value = self.response( - self.json_bytes(payload), - status=self.response_status - ) - with self.assertRaises((unit_test_api.ApiValueError, unit_test_api.ApiTypeError)): - self.api.post( - accept_content_types=(accept_content_type,) - ) - self.assert_pool_manager_request_called_with( - mock_request, - self.api_config.get_server_url('servers', None) + "/responseBody/postMinlengthValidationResponseBodyForContentTypes", - method='post'.upper(), - content_type=None, - accept_content_type=accept_content_type, - ) - - def test_one_supplementary_unicode_code_point_is_not_long_enough_fails(self): - # one supplementary Unicode code point is not long enough - accept_content_type = 'application/json' - - with patch.object(urllib3.PoolManager, 'request') as mock_request: - payload = ( - "💩" - ) - mock_request.return_value = self.response( - self.json_bytes(payload), - status=self.response_status - ) - with self.assertRaises((unit_test_api.ApiValueError, unit_test_api.ApiTypeError)): - self.api.post( - accept_content_types=(accept_content_type,) - ) - self.assert_pool_manager_request_called_with( - mock_request, - self.api_config.get_server_url('servers', None) + "/responseBody/postMinlengthValidationResponseBodyForContentTypes", - method='post'.upper(), - content_type=None, - accept_content_type=accept_content_type, - ) - - def test_longer_is_valid_passes(self): - # longer is valid - accept_content_type = 'application/json' - - with patch.object(urllib3.PoolManager, 'request') as mock_request: - payload = ( - "foo" - ) - mock_request.return_value = self.response( - self.json_bytes(payload), - status=self.response_status - ) - api_response = self.api.post( - accept_content_types=(accept_content_type,) - ) - self.assert_pool_manager_request_called_with( - mock_request, - self.api_config.get_server_url('servers', None) + "/responseBody/postMinlengthValidationResponseBodyForContentTypes", - method='post'.upper(), - accept_content_type=accept_content_type, - ) - - assert isinstance(api_response.response, urllib3.HTTPResponse) - assert isinstance(api_response.body, self.response_body_schema) - deserialized_response_body = self.response_body_schema.from_openapi_data_( - payload, - configuration_=self.schema_config - ) - assert api_response.body == deserialized_response_body - - def test_ignores_non_strings_passes(self): - # ignores non-strings - accept_content_type = 'application/json' - - with patch.object(urllib3.PoolManager, 'request') as mock_request: - payload = ( - 1 - ) - mock_request.return_value = self.response( - self.json_bytes(payload), - status=self.response_status - ) - api_response = self.api.post( - accept_content_types=(accept_content_type,) - ) - self.assert_pool_manager_request_called_with( - mock_request, - self.api_config.get_server_url('servers', None) + "/responseBody/postMinlengthValidationResponseBodyForContentTypes", - method='post'.upper(), - accept_content_type=accept_content_type, - ) - - assert isinstance(api_response.response, urllib3.HTTPResponse) - assert isinstance(api_response.body, self.response_body_schema) - deserialized_response_body = self.response_body_schema.from_openapi_data_( - payload, - configuration_=self.schema_config - ) - assert api_response.body == deserialized_response_body - - def test_exact_length_is_valid_passes(self): - # exact length is valid - accept_content_type = 'application/json' - - with patch.object(urllib3.PoolManager, 'request') as mock_request: - payload = ( - "fo" - ) - mock_request.return_value = self.response( - self.json_bytes(payload), - status=self.response_status - ) - api_response = self.api.post( - accept_content_types=(accept_content_type,) - ) - self.assert_pool_manager_request_called_with( - mock_request, - self.api_config.get_server_url('servers', None) + "/responseBody/postMinlengthValidationResponseBodyForContentTypes", - method='post'.upper(), - accept_content_type=accept_content_type, - ) - - assert isinstance(api_response.response, urllib3.HTTPResponse) - assert isinstance(api_response.body, self.response_body_schema) - deserialized_response_body = self.response_body_schema.from_openapi_data_( - payload, - configuration_=self.schema_config - ) - assert api_response.body == deserialized_response_body - -if __name__ == '__main__': - unittest.main() diff --git a/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_response_body_post_minproperties_validation_response_body_for_content_types/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_response_body_post_minproperties_validation_response_body_for_content_types/__init__.py index e8d85ae17e3..e69de29bb2d 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_response_body_post_minproperties_validation_response_body_for_content_types/__init__.py +++ b/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_response_body_post_minproperties_validation_response_body_for_content_types/__init__.py @@ -1,219 +0,0 @@ -# coding: utf-8 - -""" - - - Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator -""" - -import unittest -from unittest.mock import patch - -import urllib3 - -import unit_test_api -from unit_test_api.paths.response_body_post_minproperties_validation_response_body_for_content_types.post import operation as post # noqa: E501 -from unit_test_api import schemas, api_client -from unit_test_api.configurations import api_configuration, schema_configuration - -from .. import ApiTestMixin - - -class TestPost(ApiTestMixin, unittest.TestCase): - """ - Post unit test stubs - """ - api_config = api_configuration.ApiConfiguration() - schema_config = schema_configuration.SchemaConfiguration() - used_api_client = api_client.ApiClient(configuration=api_config, schema_config=schema_config) - api = post.ApiForPost(api_client=used_api_client) # noqa: E501 - - response_status = 200 - response_body_schema = post.response_200.ResponseFor200.content["application/json"].schema - - def test_ignores_arrays_passes(self): - # ignores arrays - accept_content_type = 'application/json' - - with patch.object(urllib3.PoolManager, 'request') as mock_request: - payload = ( - [ - ] - ) - mock_request.return_value = self.response( - self.json_bytes(payload), - status=self.response_status - ) - api_response = self.api.post( - accept_content_types=(accept_content_type,) - ) - self.assert_pool_manager_request_called_with( - mock_request, - self.api_config.get_server_url('servers', None) + "/responseBody/postMinpropertiesValidationResponseBodyForContentTypes", - method='post'.upper(), - accept_content_type=accept_content_type, - ) - - assert isinstance(api_response.response, urllib3.HTTPResponse) - assert isinstance(api_response.body, self.response_body_schema) - deserialized_response_body = self.response_body_schema.from_openapi_data_( - payload, - configuration_=self.schema_config - ) - assert api_response.body == deserialized_response_body - - def test_ignores_other_non_objects_passes(self): - # ignores other non-objects - accept_content_type = 'application/json' - - with patch.object(urllib3.PoolManager, 'request') as mock_request: - payload = ( - 12 - ) - mock_request.return_value = self.response( - self.json_bytes(payload), - status=self.response_status - ) - api_response = self.api.post( - accept_content_types=(accept_content_type,) - ) - self.assert_pool_manager_request_called_with( - mock_request, - self.api_config.get_server_url('servers', None) + "/responseBody/postMinpropertiesValidationResponseBodyForContentTypes", - method='post'.upper(), - accept_content_type=accept_content_type, - ) - - assert isinstance(api_response.response, urllib3.HTTPResponse) - assert isinstance(api_response.body, self.response_body_schema) - deserialized_response_body = self.response_body_schema.from_openapi_data_( - payload, - configuration_=self.schema_config - ) - assert api_response.body == deserialized_response_body - - def test_too_short_is_invalid_fails(self): - # too short is invalid - accept_content_type = 'application/json' - - with patch.object(urllib3.PoolManager, 'request') as mock_request: - payload = ( - { - } - ) - mock_request.return_value = self.response( - self.json_bytes(payload), - status=self.response_status - ) - with self.assertRaises((unit_test_api.ApiValueError, unit_test_api.ApiTypeError)): - self.api.post( - accept_content_types=(accept_content_type,) - ) - self.assert_pool_manager_request_called_with( - mock_request, - self.api_config.get_server_url('servers', None) + "/responseBody/postMinpropertiesValidationResponseBodyForContentTypes", - method='post'.upper(), - content_type=None, - accept_content_type=accept_content_type, - ) - - def test_ignores_strings_passes(self): - # ignores strings - accept_content_type = 'application/json' - - with patch.object(urllib3.PoolManager, 'request') as mock_request: - payload = ( - "" - ) - mock_request.return_value = self.response( - self.json_bytes(payload), - status=self.response_status - ) - api_response = self.api.post( - accept_content_types=(accept_content_type,) - ) - self.assert_pool_manager_request_called_with( - mock_request, - self.api_config.get_server_url('servers', None) + "/responseBody/postMinpropertiesValidationResponseBodyForContentTypes", - method='post'.upper(), - accept_content_type=accept_content_type, - ) - - assert isinstance(api_response.response, urllib3.HTTPResponse) - assert isinstance(api_response.body, self.response_body_schema) - deserialized_response_body = self.response_body_schema.from_openapi_data_( - payload, - configuration_=self.schema_config - ) - assert api_response.body == deserialized_response_body - - def test_longer_is_valid_passes(self): - # longer is valid - accept_content_type = 'application/json' - - with patch.object(urllib3.PoolManager, 'request') as mock_request: - payload = ( - { - "foo": - 1, - "bar": - 2, - } - ) - mock_request.return_value = self.response( - self.json_bytes(payload), - status=self.response_status - ) - api_response = self.api.post( - accept_content_types=(accept_content_type,) - ) - self.assert_pool_manager_request_called_with( - mock_request, - self.api_config.get_server_url('servers', None) + "/responseBody/postMinpropertiesValidationResponseBodyForContentTypes", - method='post'.upper(), - accept_content_type=accept_content_type, - ) - - assert isinstance(api_response.response, urllib3.HTTPResponse) - assert isinstance(api_response.body, self.response_body_schema) - deserialized_response_body = self.response_body_schema.from_openapi_data_( - payload, - configuration_=self.schema_config - ) - assert api_response.body == deserialized_response_body - - def test_exact_length_is_valid_passes(self): - # exact length is valid - accept_content_type = 'application/json' - - with patch.object(urllib3.PoolManager, 'request') as mock_request: - payload = ( - { - "foo": - 1, - } - ) - mock_request.return_value = self.response( - self.json_bytes(payload), - status=self.response_status - ) - api_response = self.api.post( - accept_content_types=(accept_content_type,) - ) - self.assert_pool_manager_request_called_with( - mock_request, - self.api_config.get_server_url('servers', None) + "/responseBody/postMinpropertiesValidationResponseBodyForContentTypes", - method='post'.upper(), - accept_content_type=accept_content_type, - ) - - assert isinstance(api_response.response, urllib3.HTTPResponse) - assert isinstance(api_response.body, self.response_body_schema) - deserialized_response_body = self.response_body_schema.from_openapi_data_( - payload, - configuration_=self.schema_config - ) - assert api_response.body == deserialized_response_body - -if __name__ == '__main__': - unittest.main() diff --git a/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_response_body_post_nested_allof_to_check_validation_semantics_response_body_for_content_types/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_response_body_post_nested_allof_to_check_validation_semantics_response_body_for_content_types/__init__.py index 254e04bcebb..e69de29bb2d 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_response_body_post_nested_allof_to_check_validation_semantics_response_body_for_content_types/__init__.py +++ b/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_response_body_post_nested_allof_to_check_validation_semantics_response_body_for_content_types/__init__.py @@ -1,89 +0,0 @@ -# coding: utf-8 - -""" - - - Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator -""" - -import unittest -from unittest.mock import patch - -import urllib3 - -import unit_test_api -from unit_test_api.paths.response_body_post_nested_allof_to_check_validation_semantics_response_body_for_content_types.post import operation as post # noqa: E501 -from unit_test_api import schemas, api_client -from unit_test_api.configurations import api_configuration, schema_configuration - -from .. import ApiTestMixin - - -class TestPost(ApiTestMixin, unittest.TestCase): - """ - Post unit test stubs - """ - api_config = api_configuration.ApiConfiguration() - schema_config = schema_configuration.SchemaConfiguration() - used_api_client = api_client.ApiClient(configuration=api_config, schema_config=schema_config) - api = post.ApiForPost(api_client=used_api_client) # noqa: E501 - - response_status = 200 - response_body_schema = post.response_200.ResponseFor200.content["application/json"].schema - - def test_anything_non_null_is_invalid_fails(self): - # anything non-null is invalid - accept_content_type = 'application/json' - - with patch.object(urllib3.PoolManager, 'request') as mock_request: - payload = ( - 123 - ) - mock_request.return_value = self.response( - self.json_bytes(payload), - status=self.response_status - ) - with self.assertRaises((unit_test_api.ApiValueError, unit_test_api.ApiTypeError)): - self.api.post( - accept_content_types=(accept_content_type,) - ) - self.assert_pool_manager_request_called_with( - mock_request, - self.api_config.get_server_url('servers', None) + "/responseBody/postNestedAllofToCheckValidationSemanticsResponseBodyForContentTypes", - method='post'.upper(), - content_type=None, - accept_content_type=accept_content_type, - ) - - def test_null_is_valid_passes(self): - # null is valid - accept_content_type = 'application/json' - - with patch.object(urllib3.PoolManager, 'request') as mock_request: - payload = ( - None - ) - mock_request.return_value = self.response( - self.json_bytes(payload), - status=self.response_status - ) - api_response = self.api.post( - accept_content_types=(accept_content_type,) - ) - self.assert_pool_manager_request_called_with( - mock_request, - self.api_config.get_server_url('servers', None) + "/responseBody/postNestedAllofToCheckValidationSemanticsResponseBodyForContentTypes", - method='post'.upper(), - accept_content_type=accept_content_type, - ) - - assert isinstance(api_response.response, urllib3.HTTPResponse) - assert isinstance(api_response.body, self.response_body_schema) - deserialized_response_body = self.response_body_schema.from_openapi_data_( - payload, - configuration_=self.schema_config - ) - assert api_response.body == deserialized_response_body - -if __name__ == '__main__': - unittest.main() diff --git a/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_response_body_post_nested_anyof_to_check_validation_semantics_response_body_for_content_types/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_response_body_post_nested_anyof_to_check_validation_semantics_response_body_for_content_types/__init__.py index 137ad32413a..e69de29bb2d 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_response_body_post_nested_anyof_to_check_validation_semantics_response_body_for_content_types/__init__.py +++ b/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_response_body_post_nested_anyof_to_check_validation_semantics_response_body_for_content_types/__init__.py @@ -1,89 +0,0 @@ -# coding: utf-8 - -""" - - - Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator -""" - -import unittest -from unittest.mock import patch - -import urllib3 - -import unit_test_api -from unit_test_api.paths.response_body_post_nested_anyof_to_check_validation_semantics_response_body_for_content_types.post import operation as post # noqa: E501 -from unit_test_api import schemas, api_client -from unit_test_api.configurations import api_configuration, schema_configuration - -from .. import ApiTestMixin - - -class TestPost(ApiTestMixin, unittest.TestCase): - """ - Post unit test stubs - """ - api_config = api_configuration.ApiConfiguration() - schema_config = schema_configuration.SchemaConfiguration() - used_api_client = api_client.ApiClient(configuration=api_config, schema_config=schema_config) - api = post.ApiForPost(api_client=used_api_client) # noqa: E501 - - response_status = 200 - response_body_schema = post.response_200.ResponseFor200.content["application/json"].schema - - def test_anything_non_null_is_invalid_fails(self): - # anything non-null is invalid - accept_content_type = 'application/json' - - with patch.object(urllib3.PoolManager, 'request') as mock_request: - payload = ( - 123 - ) - mock_request.return_value = self.response( - self.json_bytes(payload), - status=self.response_status - ) - with self.assertRaises((unit_test_api.ApiValueError, unit_test_api.ApiTypeError)): - self.api.post( - accept_content_types=(accept_content_type,) - ) - self.assert_pool_manager_request_called_with( - mock_request, - self.api_config.get_server_url('servers', None) + "/responseBody/postNestedAnyofToCheckValidationSemanticsResponseBodyForContentTypes", - method='post'.upper(), - content_type=None, - accept_content_type=accept_content_type, - ) - - def test_null_is_valid_passes(self): - # null is valid - accept_content_type = 'application/json' - - with patch.object(urllib3.PoolManager, 'request') as mock_request: - payload = ( - None - ) - mock_request.return_value = self.response( - self.json_bytes(payload), - status=self.response_status - ) - api_response = self.api.post( - accept_content_types=(accept_content_type,) - ) - self.assert_pool_manager_request_called_with( - mock_request, - self.api_config.get_server_url('servers', None) + "/responseBody/postNestedAnyofToCheckValidationSemanticsResponseBodyForContentTypes", - method='post'.upper(), - accept_content_type=accept_content_type, - ) - - assert isinstance(api_response.response, urllib3.HTTPResponse) - assert isinstance(api_response.body, self.response_body_schema) - deserialized_response_body = self.response_body_schema.from_openapi_data_( - payload, - configuration_=self.schema_config - ) - assert api_response.body == deserialized_response_body - -if __name__ == '__main__': - unittest.main() diff --git a/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_response_body_post_nested_items_response_body_for_content_types/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_response_body_post_nested_items_response_body_for_content_types/__init__.py index b8f7782ee69..e69de29bb2d 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_response_body_post_nested_items_response_body_for_content_types/__init__.py +++ b/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_response_body_post_nested_items_response_body_for_content_types/__init__.py @@ -1,194 +0,0 @@ -# coding: utf-8 - -""" - - - Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator -""" - -import unittest -from unittest.mock import patch - -import urllib3 - -import unit_test_api -from unit_test_api.paths.response_body_post_nested_items_response_body_for_content_types.post import operation as post # noqa: E501 -from unit_test_api import schemas, api_client -from unit_test_api.configurations import api_configuration, schema_configuration - -from .. import ApiTestMixin - - -class TestPost(ApiTestMixin, unittest.TestCase): - """ - Post unit test stubs - """ - api_config = api_configuration.ApiConfiguration() - schema_config = schema_configuration.SchemaConfiguration() - used_api_client = api_client.ApiClient(configuration=api_config, schema_config=schema_config) - api = post.ApiForPost(api_client=used_api_client) # noqa: E501 - - response_status = 200 - response_body_schema = post.response_200.ResponseFor200.content["application/json"].schema - - def test_valid_nested_array_passes(self): - # valid nested array - accept_content_type = 'application/json' - - with patch.object(urllib3.PoolManager, 'request') as mock_request: - payload = ( - [ - [ - [ - [ - 1, - ], - ], - [ - [ - 2, - ], - [ - 3, - ], - ], - ], - [ - [ - [ - 4, - ], - [ - 5, - ], - [ - 6, - ], - ], - ], - ] - ) - mock_request.return_value = self.response( - self.json_bytes(payload), - status=self.response_status - ) - api_response = self.api.post( - accept_content_types=(accept_content_type,) - ) - self.assert_pool_manager_request_called_with( - mock_request, - self.api_config.get_server_url('servers', None) + "/responseBody/postNestedItemsResponseBodyForContentTypes", - method='post'.upper(), - accept_content_type=accept_content_type, - ) - - assert isinstance(api_response.response, urllib3.HTTPResponse) - assert isinstance(api_response.body, self.response_body_schema) - deserialized_response_body = self.response_body_schema.from_openapi_data_( - payload, - configuration_=self.schema_config - ) - assert api_response.body == deserialized_response_body - - def test_nested_array_with_invalid_type_fails(self): - # nested array with invalid type - accept_content_type = 'application/json' - - with patch.object(urllib3.PoolManager, 'request') as mock_request: - payload = ( - [ - [ - [ - [ - "1", - ], - ], - [ - [ - 2, - ], - [ - 3, - ], - ], - ], - [ - [ - [ - 4, - ], - [ - 5, - ], - [ - 6, - ], - ], - ], - ] - ) - mock_request.return_value = self.response( - self.json_bytes(payload), - status=self.response_status - ) - with self.assertRaises((unit_test_api.ApiValueError, unit_test_api.ApiTypeError)): - self.api.post( - accept_content_types=(accept_content_type,) - ) - self.assert_pool_manager_request_called_with( - mock_request, - self.api_config.get_server_url('servers', None) + "/responseBody/postNestedItemsResponseBodyForContentTypes", - method='post'.upper(), - content_type=None, - accept_content_type=accept_content_type, - ) - - def test_not_deep_enough_fails(self): - # not deep enough - accept_content_type = 'application/json' - - with patch.object(urllib3.PoolManager, 'request') as mock_request: - payload = ( - [ - [ - [ - 1, - ], - [ - 2, - ], - [ - 3, - ], - ], - [ - [ - 4, - ], - [ - 5, - ], - [ - 6, - ], - ], - ] - ) - mock_request.return_value = self.response( - self.json_bytes(payload), - status=self.response_status - ) - with self.assertRaises((unit_test_api.ApiValueError, unit_test_api.ApiTypeError)): - self.api.post( - accept_content_types=(accept_content_type,) - ) - self.assert_pool_manager_request_called_with( - mock_request, - self.api_config.get_server_url('servers', None) + "/responseBody/postNestedItemsResponseBodyForContentTypes", - method='post'.upper(), - content_type=None, - accept_content_type=accept_content_type, - ) - -if __name__ == '__main__': - unittest.main() diff --git a/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_response_body_post_nested_oneof_to_check_validation_semantics_response_body_for_content_types/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_response_body_post_nested_oneof_to_check_validation_semantics_response_body_for_content_types/__init__.py index cd2bb19a0af..e69de29bb2d 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_response_body_post_nested_oneof_to_check_validation_semantics_response_body_for_content_types/__init__.py +++ b/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_response_body_post_nested_oneof_to_check_validation_semantics_response_body_for_content_types/__init__.py @@ -1,89 +0,0 @@ -# coding: utf-8 - -""" - - - Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator -""" - -import unittest -from unittest.mock import patch - -import urllib3 - -import unit_test_api -from unit_test_api.paths.response_body_post_nested_oneof_to_check_validation_semantics_response_body_for_content_types.post import operation as post # noqa: E501 -from unit_test_api import schemas, api_client -from unit_test_api.configurations import api_configuration, schema_configuration - -from .. import ApiTestMixin - - -class TestPost(ApiTestMixin, unittest.TestCase): - """ - Post unit test stubs - """ - api_config = api_configuration.ApiConfiguration() - schema_config = schema_configuration.SchemaConfiguration() - used_api_client = api_client.ApiClient(configuration=api_config, schema_config=schema_config) - api = post.ApiForPost(api_client=used_api_client) # noqa: E501 - - response_status = 200 - response_body_schema = post.response_200.ResponseFor200.content["application/json"].schema - - def test_anything_non_null_is_invalid_fails(self): - # anything non-null is invalid - accept_content_type = 'application/json' - - with patch.object(urllib3.PoolManager, 'request') as mock_request: - payload = ( - 123 - ) - mock_request.return_value = self.response( - self.json_bytes(payload), - status=self.response_status - ) - with self.assertRaises((unit_test_api.ApiValueError, unit_test_api.ApiTypeError)): - self.api.post( - accept_content_types=(accept_content_type,) - ) - self.assert_pool_manager_request_called_with( - mock_request, - self.api_config.get_server_url('servers', None) + "/responseBody/postNestedOneofToCheckValidationSemanticsResponseBodyForContentTypes", - method='post'.upper(), - content_type=None, - accept_content_type=accept_content_type, - ) - - def test_null_is_valid_passes(self): - # null is valid - accept_content_type = 'application/json' - - with patch.object(urllib3.PoolManager, 'request') as mock_request: - payload = ( - None - ) - mock_request.return_value = self.response( - self.json_bytes(payload), - status=self.response_status - ) - api_response = self.api.post( - accept_content_types=(accept_content_type,) - ) - self.assert_pool_manager_request_called_with( - mock_request, - self.api_config.get_server_url('servers', None) + "/responseBody/postNestedOneofToCheckValidationSemanticsResponseBodyForContentTypes", - method='post'.upper(), - accept_content_type=accept_content_type, - ) - - assert isinstance(api_response.response, urllib3.HTTPResponse) - assert isinstance(api_response.body, self.response_body_schema) - deserialized_response_body = self.response_body_schema.from_openapi_data_( - payload, - configuration_=self.schema_config - ) - assert api_response.body == deserialized_response_body - -if __name__ == '__main__': - unittest.main() diff --git a/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_response_body_post_not_more_complex_schema_response_body_for_content_types/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_response_body_post_not_more_complex_schema_response_body_for_content_types/__init__.py index 6c69448f3d6..e69de29bb2d 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_response_body_post_not_more_complex_schema_response_body_for_content_types/__init__.py +++ b/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_response_body_post_not_more_complex_schema_response_body_for_content_types/__init__.py @@ -1,125 +0,0 @@ -# coding: utf-8 - -""" - - - Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator -""" - -import unittest -from unittest.mock import patch - -import urllib3 - -import unit_test_api -from unit_test_api.paths.response_body_post_not_more_complex_schema_response_body_for_content_types.post import operation as post # noqa: E501 -from unit_test_api import schemas, api_client -from unit_test_api.configurations import api_configuration, schema_configuration - -from .. import ApiTestMixin - - -class TestPost(ApiTestMixin, unittest.TestCase): - """ - Post unit test stubs - """ - api_config = api_configuration.ApiConfiguration() - schema_config = schema_configuration.SchemaConfiguration() - used_api_client = api_client.ApiClient(configuration=api_config, schema_config=schema_config) - api = post.ApiForPost(api_client=used_api_client) # noqa: E501 - - response_status = 200 - response_body_schema = post.response_200.ResponseFor200.content["application/json"].schema - - def test_other_match_passes(self): - # other match - accept_content_type = 'application/json' - - with patch.object(urllib3.PoolManager, 'request') as mock_request: - payload = ( - { - "foo": - 1, - } - ) - mock_request.return_value = self.response( - self.json_bytes(payload), - status=self.response_status - ) - api_response = self.api.post( - accept_content_types=(accept_content_type,) - ) - self.assert_pool_manager_request_called_with( - mock_request, - self.api_config.get_server_url('servers', None) + "/responseBody/postNotMoreComplexSchemaResponseBodyForContentTypes", - method='post'.upper(), - accept_content_type=accept_content_type, - ) - - assert isinstance(api_response.response, urllib3.HTTPResponse) - assert isinstance(api_response.body, self.response_body_schema) - deserialized_response_body = self.response_body_schema.from_openapi_data_( - payload, - configuration_=self.schema_config - ) - assert api_response.body == deserialized_response_body - - def test_mismatch_fails(self): - # mismatch - accept_content_type = 'application/json' - - with patch.object(urllib3.PoolManager, 'request') as mock_request: - payload = ( - { - "foo": - "bar", - } - ) - mock_request.return_value = self.response( - self.json_bytes(payload), - status=self.response_status - ) - with self.assertRaises((unit_test_api.ApiValueError, unit_test_api.ApiTypeError)): - self.api.post( - accept_content_types=(accept_content_type,) - ) - self.assert_pool_manager_request_called_with( - mock_request, - self.api_config.get_server_url('servers', None) + "/responseBody/postNotMoreComplexSchemaResponseBodyForContentTypes", - method='post'.upper(), - content_type=None, - accept_content_type=accept_content_type, - ) - - def test_match_passes(self): - # match - accept_content_type = 'application/json' - - with patch.object(urllib3.PoolManager, 'request') as mock_request: - payload = ( - 1 - ) - mock_request.return_value = self.response( - self.json_bytes(payload), - status=self.response_status - ) - api_response = self.api.post( - accept_content_types=(accept_content_type,) - ) - self.assert_pool_manager_request_called_with( - mock_request, - self.api_config.get_server_url('servers', None) + "/responseBody/postNotMoreComplexSchemaResponseBodyForContentTypes", - method='post'.upper(), - accept_content_type=accept_content_type, - ) - - assert isinstance(api_response.response, urllib3.HTTPResponse) - assert isinstance(api_response.body, self.response_body_schema) - deserialized_response_body = self.response_body_schema.from_openapi_data_( - payload, - configuration_=self.schema_config - ) - assert api_response.body == deserialized_response_body - -if __name__ == '__main__': - unittest.main() diff --git a/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_response_body_post_not_response_body_for_content_types/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_response_body_post_not_response_body_for_content_types/__init__.py index d0a80c40d36..e69de29bb2d 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_response_body_post_not_response_body_for_content_types/__init__.py +++ b/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_response_body_post_not_response_body_for_content_types/__init__.py @@ -1,89 +0,0 @@ -# coding: utf-8 - -""" - - - Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator -""" - -import unittest -from unittest.mock import patch - -import urllib3 - -import unit_test_api -from unit_test_api.paths.response_body_post_not_response_body_for_content_types.post import operation as post # noqa: E501 -from unit_test_api import schemas, api_client -from unit_test_api.configurations import api_configuration, schema_configuration - -from .. import ApiTestMixin - - -class TestPost(ApiTestMixin, unittest.TestCase): - """ - Post unit test stubs - """ - api_config = api_configuration.ApiConfiguration() - schema_config = schema_configuration.SchemaConfiguration() - used_api_client = api_client.ApiClient(configuration=api_config, schema_config=schema_config) - api = post.ApiForPost(api_client=used_api_client) # noqa: E501 - - response_status = 200 - response_body_schema = post.response_200.ResponseFor200.content["application/json"].schema - - def test_allowed_passes(self): - # allowed - accept_content_type = 'application/json' - - with patch.object(urllib3.PoolManager, 'request') as mock_request: - payload = ( - "foo" - ) - mock_request.return_value = self.response( - self.json_bytes(payload), - status=self.response_status - ) - api_response = self.api.post( - accept_content_types=(accept_content_type,) - ) - self.assert_pool_manager_request_called_with( - mock_request, - self.api_config.get_server_url('servers', None) + "/responseBody/postNotResponseBodyForContentTypes", - method='post'.upper(), - accept_content_type=accept_content_type, - ) - - assert isinstance(api_response.response, urllib3.HTTPResponse) - assert isinstance(api_response.body, self.response_body_schema) - deserialized_response_body = self.response_body_schema.from_openapi_data_( - payload, - configuration_=self.schema_config - ) - assert api_response.body == deserialized_response_body - - def test_disallowed_fails(self): - # disallowed - accept_content_type = 'application/json' - - with patch.object(urllib3.PoolManager, 'request') as mock_request: - payload = ( - 1 - ) - mock_request.return_value = self.response( - self.json_bytes(payload), - status=self.response_status - ) - with self.assertRaises((unit_test_api.ApiValueError, unit_test_api.ApiTypeError)): - self.api.post( - accept_content_types=(accept_content_type,) - ) - self.assert_pool_manager_request_called_with( - mock_request, - self.api_config.get_server_url('servers', None) + "/responseBody/postNotResponseBodyForContentTypes", - method='post'.upper(), - content_type=None, - accept_content_type=accept_content_type, - ) - -if __name__ == '__main__': - unittest.main() diff --git a/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_response_body_post_nul_characters_in_strings_response_body_for_content_types/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_response_body_post_nul_characters_in_strings_response_body_for_content_types/__init__.py index d87bf06c4ac..e69de29bb2d 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_response_body_post_nul_characters_in_strings_response_body_for_content_types/__init__.py +++ b/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_response_body_post_nul_characters_in_strings_response_body_for_content_types/__init__.py @@ -1,89 +0,0 @@ -# coding: utf-8 - -""" - - - Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator -""" - -import unittest -from unittest.mock import patch - -import urllib3 - -import unit_test_api -from unit_test_api.paths.response_body_post_nul_characters_in_strings_response_body_for_content_types.post import operation as post # noqa: E501 -from unit_test_api import schemas, api_client -from unit_test_api.configurations import api_configuration, schema_configuration - -from .. import ApiTestMixin - - -class TestPost(ApiTestMixin, unittest.TestCase): - """ - Post unit test stubs - """ - api_config = api_configuration.ApiConfiguration() - schema_config = schema_configuration.SchemaConfiguration() - used_api_client = api_client.ApiClient(configuration=api_config, schema_config=schema_config) - api = post.ApiForPost(api_client=used_api_client) # noqa: E501 - - response_status = 200 - response_body_schema = post.response_200.ResponseFor200.content["application/json"].schema - - def test_match_string_with_nul_passes(self): - # match string with nul - accept_content_type = 'application/json' - - with patch.object(urllib3.PoolManager, 'request') as mock_request: - payload = ( - "hello\x00there" - ) - mock_request.return_value = self.response( - self.json_bytes(payload), - status=self.response_status - ) - api_response = self.api.post( - accept_content_types=(accept_content_type,) - ) - self.assert_pool_manager_request_called_with( - mock_request, - self.api_config.get_server_url('servers', None) + "/responseBody/postNulCharactersInStringsResponseBodyForContentTypes", - method='post'.upper(), - accept_content_type=accept_content_type, - ) - - assert isinstance(api_response.response, urllib3.HTTPResponse) - assert isinstance(api_response.body, self.response_body_schema) - deserialized_response_body = self.response_body_schema.from_openapi_data_( - payload, - configuration_=self.schema_config - ) - assert api_response.body == deserialized_response_body - - def test_do_not_match_string_lacking_nul_fails(self): - # do not match string lacking nul - accept_content_type = 'application/json' - - with patch.object(urllib3.PoolManager, 'request') as mock_request: - payload = ( - "hellothere" - ) - mock_request.return_value = self.response( - self.json_bytes(payload), - status=self.response_status - ) - with self.assertRaises((unit_test_api.ApiValueError, unit_test_api.ApiTypeError)): - self.api.post( - accept_content_types=(accept_content_type,) - ) - self.assert_pool_manager_request_called_with( - mock_request, - self.api_config.get_server_url('servers', None) + "/responseBody/postNulCharactersInStringsResponseBodyForContentTypes", - method='post'.upper(), - content_type=None, - accept_content_type=accept_content_type, - ) - -if __name__ == '__main__': - unittest.main() diff --git a/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_response_body_post_null_type_matches_only_the_null_object_response_body_for_content_types/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_response_body_post_null_type_matches_only_the_null_object_response_body_for_content_types/__init__.py index 0d16cc4b795..e69de29bb2d 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_response_body_post_null_type_matches_only_the_null_object_response_body_for_content_types/__init__.py +++ b/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_response_body_post_null_type_matches_only_the_null_object_response_body_for_content_types/__init__.py @@ -1,283 +0,0 @@ -# coding: utf-8 - -""" - - - Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator -""" - -import unittest -from unittest.mock import patch - -import urllib3 - -import unit_test_api -from unit_test_api.paths.response_body_post_null_type_matches_only_the_null_object_response_body_for_content_types.post import operation as post # noqa: E501 -from unit_test_api import schemas, api_client -from unit_test_api.configurations import api_configuration, schema_configuration - -from .. import ApiTestMixin - - -class TestPost(ApiTestMixin, unittest.TestCase): - """ - Post unit test stubs - """ - api_config = api_configuration.ApiConfiguration() - schema_config = schema_configuration.SchemaConfiguration() - used_api_client = api_client.ApiClient(configuration=api_config, schema_config=schema_config) - api = post.ApiForPost(api_client=used_api_client) # noqa: E501 - - response_status = 200 - response_body_schema = post.response_200.ResponseFor200.content["application/json"].schema - - def test_a_float_is_not_null_fails(self): - # a float is not null - accept_content_type = 'application/json' - - with patch.object(urllib3.PoolManager, 'request') as mock_request: - payload = ( - 1.1 - ) - mock_request.return_value = self.response( - self.json_bytes(payload), - status=self.response_status - ) - with self.assertRaises((unit_test_api.ApiValueError, unit_test_api.ApiTypeError)): - self.api.post( - accept_content_types=(accept_content_type,) - ) - self.assert_pool_manager_request_called_with( - mock_request, - self.api_config.get_server_url('servers', None) + "/responseBody/postNullTypeMatchesOnlyTheNullObjectResponseBodyForContentTypes", - method='post'.upper(), - content_type=None, - accept_content_type=accept_content_type, - ) - - def test_an_object_is_not_null_fails(self): - # an object is not null - accept_content_type = 'application/json' - - with patch.object(urllib3.PoolManager, 'request') as mock_request: - payload = ( - { - } - ) - mock_request.return_value = self.response( - self.json_bytes(payload), - status=self.response_status - ) - with self.assertRaises((unit_test_api.ApiValueError, unit_test_api.ApiTypeError)): - self.api.post( - accept_content_types=(accept_content_type,) - ) - self.assert_pool_manager_request_called_with( - mock_request, - self.api_config.get_server_url('servers', None) + "/responseBody/postNullTypeMatchesOnlyTheNullObjectResponseBodyForContentTypes", - method='post'.upper(), - content_type=None, - accept_content_type=accept_content_type, - ) - - def test_false_is_not_null_fails(self): - # false is not null - accept_content_type = 'application/json' - - with patch.object(urllib3.PoolManager, 'request') as mock_request: - payload = ( - False - ) - mock_request.return_value = self.response( - self.json_bytes(payload), - status=self.response_status - ) - with self.assertRaises((unit_test_api.ApiValueError, unit_test_api.ApiTypeError)): - self.api.post( - accept_content_types=(accept_content_type,) - ) - self.assert_pool_manager_request_called_with( - mock_request, - self.api_config.get_server_url('servers', None) + "/responseBody/postNullTypeMatchesOnlyTheNullObjectResponseBodyForContentTypes", - method='post'.upper(), - content_type=None, - accept_content_type=accept_content_type, - ) - - def test_an_integer_is_not_null_fails(self): - # an integer is not null - accept_content_type = 'application/json' - - with patch.object(urllib3.PoolManager, 'request') as mock_request: - payload = ( - 1 - ) - mock_request.return_value = self.response( - self.json_bytes(payload), - status=self.response_status - ) - with self.assertRaises((unit_test_api.ApiValueError, unit_test_api.ApiTypeError)): - self.api.post( - accept_content_types=(accept_content_type,) - ) - self.assert_pool_manager_request_called_with( - mock_request, - self.api_config.get_server_url('servers', None) + "/responseBody/postNullTypeMatchesOnlyTheNullObjectResponseBodyForContentTypes", - method='post'.upper(), - content_type=None, - accept_content_type=accept_content_type, - ) - - def test_true_is_not_null_fails(self): - # true is not null - accept_content_type = 'application/json' - - with patch.object(urllib3.PoolManager, 'request') as mock_request: - payload = ( - True - ) - mock_request.return_value = self.response( - self.json_bytes(payload), - status=self.response_status - ) - with self.assertRaises((unit_test_api.ApiValueError, unit_test_api.ApiTypeError)): - self.api.post( - accept_content_types=(accept_content_type,) - ) - self.assert_pool_manager_request_called_with( - mock_request, - self.api_config.get_server_url('servers', None) + "/responseBody/postNullTypeMatchesOnlyTheNullObjectResponseBodyForContentTypes", - method='post'.upper(), - content_type=None, - accept_content_type=accept_content_type, - ) - - def test_zero_is_not_null_fails(self): - # zero is not null - accept_content_type = 'application/json' - - with patch.object(urllib3.PoolManager, 'request') as mock_request: - payload = ( - 0 - ) - mock_request.return_value = self.response( - self.json_bytes(payload), - status=self.response_status - ) - with self.assertRaises((unit_test_api.ApiValueError, unit_test_api.ApiTypeError)): - self.api.post( - accept_content_types=(accept_content_type,) - ) - self.assert_pool_manager_request_called_with( - mock_request, - self.api_config.get_server_url('servers', None) + "/responseBody/postNullTypeMatchesOnlyTheNullObjectResponseBodyForContentTypes", - method='post'.upper(), - content_type=None, - accept_content_type=accept_content_type, - ) - - def test_an_empty_string_is_not_null_fails(self): - # an empty string is not null - accept_content_type = 'application/json' - - with patch.object(urllib3.PoolManager, 'request') as mock_request: - payload = ( - "" - ) - mock_request.return_value = self.response( - self.json_bytes(payload), - status=self.response_status - ) - with self.assertRaises((unit_test_api.ApiValueError, unit_test_api.ApiTypeError)): - self.api.post( - accept_content_types=(accept_content_type,) - ) - self.assert_pool_manager_request_called_with( - mock_request, - self.api_config.get_server_url('servers', None) + "/responseBody/postNullTypeMatchesOnlyTheNullObjectResponseBodyForContentTypes", - method='post'.upper(), - content_type=None, - accept_content_type=accept_content_type, - ) - - def test_null_is_null_passes(self): - # null is null - accept_content_type = 'application/json' - - with patch.object(urllib3.PoolManager, 'request') as mock_request: - payload = ( - None - ) - mock_request.return_value = self.response( - self.json_bytes(payload), - status=self.response_status - ) - api_response = self.api.post( - accept_content_types=(accept_content_type,) - ) - self.assert_pool_manager_request_called_with( - mock_request, - self.api_config.get_server_url('servers', None) + "/responseBody/postNullTypeMatchesOnlyTheNullObjectResponseBodyForContentTypes", - method='post'.upper(), - accept_content_type=accept_content_type, - ) - - assert isinstance(api_response.response, urllib3.HTTPResponse) - assert isinstance(api_response.body, self.response_body_schema) - deserialized_response_body = self.response_body_schema.from_openapi_data_( - payload, - configuration_=self.schema_config - ) - assert api_response.body == deserialized_response_body - - def test_an_array_is_not_null_fails(self): - # an array is not null - accept_content_type = 'application/json' - - with patch.object(urllib3.PoolManager, 'request') as mock_request: - payload = ( - [ - ] - ) - mock_request.return_value = self.response( - self.json_bytes(payload), - status=self.response_status - ) - with self.assertRaises((unit_test_api.ApiValueError, unit_test_api.ApiTypeError)): - self.api.post( - accept_content_types=(accept_content_type,) - ) - self.assert_pool_manager_request_called_with( - mock_request, - self.api_config.get_server_url('servers', None) + "/responseBody/postNullTypeMatchesOnlyTheNullObjectResponseBodyForContentTypes", - method='post'.upper(), - content_type=None, - accept_content_type=accept_content_type, - ) - - def test_a_string_is_not_null_fails(self): - # a string is not null - accept_content_type = 'application/json' - - with patch.object(urllib3.PoolManager, 'request') as mock_request: - payload = ( - "foo" - ) - mock_request.return_value = self.response( - self.json_bytes(payload), - status=self.response_status - ) - with self.assertRaises((unit_test_api.ApiValueError, unit_test_api.ApiTypeError)): - self.api.post( - accept_content_types=(accept_content_type,) - ) - self.assert_pool_manager_request_called_with( - mock_request, - self.api_config.get_server_url('servers', None) + "/responseBody/postNullTypeMatchesOnlyTheNullObjectResponseBodyForContentTypes", - method='post'.upper(), - content_type=None, - accept_content_type=accept_content_type, - ) - -if __name__ == '__main__': - unittest.main() diff --git a/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_response_body_post_number_type_matches_numbers_response_body_for_content_types/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_response_body_post_number_type_matches_numbers_response_body_for_content_types/__init__.py index 2d595ec07c0..e69de29bb2d 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_response_body_post_number_type_matches_numbers_response_body_for_content_types/__init__.py +++ b/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_response_body_post_number_type_matches_numbers_response_body_for_content_types/__init__.py @@ -1,271 +0,0 @@ -# coding: utf-8 - -""" - - - Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator -""" - -import unittest -from unittest.mock import patch - -import urllib3 - -import unit_test_api -from unit_test_api.paths.response_body_post_number_type_matches_numbers_response_body_for_content_types.post import operation as post # noqa: E501 -from unit_test_api import schemas, api_client -from unit_test_api.configurations import api_configuration, schema_configuration - -from .. import ApiTestMixin - - -class TestPost(ApiTestMixin, unittest.TestCase): - """ - Post unit test stubs - """ - api_config = api_configuration.ApiConfiguration() - schema_config = schema_configuration.SchemaConfiguration() - used_api_client = api_client.ApiClient(configuration=api_config, schema_config=schema_config) - api = post.ApiForPost(api_client=used_api_client) # noqa: E501 - - response_status = 200 - response_body_schema = post.response_200.ResponseFor200.content["application/json"].schema - - def test_an_array_is_not_a_number_fails(self): - # an array is not a number - accept_content_type = 'application/json' - - with patch.object(urllib3.PoolManager, 'request') as mock_request: - payload = ( - [ - ] - ) - mock_request.return_value = self.response( - self.json_bytes(payload), - status=self.response_status - ) - with self.assertRaises((unit_test_api.ApiValueError, unit_test_api.ApiTypeError)): - self.api.post( - accept_content_types=(accept_content_type,) - ) - self.assert_pool_manager_request_called_with( - mock_request, - self.api_config.get_server_url('servers', None) + "/responseBody/postNumberTypeMatchesNumbersResponseBodyForContentTypes", - method='post'.upper(), - content_type=None, - accept_content_type=accept_content_type, - ) - - def test_null_is_not_a_number_fails(self): - # null is not a number - accept_content_type = 'application/json' - - with patch.object(urllib3.PoolManager, 'request') as mock_request: - payload = ( - None - ) - mock_request.return_value = self.response( - self.json_bytes(payload), - status=self.response_status - ) - with self.assertRaises((unit_test_api.ApiValueError, unit_test_api.ApiTypeError)): - self.api.post( - accept_content_types=(accept_content_type,) - ) - self.assert_pool_manager_request_called_with( - mock_request, - self.api_config.get_server_url('servers', None) + "/responseBody/postNumberTypeMatchesNumbersResponseBodyForContentTypes", - method='post'.upper(), - content_type=None, - accept_content_type=accept_content_type, - ) - - def test_an_object_is_not_a_number_fails(self): - # an object is not a number - accept_content_type = 'application/json' - - with patch.object(urllib3.PoolManager, 'request') as mock_request: - payload = ( - { - } - ) - mock_request.return_value = self.response( - self.json_bytes(payload), - status=self.response_status - ) - with self.assertRaises((unit_test_api.ApiValueError, unit_test_api.ApiTypeError)): - self.api.post( - accept_content_types=(accept_content_type,) - ) - self.assert_pool_manager_request_called_with( - mock_request, - self.api_config.get_server_url('servers', None) + "/responseBody/postNumberTypeMatchesNumbersResponseBodyForContentTypes", - method='post'.upper(), - content_type=None, - accept_content_type=accept_content_type, - ) - - def test_a_boolean_is_not_a_number_fails(self): - # a boolean is not a number - accept_content_type = 'application/json' - - with patch.object(urllib3.PoolManager, 'request') as mock_request: - payload = ( - True - ) - mock_request.return_value = self.response( - self.json_bytes(payload), - status=self.response_status - ) - with self.assertRaises((unit_test_api.ApiValueError, unit_test_api.ApiTypeError)): - self.api.post( - accept_content_types=(accept_content_type,) - ) - self.assert_pool_manager_request_called_with( - mock_request, - self.api_config.get_server_url('servers', None) + "/responseBody/postNumberTypeMatchesNumbersResponseBodyForContentTypes", - method='post'.upper(), - content_type=None, - accept_content_type=accept_content_type, - ) - - def test_a_float_is_a_number_passes(self): - # a float is a number - accept_content_type = 'application/json' - - with patch.object(urllib3.PoolManager, 'request') as mock_request: - payload = ( - 1.1 - ) - mock_request.return_value = self.response( - self.json_bytes(payload), - status=self.response_status - ) - api_response = self.api.post( - accept_content_types=(accept_content_type,) - ) - self.assert_pool_manager_request_called_with( - mock_request, - self.api_config.get_server_url('servers', None) + "/responseBody/postNumberTypeMatchesNumbersResponseBodyForContentTypes", - method='post'.upper(), - accept_content_type=accept_content_type, - ) - - assert isinstance(api_response.response, urllib3.HTTPResponse) - assert isinstance(api_response.body, self.response_body_schema) - deserialized_response_body = self.response_body_schema.from_openapi_data_( - payload, - configuration_=self.schema_config - ) - assert api_response.body == deserialized_response_body - - def test_a_string_is_still_not_a_number_even_if_it_looks_like_one_fails(self): - # a string is still not a number, even if it looks like one - accept_content_type = 'application/json' - - with patch.object(urllib3.PoolManager, 'request') as mock_request: - payload = ( - "1" - ) - mock_request.return_value = self.response( - self.json_bytes(payload), - status=self.response_status - ) - with self.assertRaises((unit_test_api.ApiValueError, unit_test_api.ApiTypeError)): - self.api.post( - accept_content_types=(accept_content_type,) - ) - self.assert_pool_manager_request_called_with( - mock_request, - self.api_config.get_server_url('servers', None) + "/responseBody/postNumberTypeMatchesNumbersResponseBodyForContentTypes", - method='post'.upper(), - content_type=None, - accept_content_type=accept_content_type, - ) - - def test_a_string_is_not_a_number_fails(self): - # a string is not a number - accept_content_type = 'application/json' - - with patch.object(urllib3.PoolManager, 'request') as mock_request: - payload = ( - "foo" - ) - mock_request.return_value = self.response( - self.json_bytes(payload), - status=self.response_status - ) - with self.assertRaises((unit_test_api.ApiValueError, unit_test_api.ApiTypeError)): - self.api.post( - accept_content_types=(accept_content_type,) - ) - self.assert_pool_manager_request_called_with( - mock_request, - self.api_config.get_server_url('servers', None) + "/responseBody/postNumberTypeMatchesNumbersResponseBodyForContentTypes", - method='post'.upper(), - content_type=None, - accept_content_type=accept_content_type, - ) - - def test_an_integer_is_a_number_passes(self): - # an integer is a number - accept_content_type = 'application/json' - - with patch.object(urllib3.PoolManager, 'request') as mock_request: - payload = ( - 1 - ) - mock_request.return_value = self.response( - self.json_bytes(payload), - status=self.response_status - ) - api_response = self.api.post( - accept_content_types=(accept_content_type,) - ) - self.assert_pool_manager_request_called_with( - mock_request, - self.api_config.get_server_url('servers', None) + "/responseBody/postNumberTypeMatchesNumbersResponseBodyForContentTypes", - method='post'.upper(), - accept_content_type=accept_content_type, - ) - - assert isinstance(api_response.response, urllib3.HTTPResponse) - assert isinstance(api_response.body, self.response_body_schema) - deserialized_response_body = self.response_body_schema.from_openapi_data_( - payload, - configuration_=self.schema_config - ) - assert api_response.body == deserialized_response_body - - def test_a_float_with_zero_fractional_part_is_a_number_and_an_integer_passes(self): - # a float with zero fractional part is a number (and an integer) - accept_content_type = 'application/json' - - with patch.object(urllib3.PoolManager, 'request') as mock_request: - payload = ( - 1.0 - ) - mock_request.return_value = self.response( - self.json_bytes(payload), - status=self.response_status - ) - api_response = self.api.post( - accept_content_types=(accept_content_type,) - ) - self.assert_pool_manager_request_called_with( - mock_request, - self.api_config.get_server_url('servers', None) + "/responseBody/postNumberTypeMatchesNumbersResponseBodyForContentTypes", - method='post'.upper(), - accept_content_type=accept_content_type, - ) - - assert isinstance(api_response.response, urllib3.HTTPResponse) - assert isinstance(api_response.body, self.response_body_schema) - deserialized_response_body = self.response_body_schema.from_openapi_data_( - payload, - configuration_=self.schema_config - ) - assert api_response.body == deserialized_response_body - -if __name__ == '__main__': - unittest.main() diff --git a/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_response_body_post_object_properties_validation_response_body_for_content_types/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_response_body_post_object_properties_validation_response_body_for_content_types/__init__.py index afdaf360647..e69de29bb2d 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_response_body_post_object_properties_validation_response_body_for_content_types/__init__.py +++ b/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_response_body_post_object_properties_validation_response_body_for_content_types/__init__.py @@ -1,226 +0,0 @@ -# coding: utf-8 - -""" - - - Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator -""" - -import unittest -from unittest.mock import patch - -import urllib3 - -import unit_test_api -from unit_test_api.paths.response_body_post_object_properties_validation_response_body_for_content_types.post import operation as post # noqa: E501 -from unit_test_api import schemas, api_client -from unit_test_api.configurations import api_configuration, schema_configuration - -from .. import ApiTestMixin - - -class TestPost(ApiTestMixin, unittest.TestCase): - """ - Post unit test stubs - """ - api_config = api_configuration.ApiConfiguration() - schema_config = schema_configuration.SchemaConfiguration() - used_api_client = api_client.ApiClient(configuration=api_config, schema_config=schema_config) - api = post.ApiForPost(api_client=used_api_client) # noqa: E501 - - response_status = 200 - response_body_schema = post.response_200.ResponseFor200.content["application/json"].schema - - def test_ignores_arrays_passes(self): - # ignores arrays - accept_content_type = 'application/json' - - with patch.object(urllib3.PoolManager, 'request') as mock_request: - payload = ( - [ - ] - ) - mock_request.return_value = self.response( - self.json_bytes(payload), - status=self.response_status - ) - api_response = self.api.post( - accept_content_types=(accept_content_type,) - ) - self.assert_pool_manager_request_called_with( - mock_request, - self.api_config.get_server_url('servers', None) + "/responseBody/postObjectPropertiesValidationResponseBodyForContentTypes", - method='post'.upper(), - accept_content_type=accept_content_type, - ) - - assert isinstance(api_response.response, urllib3.HTTPResponse) - assert isinstance(api_response.body, self.response_body_schema) - deserialized_response_body = self.response_body_schema.from_openapi_data_( - payload, - configuration_=self.schema_config - ) - assert api_response.body == deserialized_response_body - - def test_ignores_other_non_objects_passes(self): - # ignores other non-objects - accept_content_type = 'application/json' - - with patch.object(urllib3.PoolManager, 'request') as mock_request: - payload = ( - 12 - ) - mock_request.return_value = self.response( - self.json_bytes(payload), - status=self.response_status - ) - api_response = self.api.post( - accept_content_types=(accept_content_type,) - ) - self.assert_pool_manager_request_called_with( - mock_request, - self.api_config.get_server_url('servers', None) + "/responseBody/postObjectPropertiesValidationResponseBodyForContentTypes", - method='post'.upper(), - accept_content_type=accept_content_type, - ) - - assert isinstance(api_response.response, urllib3.HTTPResponse) - assert isinstance(api_response.body, self.response_body_schema) - deserialized_response_body = self.response_body_schema.from_openapi_data_( - payload, - configuration_=self.schema_config - ) - assert api_response.body == deserialized_response_body - - def test_one_property_invalid_is_invalid_fails(self): - # one property invalid is invalid - accept_content_type = 'application/json' - - with patch.object(urllib3.PoolManager, 'request') as mock_request: - payload = ( - { - "foo": - 1, - "bar": - { - }, - } - ) - mock_request.return_value = self.response( - self.json_bytes(payload), - status=self.response_status - ) - with self.assertRaises((unit_test_api.ApiValueError, unit_test_api.ApiTypeError)): - self.api.post( - accept_content_types=(accept_content_type,) - ) - self.assert_pool_manager_request_called_with( - mock_request, - self.api_config.get_server_url('servers', None) + "/responseBody/postObjectPropertiesValidationResponseBodyForContentTypes", - method='post'.upper(), - content_type=None, - accept_content_type=accept_content_type, - ) - - def test_both_properties_present_and_valid_is_valid_passes(self): - # both properties present and valid is valid - accept_content_type = 'application/json' - - with patch.object(urllib3.PoolManager, 'request') as mock_request: - payload = ( - { - "foo": - 1, - "bar": - "baz", - } - ) - mock_request.return_value = self.response( - self.json_bytes(payload), - status=self.response_status - ) - api_response = self.api.post( - accept_content_types=(accept_content_type,) - ) - self.assert_pool_manager_request_called_with( - mock_request, - self.api_config.get_server_url('servers', None) + "/responseBody/postObjectPropertiesValidationResponseBodyForContentTypes", - method='post'.upper(), - accept_content_type=accept_content_type, - ) - - assert isinstance(api_response.response, urllib3.HTTPResponse) - assert isinstance(api_response.body, self.response_body_schema) - deserialized_response_body = self.response_body_schema.from_openapi_data_( - payload, - configuration_=self.schema_config - ) - assert api_response.body == deserialized_response_body - - def test_doesn_t_invalidate_other_properties_passes(self): - # doesn't invalidate other properties - accept_content_type = 'application/json' - - with patch.object(urllib3.PoolManager, 'request') as mock_request: - payload = ( - { - "quux": - [ - ], - } - ) - mock_request.return_value = self.response( - self.json_bytes(payload), - status=self.response_status - ) - api_response = self.api.post( - accept_content_types=(accept_content_type,) - ) - self.assert_pool_manager_request_called_with( - mock_request, - self.api_config.get_server_url('servers', None) + "/responseBody/postObjectPropertiesValidationResponseBodyForContentTypes", - method='post'.upper(), - accept_content_type=accept_content_type, - ) - - assert isinstance(api_response.response, urllib3.HTTPResponse) - assert isinstance(api_response.body, self.response_body_schema) - deserialized_response_body = self.response_body_schema.from_openapi_data_( - payload, - configuration_=self.schema_config - ) - assert api_response.body == deserialized_response_body - - def test_both_properties_invalid_is_invalid_fails(self): - # both properties invalid is invalid - accept_content_type = 'application/json' - - with patch.object(urllib3.PoolManager, 'request') as mock_request: - payload = ( - { - "foo": - [ - ], - "bar": - { - }, - } - ) - mock_request.return_value = self.response( - self.json_bytes(payload), - status=self.response_status - ) - with self.assertRaises((unit_test_api.ApiValueError, unit_test_api.ApiTypeError)): - self.api.post( - accept_content_types=(accept_content_type,) - ) - self.assert_pool_manager_request_called_with( - mock_request, - self.api_config.get_server_url('servers', None) + "/responseBody/postObjectPropertiesValidationResponseBodyForContentTypes", - method='post'.upper(), - content_type=None, - accept_content_type=accept_content_type, - ) - -if __name__ == '__main__': - unittest.main() diff --git a/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_response_body_post_object_type_matches_objects_response_body_for_content_types/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_response_body_post_object_type_matches_objects_response_body_for_content_types/__init__.py index c5b277485fd..e69de29bb2d 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_response_body_post_object_type_matches_objects_response_body_for_content_types/__init__.py +++ b/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_response_body_post_object_type_matches_objects_response_body_for_content_types/__init__.py @@ -1,211 +0,0 @@ -# coding: utf-8 - -""" - - - Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator -""" - -import unittest -from unittest.mock import patch - -import urllib3 - -import unit_test_api -from unit_test_api.paths.response_body_post_object_type_matches_objects_response_body_for_content_types.post import operation as post # noqa: E501 -from unit_test_api import schemas, api_client -from unit_test_api.configurations import api_configuration, schema_configuration - -from .. import ApiTestMixin - - -class TestPost(ApiTestMixin, unittest.TestCase): - """ - Post unit test stubs - """ - api_config = api_configuration.ApiConfiguration() - schema_config = schema_configuration.SchemaConfiguration() - used_api_client = api_client.ApiClient(configuration=api_config, schema_config=schema_config) - api = post.ApiForPost(api_client=used_api_client) # noqa: E501 - - response_status = 200 - response_body_schema = post.response_200.ResponseFor200.content["application/json"].schema - - def test_a_float_is_not_an_object_fails(self): - # a float is not an object - accept_content_type = 'application/json' - - with patch.object(urllib3.PoolManager, 'request') as mock_request: - payload = ( - 1.1 - ) - mock_request.return_value = self.response( - self.json_bytes(payload), - status=self.response_status - ) - with self.assertRaises((unit_test_api.ApiValueError, unit_test_api.ApiTypeError)): - self.api.post( - accept_content_types=(accept_content_type,) - ) - self.assert_pool_manager_request_called_with( - mock_request, - self.api_config.get_server_url('servers', None) + "/responseBody/postObjectTypeMatchesObjectsResponseBodyForContentTypes", - method='post'.upper(), - content_type=None, - accept_content_type=accept_content_type, - ) - - def test_null_is_not_an_object_fails(self): - # null is not an object - accept_content_type = 'application/json' - - with patch.object(urllib3.PoolManager, 'request') as mock_request: - payload = ( - None - ) - mock_request.return_value = self.response( - self.json_bytes(payload), - status=self.response_status - ) - with self.assertRaises((unit_test_api.ApiValueError, unit_test_api.ApiTypeError)): - self.api.post( - accept_content_types=(accept_content_type,) - ) - self.assert_pool_manager_request_called_with( - mock_request, - self.api_config.get_server_url('servers', None) + "/responseBody/postObjectTypeMatchesObjectsResponseBodyForContentTypes", - method='post'.upper(), - content_type=None, - accept_content_type=accept_content_type, - ) - - def test_an_array_is_not_an_object_fails(self): - # an array is not an object - accept_content_type = 'application/json' - - with patch.object(urllib3.PoolManager, 'request') as mock_request: - payload = ( - [ - ] - ) - mock_request.return_value = self.response( - self.json_bytes(payload), - status=self.response_status - ) - with self.assertRaises((unit_test_api.ApiValueError, unit_test_api.ApiTypeError)): - self.api.post( - accept_content_types=(accept_content_type,) - ) - self.assert_pool_manager_request_called_with( - mock_request, - self.api_config.get_server_url('servers', None) + "/responseBody/postObjectTypeMatchesObjectsResponseBodyForContentTypes", - method='post'.upper(), - content_type=None, - accept_content_type=accept_content_type, - ) - - def test_an_object_is_an_object_passes(self): - # an object is an object - accept_content_type = 'application/json' - - with patch.object(urllib3.PoolManager, 'request') as mock_request: - payload = ( - { - } - ) - mock_request.return_value = self.response( - self.json_bytes(payload), - status=self.response_status - ) - api_response = self.api.post( - accept_content_types=(accept_content_type,) - ) - self.assert_pool_manager_request_called_with( - mock_request, - self.api_config.get_server_url('servers', None) + "/responseBody/postObjectTypeMatchesObjectsResponseBodyForContentTypes", - method='post'.upper(), - accept_content_type=accept_content_type, - ) - - assert isinstance(api_response.response, urllib3.HTTPResponse) - assert isinstance(api_response.body, self.response_body_schema) - deserialized_response_body = self.response_body_schema.from_openapi_data_( - payload, - configuration_=self.schema_config - ) - assert api_response.body == deserialized_response_body - - def test_a_string_is_not_an_object_fails(self): - # a string is not an object - accept_content_type = 'application/json' - - with patch.object(urllib3.PoolManager, 'request') as mock_request: - payload = ( - "foo" - ) - mock_request.return_value = self.response( - self.json_bytes(payload), - status=self.response_status - ) - with self.assertRaises((unit_test_api.ApiValueError, unit_test_api.ApiTypeError)): - self.api.post( - accept_content_types=(accept_content_type,) - ) - self.assert_pool_manager_request_called_with( - mock_request, - self.api_config.get_server_url('servers', None) + "/responseBody/postObjectTypeMatchesObjectsResponseBodyForContentTypes", - method='post'.upper(), - content_type=None, - accept_content_type=accept_content_type, - ) - - def test_an_integer_is_not_an_object_fails(self): - # an integer is not an object - accept_content_type = 'application/json' - - with patch.object(urllib3.PoolManager, 'request') as mock_request: - payload = ( - 1 - ) - mock_request.return_value = self.response( - self.json_bytes(payload), - status=self.response_status - ) - with self.assertRaises((unit_test_api.ApiValueError, unit_test_api.ApiTypeError)): - self.api.post( - accept_content_types=(accept_content_type,) - ) - self.assert_pool_manager_request_called_with( - mock_request, - self.api_config.get_server_url('servers', None) + "/responseBody/postObjectTypeMatchesObjectsResponseBodyForContentTypes", - method='post'.upper(), - content_type=None, - accept_content_type=accept_content_type, - ) - - def test_a_boolean_is_not_an_object_fails(self): - # a boolean is not an object - accept_content_type = 'application/json' - - with patch.object(urllib3.PoolManager, 'request') as mock_request: - payload = ( - True - ) - mock_request.return_value = self.response( - self.json_bytes(payload), - status=self.response_status - ) - with self.assertRaises((unit_test_api.ApiValueError, unit_test_api.ApiTypeError)): - self.api.post( - accept_content_types=(accept_content_type,) - ) - self.assert_pool_manager_request_called_with( - mock_request, - self.api_config.get_server_url('servers', None) + "/responseBody/postObjectTypeMatchesObjectsResponseBodyForContentTypes", - method='post'.upper(), - content_type=None, - accept_content_type=accept_content_type, - ) - -if __name__ == '__main__': - unittest.main() diff --git a/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_response_body_post_oneof_complex_types_response_body_for_content_types/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_response_body_post_oneof_complex_types_response_body_for_content_types/__init__.py index c769f61be08..e69de29bb2d 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_response_body_post_oneof_complex_types_response_body_for_content_types/__init__.py +++ b/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_response_body_post_oneof_complex_types_response_body_for_content_types/__init__.py @@ -1,159 +0,0 @@ -# coding: utf-8 - -""" - - - Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator -""" - -import unittest -from unittest.mock import patch - -import urllib3 - -import unit_test_api -from unit_test_api.paths.response_body_post_oneof_complex_types_response_body_for_content_types.post import operation as post # noqa: E501 -from unit_test_api import schemas, api_client -from unit_test_api.configurations import api_configuration, schema_configuration - -from .. import ApiTestMixin - - -class TestPost(ApiTestMixin, unittest.TestCase): - """ - Post unit test stubs - """ - api_config = api_configuration.ApiConfiguration() - schema_config = schema_configuration.SchemaConfiguration() - used_api_client = api_client.ApiClient(configuration=api_config, schema_config=schema_config) - api = post.ApiForPost(api_client=used_api_client) # noqa: E501 - - response_status = 200 - response_body_schema = post.response_200.ResponseFor200.content["application/json"].schema - - def test_first_oneof_valid_complex_passes(self): - # first oneOf valid (complex) - accept_content_type = 'application/json' - - with patch.object(urllib3.PoolManager, 'request') as mock_request: - payload = ( - { - "bar": - 2, - } - ) - mock_request.return_value = self.response( - self.json_bytes(payload), - status=self.response_status - ) - api_response = self.api.post( - accept_content_types=(accept_content_type,) - ) - self.assert_pool_manager_request_called_with( - mock_request, - self.api_config.get_server_url('servers', None) + "/responseBody/postOneofComplexTypesResponseBodyForContentTypes", - method='post'.upper(), - accept_content_type=accept_content_type, - ) - - assert isinstance(api_response.response, urllib3.HTTPResponse) - assert isinstance(api_response.body, self.response_body_schema) - deserialized_response_body = self.response_body_schema.from_openapi_data_( - payload, - configuration_=self.schema_config - ) - assert api_response.body == deserialized_response_body - - def test_neither_oneof_valid_complex_fails(self): - # neither oneOf valid (complex) - accept_content_type = 'application/json' - - with patch.object(urllib3.PoolManager, 'request') as mock_request: - payload = ( - { - "foo": - 2, - "bar": - "quux", - } - ) - mock_request.return_value = self.response( - self.json_bytes(payload), - status=self.response_status - ) - with self.assertRaises((unit_test_api.ApiValueError, unit_test_api.ApiTypeError)): - self.api.post( - accept_content_types=(accept_content_type,) - ) - self.assert_pool_manager_request_called_with( - mock_request, - self.api_config.get_server_url('servers', None) + "/responseBody/postOneofComplexTypesResponseBodyForContentTypes", - method='post'.upper(), - content_type=None, - accept_content_type=accept_content_type, - ) - - def test_both_oneof_valid_complex_fails(self): - # both oneOf valid (complex) - accept_content_type = 'application/json' - - with patch.object(urllib3.PoolManager, 'request') as mock_request: - payload = ( - { - "foo": - "baz", - "bar": - 2, - } - ) - mock_request.return_value = self.response( - self.json_bytes(payload), - status=self.response_status - ) - with self.assertRaises((unit_test_api.ApiValueError, unit_test_api.ApiTypeError)): - self.api.post( - accept_content_types=(accept_content_type,) - ) - self.assert_pool_manager_request_called_with( - mock_request, - self.api_config.get_server_url('servers', None) + "/responseBody/postOneofComplexTypesResponseBodyForContentTypes", - method='post'.upper(), - content_type=None, - accept_content_type=accept_content_type, - ) - - def test_second_oneof_valid_complex_passes(self): - # second oneOf valid (complex) - accept_content_type = 'application/json' - - with patch.object(urllib3.PoolManager, 'request') as mock_request: - payload = ( - { - "foo": - "baz", - } - ) - mock_request.return_value = self.response( - self.json_bytes(payload), - status=self.response_status - ) - api_response = self.api.post( - accept_content_types=(accept_content_type,) - ) - self.assert_pool_manager_request_called_with( - mock_request, - self.api_config.get_server_url('servers', None) + "/responseBody/postOneofComplexTypesResponseBodyForContentTypes", - method='post'.upper(), - accept_content_type=accept_content_type, - ) - - assert isinstance(api_response.response, urllib3.HTTPResponse) - assert isinstance(api_response.body, self.response_body_schema) - deserialized_response_body = self.response_body_schema.from_openapi_data_( - payload, - configuration_=self.schema_config - ) - assert api_response.body == deserialized_response_body - -if __name__ == '__main__': - unittest.main() diff --git a/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_response_body_post_oneof_response_body_for_content_types/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_response_body_post_oneof_response_body_for_content_types/__init__.py index 83c822950b2..e69de29bb2d 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_response_body_post_oneof_response_body_for_content_types/__init__.py +++ b/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_response_body_post_oneof_response_body_for_content_types/__init__.py @@ -1,143 +0,0 @@ -# coding: utf-8 - -""" - - - Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator -""" - -import unittest -from unittest.mock import patch - -import urllib3 - -import unit_test_api -from unit_test_api.paths.response_body_post_oneof_response_body_for_content_types.post import operation as post # noqa: E501 -from unit_test_api import schemas, api_client -from unit_test_api.configurations import api_configuration, schema_configuration - -from .. import ApiTestMixin - - -class TestPost(ApiTestMixin, unittest.TestCase): - """ - Post unit test stubs - """ - api_config = api_configuration.ApiConfiguration() - schema_config = schema_configuration.SchemaConfiguration() - used_api_client = api_client.ApiClient(configuration=api_config, schema_config=schema_config) - api = post.ApiForPost(api_client=used_api_client) # noqa: E501 - - response_status = 200 - response_body_schema = post.response_200.ResponseFor200.content["application/json"].schema - - def test_second_oneof_valid_passes(self): - # second oneOf valid - accept_content_type = 'application/json' - - with patch.object(urllib3.PoolManager, 'request') as mock_request: - payload = ( - 2.5 - ) - mock_request.return_value = self.response( - self.json_bytes(payload), - status=self.response_status - ) - api_response = self.api.post( - accept_content_types=(accept_content_type,) - ) - self.assert_pool_manager_request_called_with( - mock_request, - self.api_config.get_server_url('servers', None) + "/responseBody/postOneofResponseBodyForContentTypes", - method='post'.upper(), - accept_content_type=accept_content_type, - ) - - assert isinstance(api_response.response, urllib3.HTTPResponse) - assert isinstance(api_response.body, self.response_body_schema) - deserialized_response_body = self.response_body_schema.from_openapi_data_( - payload, - configuration_=self.schema_config - ) - assert api_response.body == deserialized_response_body - - def test_both_oneof_valid_fails(self): - # both oneOf valid - accept_content_type = 'application/json' - - with patch.object(urllib3.PoolManager, 'request') as mock_request: - payload = ( - 3 - ) - mock_request.return_value = self.response( - self.json_bytes(payload), - status=self.response_status - ) - with self.assertRaises((unit_test_api.ApiValueError, unit_test_api.ApiTypeError)): - self.api.post( - accept_content_types=(accept_content_type,) - ) - self.assert_pool_manager_request_called_with( - mock_request, - self.api_config.get_server_url('servers', None) + "/responseBody/postOneofResponseBodyForContentTypes", - method='post'.upper(), - content_type=None, - accept_content_type=accept_content_type, - ) - - def test_first_oneof_valid_passes(self): - # first oneOf valid - accept_content_type = 'application/json' - - with patch.object(urllib3.PoolManager, 'request') as mock_request: - payload = ( - 1 - ) - mock_request.return_value = self.response( - self.json_bytes(payload), - status=self.response_status - ) - api_response = self.api.post( - accept_content_types=(accept_content_type,) - ) - self.assert_pool_manager_request_called_with( - mock_request, - self.api_config.get_server_url('servers', None) + "/responseBody/postOneofResponseBodyForContentTypes", - method='post'.upper(), - accept_content_type=accept_content_type, - ) - - assert isinstance(api_response.response, urllib3.HTTPResponse) - assert isinstance(api_response.body, self.response_body_schema) - deserialized_response_body = self.response_body_schema.from_openapi_data_( - payload, - configuration_=self.schema_config - ) - assert api_response.body == deserialized_response_body - - def test_neither_oneof_valid_fails(self): - # neither oneOf valid - accept_content_type = 'application/json' - - with patch.object(urllib3.PoolManager, 'request') as mock_request: - payload = ( - 1.5 - ) - mock_request.return_value = self.response( - self.json_bytes(payload), - status=self.response_status - ) - with self.assertRaises((unit_test_api.ApiValueError, unit_test_api.ApiTypeError)): - self.api.post( - accept_content_types=(accept_content_type,) - ) - self.assert_pool_manager_request_called_with( - mock_request, - self.api_config.get_server_url('servers', None) + "/responseBody/postOneofResponseBodyForContentTypes", - method='post'.upper(), - content_type=None, - accept_content_type=accept_content_type, - ) - -if __name__ == '__main__': - unittest.main() diff --git a/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_response_body_post_oneof_with_base_schema_response_body_for_content_types/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_response_body_post_oneof_with_base_schema_response_body_for_content_types/__init__.py index 60fc05b80df..e69de29bb2d 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_response_body_post_oneof_with_base_schema_response_body_for_content_types/__init__.py +++ b/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_response_body_post_oneof_with_base_schema_response_body_for_content_types/__init__.py @@ -1,113 +0,0 @@ -# coding: utf-8 - -""" - - - Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator -""" - -import unittest -from unittest.mock import patch - -import urllib3 - -import unit_test_api -from unit_test_api.paths.response_body_post_oneof_with_base_schema_response_body_for_content_types.post import operation as post # noqa: E501 -from unit_test_api import schemas, api_client -from unit_test_api.configurations import api_configuration, schema_configuration - -from .. import ApiTestMixin - - -class TestPost(ApiTestMixin, unittest.TestCase): - """ - Post unit test stubs - """ - api_config = api_configuration.ApiConfiguration() - schema_config = schema_configuration.SchemaConfiguration() - used_api_client = api_client.ApiClient(configuration=api_config, schema_config=schema_config) - api = post.ApiForPost(api_client=used_api_client) # noqa: E501 - - response_status = 200 - response_body_schema = post.response_200.ResponseFor200.content["application/json"].schema - - def test_both_oneof_valid_fails(self): - # both oneOf valid - accept_content_type = 'application/json' - - with patch.object(urllib3.PoolManager, 'request') as mock_request: - payload = ( - "foo" - ) - mock_request.return_value = self.response( - self.json_bytes(payload), - status=self.response_status - ) - with self.assertRaises((unit_test_api.ApiValueError, unit_test_api.ApiTypeError)): - self.api.post( - accept_content_types=(accept_content_type,) - ) - self.assert_pool_manager_request_called_with( - mock_request, - self.api_config.get_server_url('servers', None) + "/responseBody/postOneofWithBaseSchemaResponseBodyForContentTypes", - method='post'.upper(), - content_type=None, - accept_content_type=accept_content_type, - ) - - def test_mismatch_base_schema_fails(self): - # mismatch base schema - accept_content_type = 'application/json' - - with patch.object(urllib3.PoolManager, 'request') as mock_request: - payload = ( - 3 - ) - mock_request.return_value = self.response( - self.json_bytes(payload), - status=self.response_status - ) - with self.assertRaises((unit_test_api.ApiValueError, unit_test_api.ApiTypeError)): - self.api.post( - accept_content_types=(accept_content_type,) - ) - self.assert_pool_manager_request_called_with( - mock_request, - self.api_config.get_server_url('servers', None) + "/responseBody/postOneofWithBaseSchemaResponseBodyForContentTypes", - method='post'.upper(), - content_type=None, - accept_content_type=accept_content_type, - ) - - def test_one_oneof_valid_passes(self): - # one oneOf valid - accept_content_type = 'application/json' - - with patch.object(urllib3.PoolManager, 'request') as mock_request: - payload = ( - "foobar" - ) - mock_request.return_value = self.response( - self.json_bytes(payload), - status=self.response_status - ) - api_response = self.api.post( - accept_content_types=(accept_content_type,) - ) - self.assert_pool_manager_request_called_with( - mock_request, - self.api_config.get_server_url('servers', None) + "/responseBody/postOneofWithBaseSchemaResponseBodyForContentTypes", - method='post'.upper(), - accept_content_type=accept_content_type, - ) - - assert isinstance(api_response.response, urllib3.HTTPResponse) - assert isinstance(api_response.body, self.response_body_schema) - deserialized_response_body = self.response_body_schema.from_openapi_data_( - payload, - configuration_=self.schema_config - ) - assert api_response.body == deserialized_response_body - -if __name__ == '__main__': - unittest.main() diff --git a/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_response_body_post_oneof_with_empty_schema_response_body_for_content_types/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_response_body_post_oneof_with_empty_schema_response_body_for_content_types/__init__.py index e59ba02e6d0..e69de29bb2d 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_response_body_post_oneof_with_empty_schema_response_body_for_content_types/__init__.py +++ b/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_response_body_post_oneof_with_empty_schema_response_body_for_content_types/__init__.py @@ -1,89 +0,0 @@ -# coding: utf-8 - -""" - - - Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator -""" - -import unittest -from unittest.mock import patch - -import urllib3 - -import unit_test_api -from unit_test_api.paths.response_body_post_oneof_with_empty_schema_response_body_for_content_types.post import operation as post # noqa: E501 -from unit_test_api import schemas, api_client -from unit_test_api.configurations import api_configuration, schema_configuration - -from .. import ApiTestMixin - - -class TestPost(ApiTestMixin, unittest.TestCase): - """ - Post unit test stubs - """ - api_config = api_configuration.ApiConfiguration() - schema_config = schema_configuration.SchemaConfiguration() - used_api_client = api_client.ApiClient(configuration=api_config, schema_config=schema_config) - api = post.ApiForPost(api_client=used_api_client) # noqa: E501 - - response_status = 200 - response_body_schema = post.response_200.ResponseFor200.content["application/json"].schema - - def test_both_valid_invalid_fails(self): - # both valid - invalid - accept_content_type = 'application/json' - - with patch.object(urllib3.PoolManager, 'request') as mock_request: - payload = ( - 123 - ) - mock_request.return_value = self.response( - self.json_bytes(payload), - status=self.response_status - ) - with self.assertRaises((unit_test_api.ApiValueError, unit_test_api.ApiTypeError)): - self.api.post( - accept_content_types=(accept_content_type,) - ) - self.assert_pool_manager_request_called_with( - mock_request, - self.api_config.get_server_url('servers', None) + "/responseBody/postOneofWithEmptySchemaResponseBodyForContentTypes", - method='post'.upper(), - content_type=None, - accept_content_type=accept_content_type, - ) - - def test_one_valid_valid_passes(self): - # one valid - valid - accept_content_type = 'application/json' - - with patch.object(urllib3.PoolManager, 'request') as mock_request: - payload = ( - "foo" - ) - mock_request.return_value = self.response( - self.json_bytes(payload), - status=self.response_status - ) - api_response = self.api.post( - accept_content_types=(accept_content_type,) - ) - self.assert_pool_manager_request_called_with( - mock_request, - self.api_config.get_server_url('servers', None) + "/responseBody/postOneofWithEmptySchemaResponseBodyForContentTypes", - method='post'.upper(), - accept_content_type=accept_content_type, - ) - - assert isinstance(api_response.response, urllib3.HTTPResponse) - assert isinstance(api_response.body, self.response_body_schema) - deserialized_response_body = self.response_body_schema.from_openapi_data_( - payload, - configuration_=self.schema_config - ) - assert api_response.body == deserialized_response_body - -if __name__ == '__main__': - unittest.main() diff --git a/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_response_body_post_oneof_with_required_response_body_for_content_types/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_response_body_post_oneof_with_required_response_body_for_content_types/__init__.py index 354d2c492d1..e69de29bb2d 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_response_body_post_oneof_with_required_response_body_for_content_types/__init__.py +++ b/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_response_body_post_oneof_with_required_response_body_for_content_types/__init__.py @@ -1,163 +0,0 @@ -# coding: utf-8 - -""" - - - Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator -""" - -import unittest -from unittest.mock import patch - -import urllib3 - -import unit_test_api -from unit_test_api.paths.response_body_post_oneof_with_required_response_body_for_content_types.post import operation as post # noqa: E501 -from unit_test_api import schemas, api_client -from unit_test_api.configurations import api_configuration, schema_configuration - -from .. import ApiTestMixin - - -class TestPost(ApiTestMixin, unittest.TestCase): - """ - Post unit test stubs - """ - api_config = api_configuration.ApiConfiguration() - schema_config = schema_configuration.SchemaConfiguration() - used_api_client = api_client.ApiClient(configuration=api_config, schema_config=schema_config) - api = post.ApiForPost(api_client=used_api_client) # noqa: E501 - - response_status = 200 - response_body_schema = post.response_200.ResponseFor200.content["application/json"].schema - - def test_both_valid_invalid_fails(self): - # both valid - invalid - accept_content_type = 'application/json' - - with patch.object(urllib3.PoolManager, 'request') as mock_request: - payload = ( - { - "foo": - 1, - "bar": - 2, - "baz": - 3, - } - ) - mock_request.return_value = self.response( - self.json_bytes(payload), - status=self.response_status - ) - with self.assertRaises((unit_test_api.ApiValueError, unit_test_api.ApiTypeError)): - self.api.post( - accept_content_types=(accept_content_type,) - ) - self.assert_pool_manager_request_called_with( - mock_request, - self.api_config.get_server_url('servers', None) + "/responseBody/postOneofWithRequiredResponseBodyForContentTypes", - method='post'.upper(), - content_type=None, - accept_content_type=accept_content_type, - ) - - def test_both_invalid_invalid_fails(self): - # both invalid - invalid - accept_content_type = 'application/json' - - with patch.object(urllib3.PoolManager, 'request') as mock_request: - payload = ( - { - "bar": - 2, - } - ) - mock_request.return_value = self.response( - self.json_bytes(payload), - status=self.response_status - ) - with self.assertRaises((unit_test_api.ApiValueError, unit_test_api.ApiTypeError)): - self.api.post( - accept_content_types=(accept_content_type,) - ) - self.assert_pool_manager_request_called_with( - mock_request, - self.api_config.get_server_url('servers', None) + "/responseBody/postOneofWithRequiredResponseBodyForContentTypes", - method='post'.upper(), - content_type=None, - accept_content_type=accept_content_type, - ) - - def test_first_valid_valid_passes(self): - # first valid - valid - accept_content_type = 'application/json' - - with patch.object(urllib3.PoolManager, 'request') as mock_request: - payload = ( - { - "foo": - 1, - "bar": - 2, - } - ) - mock_request.return_value = self.response( - self.json_bytes(payload), - status=self.response_status - ) - api_response = self.api.post( - accept_content_types=(accept_content_type,) - ) - self.assert_pool_manager_request_called_with( - mock_request, - self.api_config.get_server_url('servers', None) + "/responseBody/postOneofWithRequiredResponseBodyForContentTypes", - method='post'.upper(), - accept_content_type=accept_content_type, - ) - - assert isinstance(api_response.response, urllib3.HTTPResponse) - assert isinstance(api_response.body, self.response_body_schema) - deserialized_response_body = self.response_body_schema.from_openapi_data_( - payload, - configuration_=self.schema_config - ) - assert api_response.body == deserialized_response_body - - def test_second_valid_valid_passes(self): - # second valid - valid - accept_content_type = 'application/json' - - with patch.object(urllib3.PoolManager, 'request') as mock_request: - payload = ( - { - "foo": - 1, - "baz": - 3, - } - ) - mock_request.return_value = self.response( - self.json_bytes(payload), - status=self.response_status - ) - api_response = self.api.post( - accept_content_types=(accept_content_type,) - ) - self.assert_pool_manager_request_called_with( - mock_request, - self.api_config.get_server_url('servers', None) + "/responseBody/postOneofWithRequiredResponseBodyForContentTypes", - method='post'.upper(), - accept_content_type=accept_content_type, - ) - - assert isinstance(api_response.response, urllib3.HTTPResponse) - assert isinstance(api_response.body, self.response_body_schema) - deserialized_response_body = self.response_body_schema.from_openapi_data_( - payload, - configuration_=self.schema_config - ) - assert api_response.body == deserialized_response_body - -if __name__ == '__main__': - unittest.main() diff --git a/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_response_body_post_pattern_is_not_anchored_response_body_for_content_types/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_response_body_post_pattern_is_not_anchored_response_body_for_content_types/__init__.py index 8ce9ea84df2..e69de29bb2d 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_response_body_post_pattern_is_not_anchored_response_body_for_content_types/__init__.py +++ b/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_response_body_post_pattern_is_not_anchored_response_body_for_content_types/__init__.py @@ -1,65 +0,0 @@ -# coding: utf-8 - -""" - - - Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator -""" - -import unittest -from unittest.mock import patch - -import urllib3 - -import unit_test_api -from unit_test_api.paths.response_body_post_pattern_is_not_anchored_response_body_for_content_types.post import operation as post # noqa: E501 -from unit_test_api import schemas, api_client -from unit_test_api.configurations import api_configuration, schema_configuration - -from .. import ApiTestMixin - - -class TestPost(ApiTestMixin, unittest.TestCase): - """ - Post unit test stubs - """ - api_config = api_configuration.ApiConfiguration() - schema_config = schema_configuration.SchemaConfiguration() - used_api_client = api_client.ApiClient(configuration=api_config, schema_config=schema_config) - api = post.ApiForPost(api_client=used_api_client) # noqa: E501 - - response_status = 200 - response_body_schema = post.response_200.ResponseFor200.content["application/json"].schema - - def test_matches_a_substring_passes(self): - # matches a substring - accept_content_type = 'application/json' - - with patch.object(urllib3.PoolManager, 'request') as mock_request: - payload = ( - "xxaayy" - ) - mock_request.return_value = self.response( - self.json_bytes(payload), - status=self.response_status - ) - api_response = self.api.post( - accept_content_types=(accept_content_type,) - ) - self.assert_pool_manager_request_called_with( - mock_request, - self.api_config.get_server_url('servers', None) + "/responseBody/postPatternIsNotAnchoredResponseBodyForContentTypes", - method='post'.upper(), - accept_content_type=accept_content_type, - ) - - assert isinstance(api_response.response, urllib3.HTTPResponse) - assert isinstance(api_response.body, self.response_body_schema) - deserialized_response_body = self.response_body_schema.from_openapi_data_( - payload, - configuration_=self.schema_config - ) - assert api_response.body == deserialized_response_body - -if __name__ == '__main__': - unittest.main() diff --git a/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_response_body_post_pattern_validation_response_body_for_content_types/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_response_body_post_pattern_validation_response_body_for_content_types/__init__.py index 43fe7905410..e69de29bb2d 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_response_body_post_pattern_validation_response_body_for_content_types/__init__.py +++ b/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_response_body_post_pattern_validation_response_body_for_content_types/__init__.py @@ -1,271 +0,0 @@ -# coding: utf-8 - -""" - - - Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator -""" - -import unittest -from unittest.mock import patch - -import urllib3 - -import unit_test_api -from unit_test_api.paths.response_body_post_pattern_validation_response_body_for_content_types.post import operation as post # noqa: E501 -from unit_test_api import schemas, api_client -from unit_test_api.configurations import api_configuration, schema_configuration - -from .. import ApiTestMixin - - -class TestPost(ApiTestMixin, unittest.TestCase): - """ - Post unit test stubs - """ - api_config = api_configuration.ApiConfiguration() - schema_config = schema_configuration.SchemaConfiguration() - used_api_client = api_client.ApiClient(configuration=api_config, schema_config=schema_config) - api = post.ApiForPost(api_client=used_api_client) # noqa: E501 - - response_status = 200 - response_body_schema = post.response_200.ResponseFor200.content["application/json"].schema - - def test_ignores_arrays_passes(self): - # ignores arrays - accept_content_type = 'application/json' - - with patch.object(urllib3.PoolManager, 'request') as mock_request: - payload = ( - [ - ] - ) - mock_request.return_value = self.response( - self.json_bytes(payload), - status=self.response_status - ) - api_response = self.api.post( - accept_content_types=(accept_content_type,) - ) - self.assert_pool_manager_request_called_with( - mock_request, - self.api_config.get_server_url('servers', None) + "/responseBody/postPatternValidationResponseBodyForContentTypes", - method='post'.upper(), - accept_content_type=accept_content_type, - ) - - assert isinstance(api_response.response, urllib3.HTTPResponse) - assert isinstance(api_response.body, self.response_body_schema) - deserialized_response_body = self.response_body_schema.from_openapi_data_( - payload, - configuration_=self.schema_config - ) - assert api_response.body == deserialized_response_body - - def test_ignores_objects_passes(self): - # ignores objects - accept_content_type = 'application/json' - - with patch.object(urllib3.PoolManager, 'request') as mock_request: - payload = ( - { - } - ) - mock_request.return_value = self.response( - self.json_bytes(payload), - status=self.response_status - ) - api_response = self.api.post( - accept_content_types=(accept_content_type,) - ) - self.assert_pool_manager_request_called_with( - mock_request, - self.api_config.get_server_url('servers', None) + "/responseBody/postPatternValidationResponseBodyForContentTypes", - method='post'.upper(), - accept_content_type=accept_content_type, - ) - - assert isinstance(api_response.response, urllib3.HTTPResponse) - assert isinstance(api_response.body, self.response_body_schema) - deserialized_response_body = self.response_body_schema.from_openapi_data_( - payload, - configuration_=self.schema_config - ) - assert api_response.body == deserialized_response_body - - def test_ignores_null_passes(self): - # ignores null - accept_content_type = 'application/json' - - with patch.object(urllib3.PoolManager, 'request') as mock_request: - payload = ( - None - ) - mock_request.return_value = self.response( - self.json_bytes(payload), - status=self.response_status - ) - api_response = self.api.post( - accept_content_types=(accept_content_type,) - ) - self.assert_pool_manager_request_called_with( - mock_request, - self.api_config.get_server_url('servers', None) + "/responseBody/postPatternValidationResponseBodyForContentTypes", - method='post'.upper(), - accept_content_type=accept_content_type, - ) - - assert isinstance(api_response.response, urllib3.HTTPResponse) - assert isinstance(api_response.body, self.response_body_schema) - deserialized_response_body = self.response_body_schema.from_openapi_data_( - payload, - configuration_=self.schema_config - ) - assert api_response.body == deserialized_response_body - - def test_ignores_floats_passes(self): - # ignores floats - accept_content_type = 'application/json' - - with patch.object(urllib3.PoolManager, 'request') as mock_request: - payload = ( - 1.0 - ) - mock_request.return_value = self.response( - self.json_bytes(payload), - status=self.response_status - ) - api_response = self.api.post( - accept_content_types=(accept_content_type,) - ) - self.assert_pool_manager_request_called_with( - mock_request, - self.api_config.get_server_url('servers', None) + "/responseBody/postPatternValidationResponseBodyForContentTypes", - method='post'.upper(), - accept_content_type=accept_content_type, - ) - - assert isinstance(api_response.response, urllib3.HTTPResponse) - assert isinstance(api_response.body, self.response_body_schema) - deserialized_response_body = self.response_body_schema.from_openapi_data_( - payload, - configuration_=self.schema_config - ) - assert api_response.body == deserialized_response_body - - def test_a_non_matching_pattern_is_invalid_fails(self): - # a non-matching pattern is invalid - accept_content_type = 'application/json' - - with patch.object(urllib3.PoolManager, 'request') as mock_request: - payload = ( - "abc" - ) - mock_request.return_value = self.response( - self.json_bytes(payload), - status=self.response_status - ) - with self.assertRaises((unit_test_api.ApiValueError, unit_test_api.ApiTypeError)): - self.api.post( - accept_content_types=(accept_content_type,) - ) - self.assert_pool_manager_request_called_with( - mock_request, - self.api_config.get_server_url('servers', None) + "/responseBody/postPatternValidationResponseBodyForContentTypes", - method='post'.upper(), - content_type=None, - accept_content_type=accept_content_type, - ) - - def test_ignores_booleans_passes(self): - # ignores booleans - accept_content_type = 'application/json' - - with patch.object(urllib3.PoolManager, 'request') as mock_request: - payload = ( - True - ) - mock_request.return_value = self.response( - self.json_bytes(payload), - status=self.response_status - ) - api_response = self.api.post( - accept_content_types=(accept_content_type,) - ) - self.assert_pool_manager_request_called_with( - mock_request, - self.api_config.get_server_url('servers', None) + "/responseBody/postPatternValidationResponseBodyForContentTypes", - method='post'.upper(), - accept_content_type=accept_content_type, - ) - - assert isinstance(api_response.response, urllib3.HTTPResponse) - assert isinstance(api_response.body, self.response_body_schema) - deserialized_response_body = self.response_body_schema.from_openapi_data_( - payload, - configuration_=self.schema_config - ) - assert api_response.body == deserialized_response_body - - def test_a_matching_pattern_is_valid_passes(self): - # a matching pattern is valid - accept_content_type = 'application/json' - - with patch.object(urllib3.PoolManager, 'request') as mock_request: - payload = ( - "aaa" - ) - mock_request.return_value = self.response( - self.json_bytes(payload), - status=self.response_status - ) - api_response = self.api.post( - accept_content_types=(accept_content_type,) - ) - self.assert_pool_manager_request_called_with( - mock_request, - self.api_config.get_server_url('servers', None) + "/responseBody/postPatternValidationResponseBodyForContentTypes", - method='post'.upper(), - accept_content_type=accept_content_type, - ) - - assert isinstance(api_response.response, urllib3.HTTPResponse) - assert isinstance(api_response.body, self.response_body_schema) - deserialized_response_body = self.response_body_schema.from_openapi_data_( - payload, - configuration_=self.schema_config - ) - assert api_response.body == deserialized_response_body - - def test_ignores_integers_passes(self): - # ignores integers - accept_content_type = 'application/json' - - with patch.object(urllib3.PoolManager, 'request') as mock_request: - payload = ( - 123 - ) - mock_request.return_value = self.response( - self.json_bytes(payload), - status=self.response_status - ) - api_response = self.api.post( - accept_content_types=(accept_content_type,) - ) - self.assert_pool_manager_request_called_with( - mock_request, - self.api_config.get_server_url('servers', None) + "/responseBody/postPatternValidationResponseBodyForContentTypes", - method='post'.upper(), - accept_content_type=accept_content_type, - ) - - assert isinstance(api_response.response, urllib3.HTTPResponse) - assert isinstance(api_response.body, self.response_body_schema) - deserialized_response_body = self.response_body_schema.from_openapi_data_( - payload, - configuration_=self.schema_config - ) - assert api_response.body == deserialized_response_body - -if __name__ == '__main__': - unittest.main() diff --git a/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_response_body_post_properties_with_escaped_characters_response_body_for_content_types/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_response_body_post_properties_with_escaped_characters_response_body_for_content_types/__init__.py index aa020d43ded..e69de29bb2d 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_response_body_post_properties_with_escaped_characters_response_body_for_content_types/__init__.py +++ b/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_response_body_post_properties_with_escaped_characters_response_body_for_content_types/__init__.py @@ -1,115 +0,0 @@ -# coding: utf-8 - -""" - - - Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator -""" - -import unittest -from unittest.mock import patch - -import urllib3 - -import unit_test_api -from unit_test_api.paths.response_body_post_properties_with_escaped_characters_response_body_for_content_types.post import operation as post # noqa: E501 -from unit_test_api import schemas, api_client -from unit_test_api.configurations import api_configuration, schema_configuration - -from .. import ApiTestMixin - - -class TestPost(ApiTestMixin, unittest.TestCase): - """ - Post unit test stubs - """ - api_config = api_configuration.ApiConfiguration() - schema_config = schema_configuration.SchemaConfiguration() - used_api_client = api_client.ApiClient(configuration=api_config, schema_config=schema_config) - api = post.ApiForPost(api_client=used_api_client) # noqa: E501 - - response_status = 200 - response_body_schema = post.response_200.ResponseFor200.content["application/json"].schema - - def test_object_with_all_numbers_is_valid_passes(self): - # object with all numbers is valid - accept_content_type = 'application/json' - - with patch.object(urllib3.PoolManager, 'request') as mock_request: - payload = ( - { - "foo\nbar": - 1, - "foo\"bar": - 1, - "foo\\bar": - 1, - "foo\rbar": - 1, - "foo\tbar": - 1, - "foo\fbar": - 1, - } - ) - mock_request.return_value = self.response( - self.json_bytes(payload), - status=self.response_status - ) - api_response = self.api.post( - accept_content_types=(accept_content_type,) - ) - self.assert_pool_manager_request_called_with( - mock_request, - self.api_config.get_server_url('servers', None) + "/responseBody/postPropertiesWithEscapedCharactersResponseBodyForContentTypes", - method='post'.upper(), - accept_content_type=accept_content_type, - ) - - assert isinstance(api_response.response, urllib3.HTTPResponse) - assert isinstance(api_response.body, self.response_body_schema) - deserialized_response_body = self.response_body_schema.from_openapi_data_( - payload, - configuration_=self.schema_config - ) - assert api_response.body == deserialized_response_body - - def test_object_with_strings_is_invalid_fails(self): - # object with strings is invalid - accept_content_type = 'application/json' - - with patch.object(urllib3.PoolManager, 'request') as mock_request: - payload = ( - { - "foo\nbar": - "1", - "foo\"bar": - "1", - "foo\\bar": - "1", - "foo\rbar": - "1", - "foo\tbar": - "1", - "foo\fbar": - "1", - } - ) - mock_request.return_value = self.response( - self.json_bytes(payload), - status=self.response_status - ) - with self.assertRaises((unit_test_api.ApiValueError, unit_test_api.ApiTypeError)): - self.api.post( - accept_content_types=(accept_content_type,) - ) - self.assert_pool_manager_request_called_with( - mock_request, - self.api_config.get_server_url('servers', None) + "/responseBody/postPropertiesWithEscapedCharactersResponseBodyForContentTypes", - method='post'.upper(), - content_type=None, - accept_content_type=accept_content_type, - ) - -if __name__ == '__main__': - unittest.main() diff --git a/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_response_body_post_property_named_ref_that_is_not_a_reference_response_body_for_content_types/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_response_body_post_property_named_ref_that_is_not_a_reference_response_body_for_content_types/__init__.py index 11ce980d67a..e69de29bb2d 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_response_body_post_property_named_ref_that_is_not_a_reference_response_body_for_content_types/__init__.py +++ b/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_response_body_post_property_named_ref_that_is_not_a_reference_response_body_for_content_types/__init__.py @@ -1,95 +0,0 @@ -# coding: utf-8 - -""" - - - Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator -""" - -import unittest -from unittest.mock import patch - -import urllib3 - -import unit_test_api -from unit_test_api.paths.response_body_post_property_named_ref_that_is_not_a_reference_response_body_for_content_types.post import operation as post # noqa: E501 -from unit_test_api import schemas, api_client -from unit_test_api.configurations import api_configuration, schema_configuration - -from .. import ApiTestMixin - - -class TestPost(ApiTestMixin, unittest.TestCase): - """ - Post unit test stubs - """ - api_config = api_configuration.ApiConfiguration() - schema_config = schema_configuration.SchemaConfiguration() - used_api_client = api_client.ApiClient(configuration=api_config, schema_config=schema_config) - api = post.ApiForPost(api_client=used_api_client) # noqa: E501 - - response_status = 200 - response_body_schema = post.response_200.ResponseFor200.content["application/json"].schema - - def test_property_named_ref_valid_passes(self): - # property named $ref valid - accept_content_type = 'application/json' - - with patch.object(urllib3.PoolManager, 'request') as mock_request: - payload = ( - { - "$ref": - "a", - } - ) - mock_request.return_value = self.response( - self.json_bytes(payload), - status=self.response_status - ) - api_response = self.api.post( - accept_content_types=(accept_content_type,) - ) - self.assert_pool_manager_request_called_with( - mock_request, - self.api_config.get_server_url('servers', None) + "/responseBody/postPropertyNamedRefThatIsNotAReferenceResponseBodyForContentTypes", - method='post'.upper(), - accept_content_type=accept_content_type, - ) - - assert isinstance(api_response.response, urllib3.HTTPResponse) - assert isinstance(api_response.body, self.response_body_schema) - deserialized_response_body = self.response_body_schema.from_openapi_data_( - payload, - configuration_=self.schema_config - ) - assert api_response.body == deserialized_response_body - - def test_property_named_ref_invalid_fails(self): - # property named $ref invalid - accept_content_type = 'application/json' - - with patch.object(urllib3.PoolManager, 'request') as mock_request: - payload = ( - { - "$ref": - 2, - } - ) - mock_request.return_value = self.response( - self.json_bytes(payload), - status=self.response_status - ) - with self.assertRaises((unit_test_api.ApiValueError, unit_test_api.ApiTypeError)): - self.api.post( - accept_content_types=(accept_content_type,) - ) - self.assert_pool_manager_request_called_with( - mock_request, - self.api_config.get_server_url('servers', None) + "/responseBody/postPropertyNamedRefThatIsNotAReferenceResponseBodyForContentTypes", - method='post'.upper(), - content_type=None, - accept_content_type=accept_content_type, - ) - -if __name__ == '__main__': - unittest.main() diff --git a/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_response_body_post_ref_in_additionalproperties_response_body_for_content_types/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_response_body_post_ref_in_additionalproperties_response_body_for_content_types/__init__.py index 878ea1e65a0..e69de29bb2d 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_response_body_post_ref_in_additionalproperties_response_body_for_content_types/__init__.py +++ b/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_response_body_post_ref_in_additionalproperties_response_body_for_content_types/__init__.py @@ -1,101 +0,0 @@ -# coding: utf-8 - -""" - - - Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator -""" - -import unittest -from unittest.mock import patch - -import urllib3 - -import unit_test_api -from unit_test_api.paths.response_body_post_ref_in_additionalproperties_response_body_for_content_types.post import operation as post # noqa: E501 -from unit_test_api import schemas, api_client -from unit_test_api.configurations import api_configuration, schema_configuration - -from .. import ApiTestMixin - - -class TestPost(ApiTestMixin, unittest.TestCase): - """ - Post unit test stubs - """ - api_config = api_configuration.ApiConfiguration() - schema_config = schema_configuration.SchemaConfiguration() - used_api_client = api_client.ApiClient(configuration=api_config, schema_config=schema_config) - api = post.ApiForPost(api_client=used_api_client) # noqa: E501 - - response_status = 200 - response_body_schema = post.response_200.ResponseFor200.content["application/json"].schema - - def test_property_named_ref_valid_passes(self): - # property named $ref valid - accept_content_type = 'application/json' - - with patch.object(urllib3.PoolManager, 'request') as mock_request: - payload = ( - { - "someProp": - { - "$ref": - "a", - }, - } - ) - mock_request.return_value = self.response( - self.json_bytes(payload), - status=self.response_status - ) - api_response = self.api.post( - accept_content_types=(accept_content_type,) - ) - self.assert_pool_manager_request_called_with( - mock_request, - self.api_config.get_server_url('servers', None) + "/responseBody/postRefInAdditionalpropertiesResponseBodyForContentTypes", - method='post'.upper(), - accept_content_type=accept_content_type, - ) - - assert isinstance(api_response.response, urllib3.HTTPResponse) - assert isinstance(api_response.body, self.response_body_schema) - deserialized_response_body = self.response_body_schema.from_openapi_data_( - payload, - configuration_=self.schema_config - ) - assert api_response.body == deserialized_response_body - - def test_property_named_ref_invalid_fails(self): - # property named $ref invalid - accept_content_type = 'application/json' - - with patch.object(urllib3.PoolManager, 'request') as mock_request: - payload = ( - { - "someProp": - { - "$ref": - 2, - }, - } - ) - mock_request.return_value = self.response( - self.json_bytes(payload), - status=self.response_status - ) - with self.assertRaises((unit_test_api.ApiValueError, unit_test_api.ApiTypeError)): - self.api.post( - accept_content_types=(accept_content_type,) - ) - self.assert_pool_manager_request_called_with( - mock_request, - self.api_config.get_server_url('servers', None) + "/responseBody/postRefInAdditionalpropertiesResponseBodyForContentTypes", - method='post'.upper(), - content_type=None, - accept_content_type=accept_content_type, - ) - -if __name__ == '__main__': - unittest.main() diff --git a/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_response_body_post_ref_in_allof_response_body_for_content_types/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_response_body_post_ref_in_allof_response_body_for_content_types/__init__.py index 1adc6140e0e..e69de29bb2d 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_response_body_post_ref_in_allof_response_body_for_content_types/__init__.py +++ b/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_response_body_post_ref_in_allof_response_body_for_content_types/__init__.py @@ -1,95 +0,0 @@ -# coding: utf-8 - -""" - - - Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator -""" - -import unittest -from unittest.mock import patch - -import urllib3 - -import unit_test_api -from unit_test_api.paths.response_body_post_ref_in_allof_response_body_for_content_types.post import operation as post # noqa: E501 -from unit_test_api import schemas, api_client -from unit_test_api.configurations import api_configuration, schema_configuration - -from .. import ApiTestMixin - - -class TestPost(ApiTestMixin, unittest.TestCase): - """ - Post unit test stubs - """ - api_config = api_configuration.ApiConfiguration() - schema_config = schema_configuration.SchemaConfiguration() - used_api_client = api_client.ApiClient(configuration=api_config, schema_config=schema_config) - api = post.ApiForPost(api_client=used_api_client) # noqa: E501 - - response_status = 200 - response_body_schema = post.response_200.ResponseFor200.content["application/json"].schema - - def test_property_named_ref_valid_passes(self): - # property named $ref valid - accept_content_type = 'application/json' - - with patch.object(urllib3.PoolManager, 'request') as mock_request: - payload = ( - { - "$ref": - "a", - } - ) - mock_request.return_value = self.response( - self.json_bytes(payload), - status=self.response_status - ) - api_response = self.api.post( - accept_content_types=(accept_content_type,) - ) - self.assert_pool_manager_request_called_with( - mock_request, - self.api_config.get_server_url('servers', None) + "/responseBody/postRefInAllofResponseBodyForContentTypes", - method='post'.upper(), - accept_content_type=accept_content_type, - ) - - assert isinstance(api_response.response, urllib3.HTTPResponse) - assert isinstance(api_response.body, self.response_body_schema) - deserialized_response_body = self.response_body_schema.from_openapi_data_( - payload, - configuration_=self.schema_config - ) - assert api_response.body == deserialized_response_body - - def test_property_named_ref_invalid_fails(self): - # property named $ref invalid - accept_content_type = 'application/json' - - with patch.object(urllib3.PoolManager, 'request') as mock_request: - payload = ( - { - "$ref": - 2, - } - ) - mock_request.return_value = self.response( - self.json_bytes(payload), - status=self.response_status - ) - with self.assertRaises((unit_test_api.ApiValueError, unit_test_api.ApiTypeError)): - self.api.post( - accept_content_types=(accept_content_type,) - ) - self.assert_pool_manager_request_called_with( - mock_request, - self.api_config.get_server_url('servers', None) + "/responseBody/postRefInAllofResponseBodyForContentTypes", - method='post'.upper(), - content_type=None, - accept_content_type=accept_content_type, - ) - -if __name__ == '__main__': - unittest.main() diff --git a/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_response_body_post_ref_in_anyof_response_body_for_content_types/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_response_body_post_ref_in_anyof_response_body_for_content_types/__init__.py index 7a75c9946e5..e69de29bb2d 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_response_body_post_ref_in_anyof_response_body_for_content_types/__init__.py +++ b/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_response_body_post_ref_in_anyof_response_body_for_content_types/__init__.py @@ -1,95 +0,0 @@ -# coding: utf-8 - -""" - - - Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator -""" - -import unittest -from unittest.mock import patch - -import urllib3 - -import unit_test_api -from unit_test_api.paths.response_body_post_ref_in_anyof_response_body_for_content_types.post import operation as post # noqa: E501 -from unit_test_api import schemas, api_client -from unit_test_api.configurations import api_configuration, schema_configuration - -from .. import ApiTestMixin - - -class TestPost(ApiTestMixin, unittest.TestCase): - """ - Post unit test stubs - """ - api_config = api_configuration.ApiConfiguration() - schema_config = schema_configuration.SchemaConfiguration() - used_api_client = api_client.ApiClient(configuration=api_config, schema_config=schema_config) - api = post.ApiForPost(api_client=used_api_client) # noqa: E501 - - response_status = 200 - response_body_schema = post.response_200.ResponseFor200.content["application/json"].schema - - def test_property_named_ref_valid_passes(self): - # property named $ref valid - accept_content_type = 'application/json' - - with patch.object(urllib3.PoolManager, 'request') as mock_request: - payload = ( - { - "$ref": - "a", - } - ) - mock_request.return_value = self.response( - self.json_bytes(payload), - status=self.response_status - ) - api_response = self.api.post( - accept_content_types=(accept_content_type,) - ) - self.assert_pool_manager_request_called_with( - mock_request, - self.api_config.get_server_url('servers', None) + "/responseBody/postRefInAnyofResponseBodyForContentTypes", - method='post'.upper(), - accept_content_type=accept_content_type, - ) - - assert isinstance(api_response.response, urllib3.HTTPResponse) - assert isinstance(api_response.body, self.response_body_schema) - deserialized_response_body = self.response_body_schema.from_openapi_data_( - payload, - configuration_=self.schema_config - ) - assert api_response.body == deserialized_response_body - - def test_property_named_ref_invalid_fails(self): - # property named $ref invalid - accept_content_type = 'application/json' - - with patch.object(urllib3.PoolManager, 'request') as mock_request: - payload = ( - { - "$ref": - 2, - } - ) - mock_request.return_value = self.response( - self.json_bytes(payload), - status=self.response_status - ) - with self.assertRaises((unit_test_api.ApiValueError, unit_test_api.ApiTypeError)): - self.api.post( - accept_content_types=(accept_content_type,) - ) - self.assert_pool_manager_request_called_with( - mock_request, - self.api_config.get_server_url('servers', None) + "/responseBody/postRefInAnyofResponseBodyForContentTypes", - method='post'.upper(), - content_type=None, - accept_content_type=accept_content_type, - ) - -if __name__ == '__main__': - unittest.main() diff --git a/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_response_body_post_ref_in_items_response_body_for_content_types/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_response_body_post_ref_in_items_response_body_for_content_types/__init__.py index 4ce887b09ce..e69de29bb2d 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_response_body_post_ref_in_items_response_body_for_content_types/__init__.py +++ b/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_response_body_post_ref_in_items_response_body_for_content_types/__init__.py @@ -1,99 +0,0 @@ -# coding: utf-8 - -""" - - - Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator -""" - -import unittest -from unittest.mock import patch - -import urllib3 - -import unit_test_api -from unit_test_api.paths.response_body_post_ref_in_items_response_body_for_content_types.post import operation as post # noqa: E501 -from unit_test_api import schemas, api_client -from unit_test_api.configurations import api_configuration, schema_configuration - -from .. import ApiTestMixin - - -class TestPost(ApiTestMixin, unittest.TestCase): - """ - Post unit test stubs - """ - api_config = api_configuration.ApiConfiguration() - schema_config = schema_configuration.SchemaConfiguration() - used_api_client = api_client.ApiClient(configuration=api_config, schema_config=schema_config) - api = post.ApiForPost(api_client=used_api_client) # noqa: E501 - - response_status = 200 - response_body_schema = post.response_200.ResponseFor200.content["application/json"].schema - - def test_property_named_ref_valid_passes(self): - # property named $ref valid - accept_content_type = 'application/json' - - with patch.object(urllib3.PoolManager, 'request') as mock_request: - payload = ( - [ - { - "$ref": - "a", - }, - ] - ) - mock_request.return_value = self.response( - self.json_bytes(payload), - status=self.response_status - ) - api_response = self.api.post( - accept_content_types=(accept_content_type,) - ) - self.assert_pool_manager_request_called_with( - mock_request, - self.api_config.get_server_url('servers', None) + "/responseBody/postRefInItemsResponseBodyForContentTypes", - method='post'.upper(), - accept_content_type=accept_content_type, - ) - - assert isinstance(api_response.response, urllib3.HTTPResponse) - assert isinstance(api_response.body, self.response_body_schema) - deserialized_response_body = self.response_body_schema.from_openapi_data_( - payload, - configuration_=self.schema_config - ) - assert api_response.body == deserialized_response_body - - def test_property_named_ref_invalid_fails(self): - # property named $ref invalid - accept_content_type = 'application/json' - - with patch.object(urllib3.PoolManager, 'request') as mock_request: - payload = ( - [ - { - "$ref": - 2, - }, - ] - ) - mock_request.return_value = self.response( - self.json_bytes(payload), - status=self.response_status - ) - with self.assertRaises((unit_test_api.ApiValueError, unit_test_api.ApiTypeError)): - self.api.post( - accept_content_types=(accept_content_type,) - ) - self.assert_pool_manager_request_called_with( - mock_request, - self.api_config.get_server_url('servers', None) + "/responseBody/postRefInItemsResponseBodyForContentTypes", - method='post'.upper(), - content_type=None, - accept_content_type=accept_content_type, - ) - -if __name__ == '__main__': - unittest.main() diff --git a/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_response_body_post_ref_in_not_response_body_for_content_types/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_response_body_post_ref_in_not_response_body_for_content_types/__init__.py index 72874549959..e69de29bb2d 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_response_body_post_ref_in_not_response_body_for_content_types/__init__.py +++ b/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_response_body_post_ref_in_not_response_body_for_content_types/__init__.py @@ -1,95 +0,0 @@ -# coding: utf-8 - -""" - - - Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator -""" - -import unittest -from unittest.mock import patch - -import urllib3 - -import unit_test_api -from unit_test_api.paths.response_body_post_ref_in_not_response_body_for_content_types.post import operation as post # noqa: E501 -from unit_test_api import schemas, api_client -from unit_test_api.configurations import api_configuration, schema_configuration - -from .. import ApiTestMixin - - -class TestPost(ApiTestMixin, unittest.TestCase): - """ - Post unit test stubs - """ - api_config = api_configuration.ApiConfiguration() - schema_config = schema_configuration.SchemaConfiguration() - used_api_client = api_client.ApiClient(configuration=api_config, schema_config=schema_config) - api = post.ApiForPost(api_client=used_api_client) # noqa: E501 - - response_status = 200 - response_body_schema = post.response_200.ResponseFor200.content["application/json"].schema - - def test_property_named_ref_valid_passes(self): - # property named $ref valid - accept_content_type = 'application/json' - - with patch.object(urllib3.PoolManager, 'request') as mock_request: - payload = ( - { - "$ref": - 2, - } - ) - mock_request.return_value = self.response( - self.json_bytes(payload), - status=self.response_status - ) - api_response = self.api.post( - accept_content_types=(accept_content_type,) - ) - self.assert_pool_manager_request_called_with( - mock_request, - self.api_config.get_server_url('servers', None) + "/responseBody/postRefInNotResponseBodyForContentTypes", - method='post'.upper(), - accept_content_type=accept_content_type, - ) - - assert isinstance(api_response.response, urllib3.HTTPResponse) - assert isinstance(api_response.body, self.response_body_schema) - deserialized_response_body = self.response_body_schema.from_openapi_data_( - payload, - configuration_=self.schema_config - ) - assert api_response.body == deserialized_response_body - - def test_property_named_ref_invalid_fails(self): - # property named $ref invalid - accept_content_type = 'application/json' - - with patch.object(urllib3.PoolManager, 'request') as mock_request: - payload = ( - { - "$ref": - "a", - } - ) - mock_request.return_value = self.response( - self.json_bytes(payload), - status=self.response_status - ) - with self.assertRaises((unit_test_api.ApiValueError, unit_test_api.ApiTypeError)): - self.api.post( - accept_content_types=(accept_content_type,) - ) - self.assert_pool_manager_request_called_with( - mock_request, - self.api_config.get_server_url('servers', None) + "/responseBody/postRefInNotResponseBodyForContentTypes", - method='post'.upper(), - content_type=None, - accept_content_type=accept_content_type, - ) - -if __name__ == '__main__': - unittest.main() diff --git a/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_response_body_post_ref_in_oneof_response_body_for_content_types/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_response_body_post_ref_in_oneof_response_body_for_content_types/__init__.py index 93b4b1f8be7..e69de29bb2d 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_response_body_post_ref_in_oneof_response_body_for_content_types/__init__.py +++ b/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_response_body_post_ref_in_oneof_response_body_for_content_types/__init__.py @@ -1,95 +0,0 @@ -# coding: utf-8 - -""" - - - Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator -""" - -import unittest -from unittest.mock import patch - -import urllib3 - -import unit_test_api -from unit_test_api.paths.response_body_post_ref_in_oneof_response_body_for_content_types.post import operation as post # noqa: E501 -from unit_test_api import schemas, api_client -from unit_test_api.configurations import api_configuration, schema_configuration - -from .. import ApiTestMixin - - -class TestPost(ApiTestMixin, unittest.TestCase): - """ - Post unit test stubs - """ - api_config = api_configuration.ApiConfiguration() - schema_config = schema_configuration.SchemaConfiguration() - used_api_client = api_client.ApiClient(configuration=api_config, schema_config=schema_config) - api = post.ApiForPost(api_client=used_api_client) # noqa: E501 - - response_status = 200 - response_body_schema = post.response_200.ResponseFor200.content["application/json"].schema - - def test_property_named_ref_valid_passes(self): - # property named $ref valid - accept_content_type = 'application/json' - - with patch.object(urllib3.PoolManager, 'request') as mock_request: - payload = ( - { - "$ref": - "a", - } - ) - mock_request.return_value = self.response( - self.json_bytes(payload), - status=self.response_status - ) - api_response = self.api.post( - accept_content_types=(accept_content_type,) - ) - self.assert_pool_manager_request_called_with( - mock_request, - self.api_config.get_server_url('servers', None) + "/responseBody/postRefInOneofResponseBodyForContentTypes", - method='post'.upper(), - accept_content_type=accept_content_type, - ) - - assert isinstance(api_response.response, urllib3.HTTPResponse) - assert isinstance(api_response.body, self.response_body_schema) - deserialized_response_body = self.response_body_schema.from_openapi_data_( - payload, - configuration_=self.schema_config - ) - assert api_response.body == deserialized_response_body - - def test_property_named_ref_invalid_fails(self): - # property named $ref invalid - accept_content_type = 'application/json' - - with patch.object(urllib3.PoolManager, 'request') as mock_request: - payload = ( - { - "$ref": - 2, - } - ) - mock_request.return_value = self.response( - self.json_bytes(payload), - status=self.response_status - ) - with self.assertRaises((unit_test_api.ApiValueError, unit_test_api.ApiTypeError)): - self.api.post( - accept_content_types=(accept_content_type,) - ) - self.assert_pool_manager_request_called_with( - mock_request, - self.api_config.get_server_url('servers', None) + "/responseBody/postRefInOneofResponseBodyForContentTypes", - method='post'.upper(), - content_type=None, - accept_content_type=accept_content_type, - ) - -if __name__ == '__main__': - unittest.main() diff --git a/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_response_body_post_ref_in_property_response_body_for_content_types/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_response_body_post_ref_in_property_response_body_for_content_types/__init__.py index f5d7dc98d29..e69de29bb2d 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_response_body_post_ref_in_property_response_body_for_content_types/__init__.py +++ b/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_response_body_post_ref_in_property_response_body_for_content_types/__init__.py @@ -1,101 +0,0 @@ -# coding: utf-8 - -""" - - - Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator -""" - -import unittest -from unittest.mock import patch - -import urllib3 - -import unit_test_api -from unit_test_api.paths.response_body_post_ref_in_property_response_body_for_content_types.post import operation as post # noqa: E501 -from unit_test_api import schemas, api_client -from unit_test_api.configurations import api_configuration, schema_configuration - -from .. import ApiTestMixin - - -class TestPost(ApiTestMixin, unittest.TestCase): - """ - Post unit test stubs - """ - api_config = api_configuration.ApiConfiguration() - schema_config = schema_configuration.SchemaConfiguration() - used_api_client = api_client.ApiClient(configuration=api_config, schema_config=schema_config) - api = post.ApiForPost(api_client=used_api_client) # noqa: E501 - - response_status = 200 - response_body_schema = post.response_200.ResponseFor200.content["application/json"].schema - - def test_property_named_ref_valid_passes(self): - # property named $ref valid - accept_content_type = 'application/json' - - with patch.object(urllib3.PoolManager, 'request') as mock_request: - payload = ( - { - "a": - { - "$ref": - "a", - }, - } - ) - mock_request.return_value = self.response( - self.json_bytes(payload), - status=self.response_status - ) - api_response = self.api.post( - accept_content_types=(accept_content_type,) - ) - self.assert_pool_manager_request_called_with( - mock_request, - self.api_config.get_server_url('servers', None) + "/responseBody/postRefInPropertyResponseBodyForContentTypes", - method='post'.upper(), - accept_content_type=accept_content_type, - ) - - assert isinstance(api_response.response, urllib3.HTTPResponse) - assert isinstance(api_response.body, self.response_body_schema) - deserialized_response_body = self.response_body_schema.from_openapi_data_( - payload, - configuration_=self.schema_config - ) - assert api_response.body == deserialized_response_body - - def test_property_named_ref_invalid_fails(self): - # property named $ref invalid - accept_content_type = 'application/json' - - with patch.object(urllib3.PoolManager, 'request') as mock_request: - payload = ( - { - "a": - { - "$ref": - 2, - }, - } - ) - mock_request.return_value = self.response( - self.json_bytes(payload), - status=self.response_status - ) - with self.assertRaises((unit_test_api.ApiValueError, unit_test_api.ApiTypeError)): - self.api.post( - accept_content_types=(accept_content_type,) - ) - self.assert_pool_manager_request_called_with( - mock_request, - self.api_config.get_server_url('servers', None) + "/responseBody/postRefInPropertyResponseBodyForContentTypes", - method='post'.upper(), - content_type=None, - accept_content_type=accept_content_type, - ) - -if __name__ == '__main__': - unittest.main() diff --git a/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_response_body_post_required_default_validation_response_body_for_content_types/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_response_body_post_required_default_validation_response_body_for_content_types/__init__.py index fcb9a44331a..e69de29bb2d 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_response_body_post_required_default_validation_response_body_for_content_types/__init__.py +++ b/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_response_body_post_required_default_validation_response_body_for_content_types/__init__.py @@ -1,66 +0,0 @@ -# coding: utf-8 - -""" - - - Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator -""" - -import unittest -from unittest.mock import patch - -import urllib3 - -import unit_test_api -from unit_test_api.paths.response_body_post_required_default_validation_response_body_for_content_types.post import operation as post # noqa: E501 -from unit_test_api import schemas, api_client -from unit_test_api.configurations import api_configuration, schema_configuration - -from .. import ApiTestMixin - - -class TestPost(ApiTestMixin, unittest.TestCase): - """ - Post unit test stubs - """ - api_config = api_configuration.ApiConfiguration() - schema_config = schema_configuration.SchemaConfiguration() - used_api_client = api_client.ApiClient(configuration=api_config, schema_config=schema_config) - api = post.ApiForPost(api_client=used_api_client) # noqa: E501 - - response_status = 200 - response_body_schema = post.response_200.ResponseFor200.content["application/json"].schema - - def test_not_required_by_default_passes(self): - # not required by default - accept_content_type = 'application/json' - - with patch.object(urllib3.PoolManager, 'request') as mock_request: - payload = ( - { - } - ) - mock_request.return_value = self.response( - self.json_bytes(payload), - status=self.response_status - ) - api_response = self.api.post( - accept_content_types=(accept_content_type,) - ) - self.assert_pool_manager_request_called_with( - mock_request, - self.api_config.get_server_url('servers', None) + "/responseBody/postRequiredDefaultValidationResponseBodyForContentTypes", - method='post'.upper(), - accept_content_type=accept_content_type, - ) - - assert isinstance(api_response.response, urllib3.HTTPResponse) - assert isinstance(api_response.body, self.response_body_schema) - deserialized_response_body = self.response_body_schema.from_openapi_data_( - payload, - configuration_=self.schema_config - ) - assert api_response.body == deserialized_response_body - -if __name__ == '__main__': - unittest.main() diff --git a/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_response_body_post_required_validation_response_body_for_content_types/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_response_body_post_required_validation_response_body_for_content_types/__init__.py index 26cbb06e838..e69de29bb2d 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_response_body_post_required_validation_response_body_for_content_types/__init__.py +++ b/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_response_body_post_required_validation_response_body_for_content_types/__init__.py @@ -1,186 +0,0 @@ -# coding: utf-8 - -""" - - - Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator -""" - -import unittest -from unittest.mock import patch - -import urllib3 - -import unit_test_api -from unit_test_api.paths.response_body_post_required_validation_response_body_for_content_types.post import operation as post # noqa: E501 -from unit_test_api import schemas, api_client -from unit_test_api.configurations import api_configuration, schema_configuration - -from .. import ApiTestMixin - - -class TestPost(ApiTestMixin, unittest.TestCase): - """ - Post unit test stubs - """ - api_config = api_configuration.ApiConfiguration() - schema_config = schema_configuration.SchemaConfiguration() - used_api_client = api_client.ApiClient(configuration=api_config, schema_config=schema_config) - api = post.ApiForPost(api_client=used_api_client) # noqa: E501 - - response_status = 200 - response_body_schema = post.response_200.ResponseFor200.content["application/json"].schema - - def test_ignores_arrays_passes(self): - # ignores arrays - accept_content_type = 'application/json' - - with patch.object(urllib3.PoolManager, 'request') as mock_request: - payload = ( - [ - ] - ) - mock_request.return_value = self.response( - self.json_bytes(payload), - status=self.response_status - ) - api_response = self.api.post( - accept_content_types=(accept_content_type,) - ) - self.assert_pool_manager_request_called_with( - mock_request, - self.api_config.get_server_url('servers', None) + "/responseBody/postRequiredValidationResponseBodyForContentTypes", - method='post'.upper(), - accept_content_type=accept_content_type, - ) - - assert isinstance(api_response.response, urllib3.HTTPResponse) - assert isinstance(api_response.body, self.response_body_schema) - deserialized_response_body = self.response_body_schema.from_openapi_data_( - payload, - configuration_=self.schema_config - ) - assert api_response.body == deserialized_response_body - - def test_present_required_property_is_valid_passes(self): - # present required property is valid - accept_content_type = 'application/json' - - with patch.object(urllib3.PoolManager, 'request') as mock_request: - payload = ( - { - "foo": - 1, - } - ) - mock_request.return_value = self.response( - self.json_bytes(payload), - status=self.response_status - ) - api_response = self.api.post( - accept_content_types=(accept_content_type,) - ) - self.assert_pool_manager_request_called_with( - mock_request, - self.api_config.get_server_url('servers', None) + "/responseBody/postRequiredValidationResponseBodyForContentTypes", - method='post'.upper(), - accept_content_type=accept_content_type, - ) - - assert isinstance(api_response.response, urllib3.HTTPResponse) - assert isinstance(api_response.body, self.response_body_schema) - deserialized_response_body = self.response_body_schema.from_openapi_data_( - payload, - configuration_=self.schema_config - ) - assert api_response.body == deserialized_response_body - - def test_ignores_other_non_objects_passes(self): - # ignores other non-objects - accept_content_type = 'application/json' - - with patch.object(urllib3.PoolManager, 'request') as mock_request: - payload = ( - 12 - ) - mock_request.return_value = self.response( - self.json_bytes(payload), - status=self.response_status - ) - api_response = self.api.post( - accept_content_types=(accept_content_type,) - ) - self.assert_pool_manager_request_called_with( - mock_request, - self.api_config.get_server_url('servers', None) + "/responseBody/postRequiredValidationResponseBodyForContentTypes", - method='post'.upper(), - accept_content_type=accept_content_type, - ) - - assert isinstance(api_response.response, urllib3.HTTPResponse) - assert isinstance(api_response.body, self.response_body_schema) - deserialized_response_body = self.response_body_schema.from_openapi_data_( - payload, - configuration_=self.schema_config - ) - assert api_response.body == deserialized_response_body - - def test_ignores_strings_passes(self): - # ignores strings - accept_content_type = 'application/json' - - with patch.object(urllib3.PoolManager, 'request') as mock_request: - payload = ( - "" - ) - mock_request.return_value = self.response( - self.json_bytes(payload), - status=self.response_status - ) - api_response = self.api.post( - accept_content_types=(accept_content_type,) - ) - self.assert_pool_manager_request_called_with( - mock_request, - self.api_config.get_server_url('servers', None) + "/responseBody/postRequiredValidationResponseBodyForContentTypes", - method='post'.upper(), - accept_content_type=accept_content_type, - ) - - assert isinstance(api_response.response, urllib3.HTTPResponse) - assert isinstance(api_response.body, self.response_body_schema) - deserialized_response_body = self.response_body_schema.from_openapi_data_( - payload, - configuration_=self.schema_config - ) - assert api_response.body == deserialized_response_body - - def test_non_present_required_property_is_invalid_fails(self): - # non-present required property is invalid - accept_content_type = 'application/json' - - with patch.object(urllib3.PoolManager, 'request') as mock_request: - payload = ( - { - "bar": - 1, - } - ) - mock_request.return_value = self.response( - self.json_bytes(payload), - status=self.response_status - ) - with self.assertRaises((unit_test_api.ApiValueError, unit_test_api.ApiTypeError)): - self.api.post( - accept_content_types=(accept_content_type,) - ) - self.assert_pool_manager_request_called_with( - mock_request, - self.api_config.get_server_url('servers', None) + "/responseBody/postRequiredValidationResponseBodyForContentTypes", - method='post'.upper(), - content_type=None, - accept_content_type=accept_content_type, - ) - -if __name__ == '__main__': - unittest.main() diff --git a/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_response_body_post_required_with_empty_array_response_body_for_content_types/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_response_body_post_required_with_empty_array_response_body_for_content_types/__init__.py index 68da0ff98f4..e69de29bb2d 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_response_body_post_required_with_empty_array_response_body_for_content_types/__init__.py +++ b/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_response_body_post_required_with_empty_array_response_body_for_content_types/__init__.py @@ -1,66 +0,0 @@ -# coding: utf-8 - -""" - - - Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator -""" - -import unittest -from unittest.mock import patch - -import urllib3 - -import unit_test_api -from unit_test_api.paths.response_body_post_required_with_empty_array_response_body_for_content_types.post import operation as post # noqa: E501 -from unit_test_api import schemas, api_client -from unit_test_api.configurations import api_configuration, schema_configuration - -from .. import ApiTestMixin - - -class TestPost(ApiTestMixin, unittest.TestCase): - """ - Post unit test stubs - """ - api_config = api_configuration.ApiConfiguration() - schema_config = schema_configuration.SchemaConfiguration() - used_api_client = api_client.ApiClient(configuration=api_config, schema_config=schema_config) - api = post.ApiForPost(api_client=used_api_client) # noqa: E501 - - response_status = 200 - response_body_schema = post.response_200.ResponseFor200.content["application/json"].schema - - def test_property_not_required_passes(self): - # property not required - accept_content_type = 'application/json' - - with patch.object(urllib3.PoolManager, 'request') as mock_request: - payload = ( - { - } - ) - mock_request.return_value = self.response( - self.json_bytes(payload), - status=self.response_status - ) - api_response = self.api.post( - accept_content_types=(accept_content_type,) - ) - self.assert_pool_manager_request_called_with( - mock_request, - self.api_config.get_server_url('servers', None) + "/responseBody/postRequiredWithEmptyArrayResponseBodyForContentTypes", - method='post'.upper(), - accept_content_type=accept_content_type, - ) - - assert isinstance(api_response.response, urllib3.HTTPResponse) - assert isinstance(api_response.body, self.response_body_schema) - deserialized_response_body = self.response_body_schema.from_openapi_data_( - payload, - configuration_=self.schema_config - ) - assert api_response.body == deserialized_response_body - -if __name__ == '__main__': - unittest.main() diff --git a/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_response_body_post_required_with_escaped_characters_response_body_for_content_types/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_response_body_post_required_with_escaped_characters_response_body_for_content_types/__init__.py index 8173a4b80b8..e69de29bb2d 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_response_body_post_required_with_escaped_characters_response_body_for_content_types/__init__.py +++ b/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_response_body_post_required_with_escaped_characters_response_body_for_content_types/__init__.py @@ -1,107 +0,0 @@ -# coding: utf-8 - -""" - - - Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator -""" - -import unittest -from unittest.mock import patch - -import urllib3 - -import unit_test_api -from unit_test_api.paths.response_body_post_required_with_escaped_characters_response_body_for_content_types.post import operation as post # noqa: E501 -from unit_test_api import schemas, api_client -from unit_test_api.configurations import api_configuration, schema_configuration - -from .. import ApiTestMixin - - -class TestPost(ApiTestMixin, unittest.TestCase): - """ - Post unit test stubs - """ - api_config = api_configuration.ApiConfiguration() - schema_config = schema_configuration.SchemaConfiguration() - used_api_client = api_client.ApiClient(configuration=api_config, schema_config=schema_config) - api = post.ApiForPost(api_client=used_api_client) # noqa: E501 - - response_status = 200 - response_body_schema = post.response_200.ResponseFor200.content["application/json"].schema - - def test_object_with_some_properties_missing_is_invalid_fails(self): - # object with some properties missing is invalid - accept_content_type = 'application/json' - - with patch.object(urllib3.PoolManager, 'request') as mock_request: - payload = ( - { - "foo\nbar": - "1", - "foo\"bar": - "1", - } - ) - mock_request.return_value = self.response( - self.json_bytes(payload), - status=self.response_status - ) - with self.assertRaises((unit_test_api.ApiValueError, unit_test_api.ApiTypeError)): - self.api.post( - accept_content_types=(accept_content_type,) - ) - self.assert_pool_manager_request_called_with( - mock_request, - self.api_config.get_server_url('servers', None) + "/responseBody/postRequiredWithEscapedCharactersResponseBodyForContentTypes", - method='post'.upper(), - content_type=None, - accept_content_type=accept_content_type, - ) - - def test_object_with_all_properties_present_is_valid_passes(self): - # object with all properties present is valid - accept_content_type = 'application/json' - - with patch.object(urllib3.PoolManager, 'request') as mock_request: - payload = ( - { - "foo\nbar": - 1, - "foo\"bar": - 1, - "foo\\bar": - 1, - "foo\rbar": - 1, - "foo\tbar": - 1, - "foo\fbar": - 1, - } - ) - mock_request.return_value = self.response( - self.json_bytes(payload), - status=self.response_status - ) - api_response = self.api.post( - accept_content_types=(accept_content_type,) - ) - self.assert_pool_manager_request_called_with( - mock_request, - self.api_config.get_server_url('servers', None) + "/responseBody/postRequiredWithEscapedCharactersResponseBodyForContentTypes", - method='post'.upper(), - accept_content_type=accept_content_type, - ) - - assert isinstance(api_response.response, urllib3.HTTPResponse) - assert isinstance(api_response.body, self.response_body_schema) - deserialized_response_body = self.response_body_schema.from_openapi_data_( - payload, - configuration_=self.schema_config - ) - assert api_response.body == deserialized_response_body - -if __name__ == '__main__': - unittest.main() diff --git a/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_response_body_post_simple_enum_validation_response_body_for_content_types/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_response_body_post_simple_enum_validation_response_body_for_content_types/__init__.py index 12c5809ea08..e69de29bb2d 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_response_body_post_simple_enum_validation_response_body_for_content_types/__init__.py +++ b/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_response_body_post_simple_enum_validation_response_body_for_content_types/__init__.py @@ -1,89 +0,0 @@ -# coding: utf-8 - -""" - - - Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator -""" - -import unittest -from unittest.mock import patch - -import urllib3 - -import unit_test_api -from unit_test_api.paths.response_body_post_simple_enum_validation_response_body_for_content_types.post import operation as post # noqa: E501 -from unit_test_api import schemas, api_client -from unit_test_api.configurations import api_configuration, schema_configuration - -from .. import ApiTestMixin - - -class TestPost(ApiTestMixin, unittest.TestCase): - """ - Post unit test stubs - """ - api_config = api_configuration.ApiConfiguration() - schema_config = schema_configuration.SchemaConfiguration() - used_api_client = api_client.ApiClient(configuration=api_config, schema_config=schema_config) - api = post.ApiForPost(api_client=used_api_client) # noqa: E501 - - response_status = 200 - response_body_schema = post.response_200.ResponseFor200.content["application/json"].schema - - def test_something_else_is_invalid_fails(self): - # something else is invalid - accept_content_type = 'application/json' - - with patch.object(urllib3.PoolManager, 'request') as mock_request: - payload = ( - 4 - ) - mock_request.return_value = self.response( - self.json_bytes(payload), - status=self.response_status - ) - with self.assertRaises((unit_test_api.ApiValueError, unit_test_api.ApiTypeError)): - self.api.post( - accept_content_types=(accept_content_type,) - ) - self.assert_pool_manager_request_called_with( - mock_request, - self.api_config.get_server_url('servers', None) + "/responseBody/postSimpleEnumValidationResponseBodyForContentTypes", - method='post'.upper(), - content_type=None, - accept_content_type=accept_content_type, - ) - - def test_one_of_the_enum_is_valid_passes(self): - # one of the enum is valid - accept_content_type = 'application/json' - - with patch.object(urllib3.PoolManager, 'request') as mock_request: - payload = ( - 1 - ) - mock_request.return_value = self.response( - self.json_bytes(payload), - status=self.response_status - ) - api_response = self.api.post( - accept_content_types=(accept_content_type,) - ) - self.assert_pool_manager_request_called_with( - mock_request, - self.api_config.get_server_url('servers', None) + "/responseBody/postSimpleEnumValidationResponseBodyForContentTypes", - method='post'.upper(), - accept_content_type=accept_content_type, - ) - - assert isinstance(api_response.response, urllib3.HTTPResponse) - assert isinstance(api_response.body, self.response_body_schema) - deserialized_response_body = self.response_body_schema.from_openapi_data_( - payload, - configuration_=self.schema_config - ) - assert api_response.body == deserialized_response_body - -if __name__ == '__main__': - unittest.main() diff --git a/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_response_body_post_string_type_matches_strings_response_body_for_content_types/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_response_body_post_string_type_matches_strings_response_body_for_content_types/__init__.py index 83903a68065..e69de29bb2d 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_response_body_post_string_type_matches_strings_response_body_for_content_types/__init__.py +++ b/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_response_body_post_string_type_matches_strings_response_body_for_content_types/__init__.py @@ -1,271 +0,0 @@ -# coding: utf-8 - -""" - - - Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator -""" - -import unittest -from unittest.mock import patch - -import urllib3 - -import unit_test_api -from unit_test_api.paths.response_body_post_string_type_matches_strings_response_body_for_content_types.post import operation as post # noqa: E501 -from unit_test_api import schemas, api_client -from unit_test_api.configurations import api_configuration, schema_configuration - -from .. import ApiTestMixin - - -class TestPost(ApiTestMixin, unittest.TestCase): - """ - Post unit test stubs - """ - api_config = api_configuration.ApiConfiguration() - schema_config = schema_configuration.SchemaConfiguration() - used_api_client = api_client.ApiClient(configuration=api_config, schema_config=schema_config) - api = post.ApiForPost(api_client=used_api_client) # noqa: E501 - - response_status = 200 - response_body_schema = post.response_200.ResponseFor200.content["application/json"].schema - - def test_1_is_not_a_string_fails(self): - # 1 is not a string - accept_content_type = 'application/json' - - with patch.object(urllib3.PoolManager, 'request') as mock_request: - payload = ( - 1 - ) - mock_request.return_value = self.response( - self.json_bytes(payload), - status=self.response_status - ) - with self.assertRaises((unit_test_api.ApiValueError, unit_test_api.ApiTypeError)): - self.api.post( - accept_content_types=(accept_content_type,) - ) - self.assert_pool_manager_request_called_with( - mock_request, - self.api_config.get_server_url('servers', None) + "/responseBody/postStringTypeMatchesStringsResponseBodyForContentTypes", - method='post'.upper(), - content_type=None, - accept_content_type=accept_content_type, - ) - - def test_a_string_is_still_a_string_even_if_it_looks_like_a_number_passes(self): - # a string is still a string, even if it looks like a number - accept_content_type = 'application/json' - - with patch.object(urllib3.PoolManager, 'request') as mock_request: - payload = ( - "1" - ) - mock_request.return_value = self.response( - self.json_bytes(payload), - status=self.response_status - ) - api_response = self.api.post( - accept_content_types=(accept_content_type,) - ) - self.assert_pool_manager_request_called_with( - mock_request, - self.api_config.get_server_url('servers', None) + "/responseBody/postStringTypeMatchesStringsResponseBodyForContentTypes", - method='post'.upper(), - accept_content_type=accept_content_type, - ) - - assert isinstance(api_response.response, urllib3.HTTPResponse) - assert isinstance(api_response.body, self.response_body_schema) - deserialized_response_body = self.response_body_schema.from_openapi_data_( - payload, - configuration_=self.schema_config - ) - assert api_response.body == deserialized_response_body - - def test_an_empty_string_is_still_a_string_passes(self): - # an empty string is still a string - accept_content_type = 'application/json' - - with patch.object(urllib3.PoolManager, 'request') as mock_request: - payload = ( - "" - ) - mock_request.return_value = self.response( - self.json_bytes(payload), - status=self.response_status - ) - api_response = self.api.post( - accept_content_types=(accept_content_type,) - ) - self.assert_pool_manager_request_called_with( - mock_request, - self.api_config.get_server_url('servers', None) + "/responseBody/postStringTypeMatchesStringsResponseBodyForContentTypes", - method='post'.upper(), - accept_content_type=accept_content_type, - ) - - assert isinstance(api_response.response, urllib3.HTTPResponse) - assert isinstance(api_response.body, self.response_body_schema) - deserialized_response_body = self.response_body_schema.from_openapi_data_( - payload, - configuration_=self.schema_config - ) - assert api_response.body == deserialized_response_body - - def test_a_float_is_not_a_string_fails(self): - # a float is not a string - accept_content_type = 'application/json' - - with patch.object(urllib3.PoolManager, 'request') as mock_request: - payload = ( - 1.1 - ) - mock_request.return_value = self.response( - self.json_bytes(payload), - status=self.response_status - ) - with self.assertRaises((unit_test_api.ApiValueError, unit_test_api.ApiTypeError)): - self.api.post( - accept_content_types=(accept_content_type,) - ) - self.assert_pool_manager_request_called_with( - mock_request, - self.api_config.get_server_url('servers', None) + "/responseBody/postStringTypeMatchesStringsResponseBodyForContentTypes", - method='post'.upper(), - content_type=None, - accept_content_type=accept_content_type, - ) - - def test_an_object_is_not_a_string_fails(self): - # an object is not a string - accept_content_type = 'application/json' - - with patch.object(urllib3.PoolManager, 'request') as mock_request: - payload = ( - { - } - ) - mock_request.return_value = self.response( - self.json_bytes(payload), - status=self.response_status - ) - with self.assertRaises((unit_test_api.ApiValueError, unit_test_api.ApiTypeError)): - self.api.post( - accept_content_types=(accept_content_type,) - ) - self.assert_pool_manager_request_called_with( - mock_request, - self.api_config.get_server_url('servers', None) + "/responseBody/postStringTypeMatchesStringsResponseBodyForContentTypes", - method='post'.upper(), - content_type=None, - accept_content_type=accept_content_type, - ) - - def test_an_array_is_not_a_string_fails(self): - # an array is not a string - accept_content_type = 'application/json' - - with patch.object(urllib3.PoolManager, 'request') as mock_request: - payload = ( - [ - ] - ) - mock_request.return_value = self.response( - self.json_bytes(payload), - status=self.response_status - ) - with self.assertRaises((unit_test_api.ApiValueError, unit_test_api.ApiTypeError)): - self.api.post( - accept_content_types=(accept_content_type,) - ) - self.assert_pool_manager_request_called_with( - mock_request, - self.api_config.get_server_url('servers', None) + "/responseBody/postStringTypeMatchesStringsResponseBodyForContentTypes", - method='post'.upper(), - content_type=None, - accept_content_type=accept_content_type, - ) - - def test_a_boolean_is_not_a_string_fails(self): - # a boolean is not a string - accept_content_type = 'application/json' - - with patch.object(urllib3.PoolManager, 'request') as mock_request: - payload = ( - True - ) - mock_request.return_value = self.response( - self.json_bytes(payload), - status=self.response_status - ) - with self.assertRaises((unit_test_api.ApiValueError, unit_test_api.ApiTypeError)): - self.api.post( - accept_content_types=(accept_content_type,) - ) - self.assert_pool_manager_request_called_with( - mock_request, - self.api_config.get_server_url('servers', None) + "/responseBody/postStringTypeMatchesStringsResponseBodyForContentTypes", - method='post'.upper(), - content_type=None, - accept_content_type=accept_content_type, - ) - - def test_null_is_not_a_string_fails(self): - # null is not a string - accept_content_type = 'application/json' - - with patch.object(urllib3.PoolManager, 'request') as mock_request: - payload = ( - None - ) - mock_request.return_value = self.response( - self.json_bytes(payload), - status=self.response_status - ) - with self.assertRaises((unit_test_api.ApiValueError, unit_test_api.ApiTypeError)): - self.api.post( - accept_content_types=(accept_content_type,) - ) - self.assert_pool_manager_request_called_with( - mock_request, - self.api_config.get_server_url('servers', None) + "/responseBody/postStringTypeMatchesStringsResponseBodyForContentTypes", - method='post'.upper(), - content_type=None, - accept_content_type=accept_content_type, - ) - - def test_a_string_is_a_string_passes(self): - # a string is a string - accept_content_type = 'application/json' - - with patch.object(urllib3.PoolManager, 'request') as mock_request: - payload = ( - "foo" - ) - mock_request.return_value = self.response( - self.json_bytes(payload), - status=self.response_status - ) - api_response = self.api.post( - accept_content_types=(accept_content_type,) - ) - self.assert_pool_manager_request_called_with( - mock_request, - self.api_config.get_server_url('servers', None) + "/responseBody/postStringTypeMatchesStringsResponseBodyForContentTypes", - method='post'.upper(), - accept_content_type=accept_content_type, - ) - - assert isinstance(api_response.response, urllib3.HTTPResponse) - assert isinstance(api_response.body, self.response_body_schema) - deserialized_response_body = self.response_body_schema.from_openapi_data_( - payload, - configuration_=self.schema_config - ) - assert api_response.body == deserialized_response_body - -if __name__ == '__main__': - unittest.main() diff --git a/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_response_body_post_the_default_keyword_does_not_do_anything_if_the_property_is_missing_response_body_for_content_types/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_response_body_post_the_default_keyword_does_not_do_anything_if_the_property_is_missing_response_body_for_content_types/__init__.py index 8ac19cd022e..e69de29bb2d 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_response_body_post_the_default_keyword_does_not_do_anything_if_the_property_is_missing_response_body_for_content_types/__init__.py +++ b/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_response_body_post_the_default_keyword_does_not_do_anything_if_the_property_is_missing_response_body_for_content_types/__init__.py @@ -1,126 +0,0 @@ -# coding: utf-8 - -""" - - - Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator -""" - -import unittest -from unittest.mock import patch - -import urllib3 - -import unit_test_api -from unit_test_api.paths.response_body_post_the_default_keyword_does_not_do_anything_if_the_property_is_missing_response_body_for_content_types.post import operation as post # noqa: E501 -from unit_test_api import schemas, api_client -from unit_test_api.configurations import api_configuration, schema_configuration - -from .. import ApiTestMixin - - -class TestPost(ApiTestMixin, unittest.TestCase): - """ - Post unit test stubs - """ - api_config = api_configuration.ApiConfiguration() - schema_config = schema_configuration.SchemaConfiguration() - used_api_client = api_client.ApiClient(configuration=api_config, schema_config=schema_config) - api = post.ApiForPost(api_client=used_api_client) # noqa: E501 - - response_status = 200 - response_body_schema = post.response_200.ResponseFor200.content["application/json"].schema - - def test_missing_properties_are_not_filled_in_with_the_default_passes(self): - # missing properties are not filled in with the default - accept_content_type = 'application/json' - - with patch.object(urllib3.PoolManager, 'request') as mock_request: - payload = ( - { - } - ) - mock_request.return_value = self.response( - self.json_bytes(payload), - status=self.response_status - ) - api_response = self.api.post( - accept_content_types=(accept_content_type,) - ) - self.assert_pool_manager_request_called_with( - mock_request, - self.api_config.get_server_url('servers', None) + "/responseBody/postTheDefaultKeywordDoesNotDoAnythingIfThePropertyIsMissingResponseBodyForContentTypes", - method='post'.upper(), - accept_content_type=accept_content_type, - ) - - assert isinstance(api_response.response, urllib3.HTTPResponse) - assert isinstance(api_response.body, self.response_body_schema) - deserialized_response_body = self.response_body_schema.from_openapi_data_( - payload, - configuration_=self.schema_config - ) - assert api_response.body == deserialized_response_body - - def test_an_explicit_property_value_is_checked_against_maximum_passing_passes(self): - # an explicit property value is checked against maximum (passing) - accept_content_type = 'application/json' - - with patch.object(urllib3.PoolManager, 'request') as mock_request: - payload = ( - { - "alpha": - 1, - } - ) - mock_request.return_value = self.response( - self.json_bytes(payload), - status=self.response_status - ) - api_response = self.api.post( - accept_content_types=(accept_content_type,) - ) - self.assert_pool_manager_request_called_with( - mock_request, - self.api_config.get_server_url('servers', None) + "/responseBody/postTheDefaultKeywordDoesNotDoAnythingIfThePropertyIsMissingResponseBodyForContentTypes", - method='post'.upper(), - accept_content_type=accept_content_type, - ) - - assert isinstance(api_response.response, urllib3.HTTPResponse) - assert isinstance(api_response.body, self.response_body_schema) - deserialized_response_body = self.response_body_schema.from_openapi_data_( - payload, - configuration_=self.schema_config - ) - assert api_response.body == deserialized_response_body - - def test_an_explicit_property_value_is_checked_against_maximum_failing_fails(self): - # an explicit property value is checked against maximum (failing) - accept_content_type = 'application/json' - - with patch.object(urllib3.PoolManager, 'request') as mock_request: - payload = ( - { - "alpha": - 5, - } - ) - mock_request.return_value = self.response( - self.json_bytes(payload), - status=self.response_status - ) - with self.assertRaises((unit_test_api.ApiValueError, unit_test_api.ApiTypeError)): - self.api.post( - accept_content_types=(accept_content_type,) - ) - self.assert_pool_manager_request_called_with( - mock_request, - self.api_config.get_server_url('servers', None) + "/responseBody/postTheDefaultKeywordDoesNotDoAnythingIfThePropertyIsMissingResponseBodyForContentTypes", - method='post'.upper(), - content_type=None, - accept_content_type=accept_content_type, - ) - -if __name__ == '__main__': - unittest.main() diff --git a/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_response_body_post_uniqueitems_false_validation_response_body_for_content_types/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_response_body_post_uniqueitems_false_validation_response_body_for_content_types/__init__.py index 678720b1e23..e69de29bb2d 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_response_body_post_uniqueitems_false_validation_response_body_for_content_types/__init__.py +++ b/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_response_body_post_uniqueitems_false_validation_response_body_for_content_types/__init__.py @@ -1,601 +0,0 @@ -# coding: utf-8 - -""" - - - Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator -""" - -import unittest -from unittest.mock import patch - -import urllib3 - -import unit_test_api -from unit_test_api.paths.response_body_post_uniqueitems_false_validation_response_body_for_content_types.post import operation as post # noqa: E501 -from unit_test_api import schemas, api_client -from unit_test_api.configurations import api_configuration, schema_configuration - -from .. import ApiTestMixin - - -class TestPost(ApiTestMixin, unittest.TestCase): - """ - Post unit test stubs - """ - api_config = api_configuration.ApiConfiguration() - schema_config = schema_configuration.SchemaConfiguration() - used_api_client = api_client.ApiClient(configuration=api_config, schema_config=schema_config) - api = post.ApiForPost(api_client=used_api_client) # noqa: E501 - - response_status = 200 - response_body_schema = post.response_200.ResponseFor200.content["application/json"].schema - - def test_non_unique_array_of_integers_is_valid_passes(self): - # non-unique array of integers is valid - accept_content_type = 'application/json' - - with patch.object(urllib3.PoolManager, 'request') as mock_request: - payload = ( - [ - 1, - 1, - ] - ) - mock_request.return_value = self.response( - self.json_bytes(payload), - status=self.response_status - ) - api_response = self.api.post( - accept_content_types=(accept_content_type,) - ) - self.assert_pool_manager_request_called_with( - mock_request, - self.api_config.get_server_url('servers', None) + "/responseBody/postUniqueitemsFalseValidationResponseBodyForContentTypes", - method='post'.upper(), - accept_content_type=accept_content_type, - ) - - assert isinstance(api_response.response, urllib3.HTTPResponse) - assert isinstance(api_response.body, self.response_body_schema) - deserialized_response_body = self.response_body_schema.from_openapi_data_( - payload, - configuration_=self.schema_config - ) - assert api_response.body == deserialized_response_body - - def test_unique_array_of_objects_is_valid_passes(self): - # unique array of objects is valid - accept_content_type = 'application/json' - - with patch.object(urllib3.PoolManager, 'request') as mock_request: - payload = ( - [ - { - "foo": - "bar", - }, - { - "foo": - "baz", - }, - ] - ) - mock_request.return_value = self.response( - self.json_bytes(payload), - status=self.response_status - ) - api_response = self.api.post( - accept_content_types=(accept_content_type,) - ) - self.assert_pool_manager_request_called_with( - mock_request, - self.api_config.get_server_url('servers', None) + "/responseBody/postUniqueitemsFalseValidationResponseBodyForContentTypes", - method='post'.upper(), - accept_content_type=accept_content_type, - ) - - assert isinstance(api_response.response, urllib3.HTTPResponse) - assert isinstance(api_response.body, self.response_body_schema) - deserialized_response_body = self.response_body_schema.from_openapi_data_( - payload, - configuration_=self.schema_config - ) - assert api_response.body == deserialized_response_body - - def test_non_unique_array_of_nested_objects_is_valid_passes(self): - # non-unique array of nested objects is valid - accept_content_type = 'application/json' - - with patch.object(urllib3.PoolManager, 'request') as mock_request: - payload = ( - [ - { - "foo": - { - "bar": - { - "baz": - True, - }, - }, - }, - { - "foo": - { - "bar": - { - "baz": - True, - }, - }, - }, - ] - ) - mock_request.return_value = self.response( - self.json_bytes(payload), - status=self.response_status - ) - api_response = self.api.post( - accept_content_types=(accept_content_type,) - ) - self.assert_pool_manager_request_called_with( - mock_request, - self.api_config.get_server_url('servers', None) + "/responseBody/postUniqueitemsFalseValidationResponseBodyForContentTypes", - method='post'.upper(), - accept_content_type=accept_content_type, - ) - - assert isinstance(api_response.response, urllib3.HTTPResponse) - assert isinstance(api_response.body, self.response_body_schema) - deserialized_response_body = self.response_body_schema.from_openapi_data_( - payload, - configuration_=self.schema_config - ) - assert api_response.body == deserialized_response_body - - def test_non_unique_array_of_objects_is_valid_passes(self): - # non-unique array of objects is valid - accept_content_type = 'application/json' - - with patch.object(urllib3.PoolManager, 'request') as mock_request: - payload = ( - [ - { - "foo": - "bar", - }, - { - "foo": - "bar", - }, - ] - ) - mock_request.return_value = self.response( - self.json_bytes(payload), - status=self.response_status - ) - api_response = self.api.post( - accept_content_types=(accept_content_type,) - ) - self.assert_pool_manager_request_called_with( - mock_request, - self.api_config.get_server_url('servers', None) + "/responseBody/postUniqueitemsFalseValidationResponseBodyForContentTypes", - method='post'.upper(), - accept_content_type=accept_content_type, - ) - - assert isinstance(api_response.response, urllib3.HTTPResponse) - assert isinstance(api_response.body, self.response_body_schema) - deserialized_response_body = self.response_body_schema.from_openapi_data_( - payload, - configuration_=self.schema_config - ) - assert api_response.body == deserialized_response_body - - def test_1_and_true_are_unique_passes(self): - # 1 and true are unique - accept_content_type = 'application/json' - - with patch.object(urllib3.PoolManager, 'request') as mock_request: - payload = ( - [ - 1, - True, - ] - ) - mock_request.return_value = self.response( - self.json_bytes(payload), - status=self.response_status - ) - api_response = self.api.post( - accept_content_types=(accept_content_type,) - ) - self.assert_pool_manager_request_called_with( - mock_request, - self.api_config.get_server_url('servers', None) + "/responseBody/postUniqueitemsFalseValidationResponseBodyForContentTypes", - method='post'.upper(), - accept_content_type=accept_content_type, - ) - - assert isinstance(api_response.response, urllib3.HTTPResponse) - assert isinstance(api_response.body, self.response_body_schema) - deserialized_response_body = self.response_body_schema.from_openapi_data_( - payload, - configuration_=self.schema_config - ) - assert api_response.body == deserialized_response_body - - def test_unique_array_of_integers_is_valid_passes(self): - # unique array of integers is valid - accept_content_type = 'application/json' - - with patch.object(urllib3.PoolManager, 'request') as mock_request: - payload = ( - [ - 1, - 2, - ] - ) - mock_request.return_value = self.response( - self.json_bytes(payload), - status=self.response_status - ) - api_response = self.api.post( - accept_content_types=(accept_content_type,) - ) - self.assert_pool_manager_request_called_with( - mock_request, - self.api_config.get_server_url('servers', None) + "/responseBody/postUniqueitemsFalseValidationResponseBodyForContentTypes", - method='post'.upper(), - accept_content_type=accept_content_type, - ) - - assert isinstance(api_response.response, urllib3.HTTPResponse) - assert isinstance(api_response.body, self.response_body_schema) - deserialized_response_body = self.response_body_schema.from_openapi_data_( - payload, - configuration_=self.schema_config - ) - assert api_response.body == deserialized_response_body - - def test_non_unique_array_of_arrays_is_valid_passes(self): - # non-unique array of arrays is valid - accept_content_type = 'application/json' - - with patch.object(urllib3.PoolManager, 'request') as mock_request: - payload = ( - [ - [ - "foo", - ], - [ - "foo", - ], - ] - ) - mock_request.return_value = self.response( - self.json_bytes(payload), - status=self.response_status - ) - api_response = self.api.post( - accept_content_types=(accept_content_type,) - ) - self.assert_pool_manager_request_called_with( - mock_request, - self.api_config.get_server_url('servers', None) + "/responseBody/postUniqueitemsFalseValidationResponseBodyForContentTypes", - method='post'.upper(), - accept_content_type=accept_content_type, - ) - - assert isinstance(api_response.response, urllib3.HTTPResponse) - assert isinstance(api_response.body, self.response_body_schema) - deserialized_response_body = self.response_body_schema.from_openapi_data_( - payload, - configuration_=self.schema_config - ) - assert api_response.body == deserialized_response_body - - def test_numbers_are_unique_if_mathematically_unequal_passes(self): - # numbers are unique if mathematically unequal - accept_content_type = 'application/json' - - with patch.object(urllib3.PoolManager, 'request') as mock_request: - payload = ( - [ - 1.0, - 1.0, - 1, - ] - ) - mock_request.return_value = self.response( - self.json_bytes(payload), - status=self.response_status - ) - api_response = self.api.post( - accept_content_types=(accept_content_type,) - ) - self.assert_pool_manager_request_called_with( - mock_request, - self.api_config.get_server_url('servers', None) + "/responseBody/postUniqueitemsFalseValidationResponseBodyForContentTypes", - method='post'.upper(), - accept_content_type=accept_content_type, - ) - - assert isinstance(api_response.response, urllib3.HTTPResponse) - assert isinstance(api_response.body, self.response_body_schema) - deserialized_response_body = self.response_body_schema.from_openapi_data_( - payload, - configuration_=self.schema_config - ) - assert api_response.body == deserialized_response_body - - def test_false_is_not_equal_to_zero_passes(self): - # false is not equal to zero - accept_content_type = 'application/json' - - with patch.object(urllib3.PoolManager, 'request') as mock_request: - payload = ( - [ - 0, - False, - ] - ) - mock_request.return_value = self.response( - self.json_bytes(payload), - status=self.response_status - ) - api_response = self.api.post( - accept_content_types=(accept_content_type,) - ) - self.assert_pool_manager_request_called_with( - mock_request, - self.api_config.get_server_url('servers', None) + "/responseBody/postUniqueitemsFalseValidationResponseBodyForContentTypes", - method='post'.upper(), - accept_content_type=accept_content_type, - ) - - assert isinstance(api_response.response, urllib3.HTTPResponse) - assert isinstance(api_response.body, self.response_body_schema) - deserialized_response_body = self.response_body_schema.from_openapi_data_( - payload, - configuration_=self.schema_config - ) - assert api_response.body == deserialized_response_body - - def test_unique_array_of_nested_objects_is_valid_passes(self): - # unique array of nested objects is valid - accept_content_type = 'application/json' - - with patch.object(urllib3.PoolManager, 'request') as mock_request: - payload = ( - [ - { - "foo": - { - "bar": - { - "baz": - True, - }, - }, - }, - { - "foo": - { - "bar": - { - "baz": - False, - }, - }, - }, - ] - ) - mock_request.return_value = self.response( - self.json_bytes(payload), - status=self.response_status - ) - api_response = self.api.post( - accept_content_types=(accept_content_type,) - ) - self.assert_pool_manager_request_called_with( - mock_request, - self.api_config.get_server_url('servers', None) + "/responseBody/postUniqueitemsFalseValidationResponseBodyForContentTypes", - method='post'.upper(), - accept_content_type=accept_content_type, - ) - - assert isinstance(api_response.response, urllib3.HTTPResponse) - assert isinstance(api_response.body, self.response_body_schema) - deserialized_response_body = self.response_body_schema.from_openapi_data_( - payload, - configuration_=self.schema_config - ) - assert api_response.body == deserialized_response_body - - def test_0_and_false_are_unique_passes(self): - # 0 and false are unique - accept_content_type = 'application/json' - - with patch.object(urllib3.PoolManager, 'request') as mock_request: - payload = ( - [ - 0, - False, - ] - ) - mock_request.return_value = self.response( - self.json_bytes(payload), - status=self.response_status - ) - api_response = self.api.post( - accept_content_types=(accept_content_type,) - ) - self.assert_pool_manager_request_called_with( - mock_request, - self.api_config.get_server_url('servers', None) + "/responseBody/postUniqueitemsFalseValidationResponseBodyForContentTypes", - method='post'.upper(), - accept_content_type=accept_content_type, - ) - - assert isinstance(api_response.response, urllib3.HTTPResponse) - assert isinstance(api_response.body, self.response_body_schema) - deserialized_response_body = self.response_body_schema.from_openapi_data_( - payload, - configuration_=self.schema_config - ) - assert api_response.body == deserialized_response_body - - def test_unique_array_of_arrays_is_valid_passes(self): - # unique array of arrays is valid - accept_content_type = 'application/json' - - with patch.object(urllib3.PoolManager, 'request') as mock_request: - payload = ( - [ - [ - "foo", - ], - [ - "bar", - ], - ] - ) - mock_request.return_value = self.response( - self.json_bytes(payload), - status=self.response_status - ) - api_response = self.api.post( - accept_content_types=(accept_content_type,) - ) - self.assert_pool_manager_request_called_with( - mock_request, - self.api_config.get_server_url('servers', None) + "/responseBody/postUniqueitemsFalseValidationResponseBodyForContentTypes", - method='post'.upper(), - accept_content_type=accept_content_type, - ) - - assert isinstance(api_response.response, urllib3.HTTPResponse) - assert isinstance(api_response.body, self.response_body_schema) - deserialized_response_body = self.response_body_schema.from_openapi_data_( - payload, - configuration_=self.schema_config - ) - assert api_response.body == deserialized_response_body - - def test_true_is_not_equal_to_one_passes(self): - # true is not equal to one - accept_content_type = 'application/json' - - with patch.object(urllib3.PoolManager, 'request') as mock_request: - payload = ( - [ - 1, - True, - ] - ) - mock_request.return_value = self.response( - self.json_bytes(payload), - status=self.response_status - ) - api_response = self.api.post( - accept_content_types=(accept_content_type,) - ) - self.assert_pool_manager_request_called_with( - mock_request, - self.api_config.get_server_url('servers', None) + "/responseBody/postUniqueitemsFalseValidationResponseBodyForContentTypes", - method='post'.upper(), - accept_content_type=accept_content_type, - ) - - assert isinstance(api_response.response, urllib3.HTTPResponse) - assert isinstance(api_response.body, self.response_body_schema) - deserialized_response_body = self.response_body_schema.from_openapi_data_( - payload, - configuration_=self.schema_config - ) - assert api_response.body == deserialized_response_body - - def test_non_unique_heterogeneous_types_are_valid_passes(self): - # non-unique heterogeneous types are valid - accept_content_type = 'application/json' - - with patch.object(urllib3.PoolManager, 'request') as mock_request: - payload = ( - [ - { - }, - [ - 1, - ], - True, - None, - { - }, - 1, - ] - ) - mock_request.return_value = self.response( - self.json_bytes(payload), - status=self.response_status - ) - api_response = self.api.post( - accept_content_types=(accept_content_type,) - ) - self.assert_pool_manager_request_called_with( - mock_request, - self.api_config.get_server_url('servers', None) + "/responseBody/postUniqueitemsFalseValidationResponseBodyForContentTypes", - method='post'.upper(), - accept_content_type=accept_content_type, - ) - - assert isinstance(api_response.response, urllib3.HTTPResponse) - assert isinstance(api_response.body, self.response_body_schema) - deserialized_response_body = self.response_body_schema.from_openapi_data_( - payload, - configuration_=self.schema_config - ) - assert api_response.body == deserialized_response_body - - def test_unique_heterogeneous_types_are_valid_passes(self): - # unique heterogeneous types are valid - accept_content_type = 'application/json' - - with patch.object(urllib3.PoolManager, 'request') as mock_request: - payload = ( - [ - { - }, - [ - 1, - ], - True, - None, - 1, - ] - ) - mock_request.return_value = self.response( - self.json_bytes(payload), - status=self.response_status - ) - api_response = self.api.post( - accept_content_types=(accept_content_type,) - ) - self.assert_pool_manager_request_called_with( - mock_request, - self.api_config.get_server_url('servers', None) + "/responseBody/postUniqueitemsFalseValidationResponseBodyForContentTypes", - method='post'.upper(), - accept_content_type=accept_content_type, - ) - - assert isinstance(api_response.response, urllib3.HTTPResponse) - assert isinstance(api_response.body, self.response_body_schema) - deserialized_response_body = self.response_body_schema.from_openapi_data_( - payload, - configuration_=self.schema_config - ) - assert api_response.body == deserialized_response_body - -if __name__ == '__main__': - unittest.main() diff --git a/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_response_body_post_uniqueitems_validation_response_body_for_content_types/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_response_body_post_uniqueitems_validation_response_body_for_content_types/__init__.py index 805c21056c8..e69de29bb2d 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_response_body_post_uniqueitems_validation_response_body_for_content_types/__init__.py +++ b/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_response_body_post_uniqueitems_validation_response_body_for_content_types/__init__.py @@ -1,942 +0,0 @@ -# coding: utf-8 - -""" - - - Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator -""" - -import unittest -from unittest.mock import patch - -import urllib3 - -import unit_test_api -from unit_test_api.paths.response_body_post_uniqueitems_validation_response_body_for_content_types.post import operation as post # noqa: E501 -from unit_test_api import schemas, api_client -from unit_test_api.configurations import api_configuration, schema_configuration - -from .. import ApiTestMixin - - -class TestPost(ApiTestMixin, unittest.TestCase): - """ - Post unit test stubs - """ - api_config = api_configuration.ApiConfiguration() - schema_config = schema_configuration.SchemaConfiguration() - used_api_client = api_client.ApiClient(configuration=api_config, schema_config=schema_config) - api = post.ApiForPost(api_client=used_api_client) # noqa: E501 - - response_status = 200 - response_body_schema = post.response_200.ResponseFor200.content["application/json"].schema - - def test_unique_array_of_objects_is_valid_passes(self): - # unique array of objects is valid - accept_content_type = 'application/json' - - with patch.object(urllib3.PoolManager, 'request') as mock_request: - payload = ( - [ - { - "foo": - "bar", - }, - { - "foo": - "baz", - }, - ] - ) - mock_request.return_value = self.response( - self.json_bytes(payload), - status=self.response_status - ) - api_response = self.api.post( - accept_content_types=(accept_content_type,) - ) - self.assert_pool_manager_request_called_with( - mock_request, - self.api_config.get_server_url('servers', None) + "/responseBody/postUniqueitemsValidationResponseBodyForContentTypes", - method='post'.upper(), - accept_content_type=accept_content_type, - ) - - assert isinstance(api_response.response, urllib3.HTTPResponse) - assert isinstance(api_response.body, self.response_body_schema) - deserialized_response_body = self.response_body_schema.from_openapi_data_( - payload, - configuration_=self.schema_config - ) - assert api_response.body == deserialized_response_body - - def test_a_true_and_a1_are_unique_passes(self): - # {"a": true} and {"a": 1} are unique - accept_content_type = 'application/json' - - with patch.object(urllib3.PoolManager, 'request') as mock_request: - payload = ( - [ - { - "a": - True, - }, - { - "a": - 1, - }, - ] - ) - mock_request.return_value = self.response( - self.json_bytes(payload), - status=self.response_status - ) - api_response = self.api.post( - accept_content_types=(accept_content_type,) - ) - self.assert_pool_manager_request_called_with( - mock_request, - self.api_config.get_server_url('servers', None) + "/responseBody/postUniqueitemsValidationResponseBodyForContentTypes", - method='post'.upper(), - accept_content_type=accept_content_type, - ) - - assert isinstance(api_response.response, urllib3.HTTPResponse) - assert isinstance(api_response.body, self.response_body_schema) - deserialized_response_body = self.response_body_schema.from_openapi_data_( - payload, - configuration_=self.schema_config - ) - assert api_response.body == deserialized_response_body - - def test_non_unique_heterogeneous_types_are_invalid_fails(self): - # non-unique heterogeneous types are invalid - accept_content_type = 'application/json' - - with patch.object(urllib3.PoolManager, 'request') as mock_request: - payload = ( - [ - { - }, - [ - 1, - ], - True, - None, - { - }, - 1, - ] - ) - mock_request.return_value = self.response( - self.json_bytes(payload), - status=self.response_status - ) - with self.assertRaises((unit_test_api.ApiValueError, unit_test_api.ApiTypeError)): - self.api.post( - accept_content_types=(accept_content_type,) - ) - self.assert_pool_manager_request_called_with( - mock_request, - self.api_config.get_server_url('servers', None) + "/responseBody/postUniqueitemsValidationResponseBodyForContentTypes", - method='post'.upper(), - content_type=None, - accept_content_type=accept_content_type, - ) - - def test_nested0_and_false_are_unique_passes(self): - # nested [0] and [false] are unique - accept_content_type = 'application/json' - - with patch.object(urllib3.PoolManager, 'request') as mock_request: - payload = ( - [ - [ - [ - 0, - ], - "foo", - ], - [ - [ - False, - ], - "foo", - ], - ] - ) - mock_request.return_value = self.response( - self.json_bytes(payload), - status=self.response_status - ) - api_response = self.api.post( - accept_content_types=(accept_content_type,) - ) - self.assert_pool_manager_request_called_with( - mock_request, - self.api_config.get_server_url('servers', None) + "/responseBody/postUniqueitemsValidationResponseBodyForContentTypes", - method='post'.upper(), - accept_content_type=accept_content_type, - ) - - assert isinstance(api_response.response, urllib3.HTTPResponse) - assert isinstance(api_response.body, self.response_body_schema) - deserialized_response_body = self.response_body_schema.from_openapi_data_( - payload, - configuration_=self.schema_config - ) - assert api_response.body == deserialized_response_body - - def test_a_false_and_a0_are_unique_passes(self): - # {"a": false} and {"a": 0} are unique - accept_content_type = 'application/json' - - with patch.object(urllib3.PoolManager, 'request') as mock_request: - payload = ( - [ - { - "a": - False, - }, - { - "a": - 0, - }, - ] - ) - mock_request.return_value = self.response( - self.json_bytes(payload), - status=self.response_status - ) - api_response = self.api.post( - accept_content_types=(accept_content_type,) - ) - self.assert_pool_manager_request_called_with( - mock_request, - self.api_config.get_server_url('servers', None) + "/responseBody/postUniqueitemsValidationResponseBodyForContentTypes", - method='post'.upper(), - accept_content_type=accept_content_type, - ) - - assert isinstance(api_response.response, urllib3.HTTPResponse) - assert isinstance(api_response.body, self.response_body_schema) - deserialized_response_body = self.response_body_schema.from_openapi_data_( - payload, - configuration_=self.schema_config - ) - assert api_response.body == deserialized_response_body - - def test_numbers_are_unique_if_mathematically_unequal_fails(self): - # numbers are unique if mathematically unequal - accept_content_type = 'application/json' - - with patch.object(urllib3.PoolManager, 'request') as mock_request: - payload = ( - [ - 1.0, - 1.0, - 1, - ] - ) - mock_request.return_value = self.response( - self.json_bytes(payload), - status=self.response_status - ) - with self.assertRaises((unit_test_api.ApiValueError, unit_test_api.ApiTypeError)): - self.api.post( - accept_content_types=(accept_content_type,) - ) - self.assert_pool_manager_request_called_with( - mock_request, - self.api_config.get_server_url('servers', None) + "/responseBody/postUniqueitemsValidationResponseBodyForContentTypes", - method='post'.upper(), - content_type=None, - accept_content_type=accept_content_type, - ) - - def test_false_is_not_equal_to_zero_passes(self): - # false is not equal to zero - accept_content_type = 'application/json' - - with patch.object(urllib3.PoolManager, 'request') as mock_request: - payload = ( - [ - 0, - False, - ] - ) - mock_request.return_value = self.response( - self.json_bytes(payload), - status=self.response_status - ) - api_response = self.api.post( - accept_content_types=(accept_content_type,) - ) - self.assert_pool_manager_request_called_with( - mock_request, - self.api_config.get_server_url('servers', None) + "/responseBody/postUniqueitemsValidationResponseBodyForContentTypes", - method='post'.upper(), - accept_content_type=accept_content_type, - ) - - assert isinstance(api_response.response, urllib3.HTTPResponse) - assert isinstance(api_response.body, self.response_body_schema) - deserialized_response_body = self.response_body_schema.from_openapi_data_( - payload, - configuration_=self.schema_config - ) - assert api_response.body == deserialized_response_body - - def test_0_and_false_are_unique_passes(self): - # [0] and [false] are unique - accept_content_type = 'application/json' - - with patch.object(urllib3.PoolManager, 'request') as mock_request: - payload = ( - [ - [ - 0, - ], - [ - False, - ], - ] - ) - mock_request.return_value = self.response( - self.json_bytes(payload), - status=self.response_status - ) - api_response = self.api.post( - accept_content_types=(accept_content_type,) - ) - self.assert_pool_manager_request_called_with( - mock_request, - self.api_config.get_server_url('servers', None) + "/responseBody/postUniqueitemsValidationResponseBodyForContentTypes", - method='post'.upper(), - accept_content_type=accept_content_type, - ) - - assert isinstance(api_response.response, urllib3.HTTPResponse) - assert isinstance(api_response.body, self.response_body_schema) - deserialized_response_body = self.response_body_schema.from_openapi_data_( - payload, - configuration_=self.schema_config - ) - assert api_response.body == deserialized_response_body - - def test_unique_array_of_arrays_is_valid_passes(self): - # unique array of arrays is valid - accept_content_type = 'application/json' - - with patch.object(urllib3.PoolManager, 'request') as mock_request: - payload = ( - [ - [ - "foo", - ], - [ - "bar", - ], - ] - ) - mock_request.return_value = self.response( - self.json_bytes(payload), - status=self.response_status - ) - api_response = self.api.post( - accept_content_types=(accept_content_type,) - ) - self.assert_pool_manager_request_called_with( - mock_request, - self.api_config.get_server_url('servers', None) + "/responseBody/postUniqueitemsValidationResponseBodyForContentTypes", - method='post'.upper(), - accept_content_type=accept_content_type, - ) - - assert isinstance(api_response.response, urllib3.HTTPResponse) - assert isinstance(api_response.body, self.response_body_schema) - deserialized_response_body = self.response_body_schema.from_openapi_data_( - payload, - configuration_=self.schema_config - ) - assert api_response.body == deserialized_response_body - - def test_non_unique_array_of_nested_objects_is_invalid_fails(self): - # non-unique array of nested objects is invalid - accept_content_type = 'application/json' - - with patch.object(urllib3.PoolManager, 'request') as mock_request: - payload = ( - [ - { - "foo": - { - "bar": - { - "baz": - True, - }, - }, - }, - { - "foo": - { - "bar": - { - "baz": - True, - }, - }, - }, - ] - ) - mock_request.return_value = self.response( - self.json_bytes(payload), - status=self.response_status - ) - with self.assertRaises((unit_test_api.ApiValueError, unit_test_api.ApiTypeError)): - self.api.post( - accept_content_types=(accept_content_type,) - ) - self.assert_pool_manager_request_called_with( - mock_request, - self.api_config.get_server_url('servers', None) + "/responseBody/postUniqueitemsValidationResponseBodyForContentTypes", - method='post'.upper(), - content_type=None, - accept_content_type=accept_content_type, - ) - - def test_non_unique_array_of_more_than_two_integers_is_invalid_fails(self): - # non-unique array of more than two integers is invalid - accept_content_type = 'application/json' - - with patch.object(urllib3.PoolManager, 'request') as mock_request: - payload = ( - [ - 1, - 2, - 1, - ] - ) - mock_request.return_value = self.response( - self.json_bytes(payload), - status=self.response_status - ) - with self.assertRaises((unit_test_api.ApiValueError, unit_test_api.ApiTypeError)): - self.api.post( - accept_content_types=(accept_content_type,) - ) - self.assert_pool_manager_request_called_with( - mock_request, - self.api_config.get_server_url('servers', None) + "/responseBody/postUniqueitemsValidationResponseBodyForContentTypes", - method='post'.upper(), - content_type=None, - accept_content_type=accept_content_type, - ) - - def test_true_is_not_equal_to_one_passes(self): - # true is not equal to one - accept_content_type = 'application/json' - - with patch.object(urllib3.PoolManager, 'request') as mock_request: - payload = ( - [ - 1, - True, - ] - ) - mock_request.return_value = self.response( - self.json_bytes(payload), - status=self.response_status - ) - api_response = self.api.post( - accept_content_types=(accept_content_type,) - ) - self.assert_pool_manager_request_called_with( - mock_request, - self.api_config.get_server_url('servers', None) + "/responseBody/postUniqueitemsValidationResponseBodyForContentTypes", - method='post'.upper(), - accept_content_type=accept_content_type, - ) - - assert isinstance(api_response.response, urllib3.HTTPResponse) - assert isinstance(api_response.body, self.response_body_schema) - deserialized_response_body = self.response_body_schema.from_openapi_data_( - payload, - configuration_=self.schema_config - ) - assert api_response.body == deserialized_response_body - - def test_objects_are_non_unique_despite_key_order_fails(self): - # objects are non-unique despite key order - accept_content_type = 'application/json' - - with patch.object(urllib3.PoolManager, 'request') as mock_request: - payload = ( - [ - { - "a": - 1, - "b": - 2, - }, - { - "b": - 2, - "a": - 1, - }, - ] - ) - mock_request.return_value = self.response( - self.json_bytes(payload), - status=self.response_status - ) - with self.assertRaises((unit_test_api.ApiValueError, unit_test_api.ApiTypeError)): - self.api.post( - accept_content_types=(accept_content_type,) - ) - self.assert_pool_manager_request_called_with( - mock_request, - self.api_config.get_server_url('servers', None) + "/responseBody/postUniqueitemsValidationResponseBodyForContentTypes", - method='post'.upper(), - content_type=None, - accept_content_type=accept_content_type, - ) - - def test_unique_array_of_strings_is_valid_passes(self): - # unique array of strings is valid - accept_content_type = 'application/json' - - with patch.object(urllib3.PoolManager, 'request') as mock_request: - payload = ( - [ - "foo", - "bar", - "baz", - ] - ) - mock_request.return_value = self.response( - self.json_bytes(payload), - status=self.response_status - ) - api_response = self.api.post( - accept_content_types=(accept_content_type,) - ) - self.assert_pool_manager_request_called_with( - mock_request, - self.api_config.get_server_url('servers', None) + "/responseBody/postUniqueitemsValidationResponseBodyForContentTypes", - method='post'.upper(), - accept_content_type=accept_content_type, - ) - - assert isinstance(api_response.response, urllib3.HTTPResponse) - assert isinstance(api_response.body, self.response_body_schema) - deserialized_response_body = self.response_body_schema.from_openapi_data_( - payload, - configuration_=self.schema_config - ) - assert api_response.body == deserialized_response_body - - def test_1_and_true_are_unique_passes(self): - # [1] and [true] are unique - accept_content_type = 'application/json' - - with patch.object(urllib3.PoolManager, 'request') as mock_request: - payload = ( - [ - [ - 1, - ], - [ - True, - ], - ] - ) - mock_request.return_value = self.response( - self.json_bytes(payload), - status=self.response_status - ) - api_response = self.api.post( - accept_content_types=(accept_content_type,) - ) - self.assert_pool_manager_request_called_with( - mock_request, - self.api_config.get_server_url('servers', None) + "/responseBody/postUniqueitemsValidationResponseBodyForContentTypes", - method='post'.upper(), - accept_content_type=accept_content_type, - ) - - assert isinstance(api_response.response, urllib3.HTTPResponse) - assert isinstance(api_response.body, self.response_body_schema) - deserialized_response_body = self.response_body_schema.from_openapi_data_( - payload, - configuration_=self.schema_config - ) - assert api_response.body == deserialized_response_body - - def test_different_objects_are_unique_passes(self): - # different objects are unique - accept_content_type = 'application/json' - - with patch.object(urllib3.PoolManager, 'request') as mock_request: - payload = ( - [ - { - "a": - 1, - "b": - 2, - }, - { - "a": - 2, - "b": - 1, - }, - ] - ) - mock_request.return_value = self.response( - self.json_bytes(payload), - status=self.response_status - ) - api_response = self.api.post( - accept_content_types=(accept_content_type,) - ) - self.assert_pool_manager_request_called_with( - mock_request, - self.api_config.get_server_url('servers', None) + "/responseBody/postUniqueitemsValidationResponseBodyForContentTypes", - method='post'.upper(), - accept_content_type=accept_content_type, - ) - - assert isinstance(api_response.response, urllib3.HTTPResponse) - assert isinstance(api_response.body, self.response_body_schema) - deserialized_response_body = self.response_body_schema.from_openapi_data_( - payload, - configuration_=self.schema_config - ) - assert api_response.body == deserialized_response_body - - def test_unique_array_of_integers_is_valid_passes(self): - # unique array of integers is valid - accept_content_type = 'application/json' - - with patch.object(urllib3.PoolManager, 'request') as mock_request: - payload = ( - [ - 1, - 2, - ] - ) - mock_request.return_value = self.response( - self.json_bytes(payload), - status=self.response_status - ) - api_response = self.api.post( - accept_content_types=(accept_content_type,) - ) - self.assert_pool_manager_request_called_with( - mock_request, - self.api_config.get_server_url('servers', None) + "/responseBody/postUniqueitemsValidationResponseBodyForContentTypes", - method='post'.upper(), - accept_content_type=accept_content_type, - ) - - assert isinstance(api_response.response, urllib3.HTTPResponse) - assert isinstance(api_response.body, self.response_body_schema) - deserialized_response_body = self.response_body_schema.from_openapi_data_( - payload, - configuration_=self.schema_config - ) - assert api_response.body == deserialized_response_body - - def test_non_unique_array_of_more_than_two_arrays_is_invalid_fails(self): - # non-unique array of more than two arrays is invalid - accept_content_type = 'application/json' - - with patch.object(urllib3.PoolManager, 'request') as mock_request: - payload = ( - [ - [ - "foo", - ], - [ - "bar", - ], - [ - "foo", - ], - ] - ) - mock_request.return_value = self.response( - self.json_bytes(payload), - status=self.response_status - ) - with self.assertRaises((unit_test_api.ApiValueError, unit_test_api.ApiTypeError)): - self.api.post( - accept_content_types=(accept_content_type,) - ) - self.assert_pool_manager_request_called_with( - mock_request, - self.api_config.get_server_url('servers', None) + "/responseBody/postUniqueitemsValidationResponseBodyForContentTypes", - method='post'.upper(), - content_type=None, - accept_content_type=accept_content_type, - ) - - def test_non_unique_array_of_objects_is_invalid_fails(self): - # non-unique array of objects is invalid - accept_content_type = 'application/json' - - with patch.object(urllib3.PoolManager, 'request') as mock_request: - payload = ( - [ - { - "foo": - "bar", - }, - { - "foo": - "bar", - }, - ] - ) - mock_request.return_value = self.response( - self.json_bytes(payload), - status=self.response_status - ) - with self.assertRaises((unit_test_api.ApiValueError, unit_test_api.ApiTypeError)): - self.api.post( - accept_content_types=(accept_content_type,) - ) - self.assert_pool_manager_request_called_with( - mock_request, - self.api_config.get_server_url('servers', None) + "/responseBody/postUniqueitemsValidationResponseBodyForContentTypes", - method='post'.upper(), - content_type=None, - accept_content_type=accept_content_type, - ) - - def test_unique_array_of_nested_objects_is_valid_passes(self): - # unique array of nested objects is valid - accept_content_type = 'application/json' - - with patch.object(urllib3.PoolManager, 'request') as mock_request: - payload = ( - [ - { - "foo": - { - "bar": - { - "baz": - True, - }, - }, - }, - { - "foo": - { - "bar": - { - "baz": - False, - }, - }, - }, - ] - ) - mock_request.return_value = self.response( - self.json_bytes(payload), - status=self.response_status - ) - api_response = self.api.post( - accept_content_types=(accept_content_type,) - ) - self.assert_pool_manager_request_called_with( - mock_request, - self.api_config.get_server_url('servers', None) + "/responseBody/postUniqueitemsValidationResponseBodyForContentTypes", - method='post'.upper(), - accept_content_type=accept_content_type, - ) - - assert isinstance(api_response.response, urllib3.HTTPResponse) - assert isinstance(api_response.body, self.response_body_schema) - deserialized_response_body = self.response_body_schema.from_openapi_data_( - payload, - configuration_=self.schema_config - ) - assert api_response.body == deserialized_response_body - - def test_non_unique_array_of_arrays_is_invalid_fails(self): - # non-unique array of arrays is invalid - accept_content_type = 'application/json' - - with patch.object(urllib3.PoolManager, 'request') as mock_request: - payload = ( - [ - [ - "foo", - ], - [ - "foo", - ], - ] - ) - mock_request.return_value = self.response( - self.json_bytes(payload), - status=self.response_status - ) - with self.assertRaises((unit_test_api.ApiValueError, unit_test_api.ApiTypeError)): - self.api.post( - accept_content_types=(accept_content_type,) - ) - self.assert_pool_manager_request_called_with( - mock_request, - self.api_config.get_server_url('servers', None) + "/responseBody/postUniqueitemsValidationResponseBodyForContentTypes", - method='post'.upper(), - content_type=None, - accept_content_type=accept_content_type, - ) - - def test_non_unique_array_of_strings_is_invalid_fails(self): - # non-unique array of strings is invalid - accept_content_type = 'application/json' - - with patch.object(urllib3.PoolManager, 'request') as mock_request: - payload = ( - [ - "foo", - "bar", - "foo", - ] - ) - mock_request.return_value = self.response( - self.json_bytes(payload), - status=self.response_status - ) - with self.assertRaises((unit_test_api.ApiValueError, unit_test_api.ApiTypeError)): - self.api.post( - accept_content_types=(accept_content_type,) - ) - self.assert_pool_manager_request_called_with( - mock_request, - self.api_config.get_server_url('servers', None) + "/responseBody/postUniqueitemsValidationResponseBodyForContentTypes", - method='post'.upper(), - content_type=None, - accept_content_type=accept_content_type, - ) - - def test_nested1_and_true_are_unique_passes(self): - # nested [1] and [true] are unique - accept_content_type = 'application/json' - - with patch.object(urllib3.PoolManager, 'request') as mock_request: - payload = ( - [ - [ - [ - 1, - ], - "foo", - ], - [ - [ - True, - ], - "foo", - ], - ] - ) - mock_request.return_value = self.response( - self.json_bytes(payload), - status=self.response_status - ) - api_response = self.api.post( - accept_content_types=(accept_content_type,) - ) - self.assert_pool_manager_request_called_with( - mock_request, - self.api_config.get_server_url('servers', None) + "/responseBody/postUniqueitemsValidationResponseBodyForContentTypes", - method='post'.upper(), - accept_content_type=accept_content_type, - ) - - assert isinstance(api_response.response, urllib3.HTTPResponse) - assert isinstance(api_response.body, self.response_body_schema) - deserialized_response_body = self.response_body_schema.from_openapi_data_( - payload, - configuration_=self.schema_config - ) - assert api_response.body == deserialized_response_body - - def test_unique_heterogeneous_types_are_valid_passes(self): - # unique heterogeneous types are valid - accept_content_type = 'application/json' - - with patch.object(urllib3.PoolManager, 'request') as mock_request: - payload = ( - [ - { - }, - [ - 1, - ], - True, - None, - 1, - "{}", - ] - ) - mock_request.return_value = self.response( - self.json_bytes(payload), - status=self.response_status - ) - api_response = self.api.post( - accept_content_types=(accept_content_type,) - ) - self.assert_pool_manager_request_called_with( - mock_request, - self.api_config.get_server_url('servers', None) + "/responseBody/postUniqueitemsValidationResponseBodyForContentTypes", - method='post'.upper(), - accept_content_type=accept_content_type, - ) - - assert isinstance(api_response.response, urllib3.HTTPResponse) - assert isinstance(api_response.body, self.response_body_schema) - deserialized_response_body = self.response_body_schema.from_openapi_data_( - payload, - configuration_=self.schema_config - ) - assert api_response.body == deserialized_response_body - - def test_non_unique_array_of_integers_is_invalid_fails(self): - # non-unique array of integers is invalid - accept_content_type = 'application/json' - - with patch.object(urllib3.PoolManager, 'request') as mock_request: - payload = ( - [ - 1, - 1, - ] - ) - mock_request.return_value = self.response( - self.json_bytes(payload), - status=self.response_status - ) - with self.assertRaises((unit_test_api.ApiValueError, unit_test_api.ApiTypeError)): - self.api.post( - accept_content_types=(accept_content_type,) - ) - self.assert_pool_manager_request_called_with( - mock_request, - self.api_config.get_server_url('servers', None) + "/responseBody/postUniqueitemsValidationResponseBodyForContentTypes", - method='post'.upper(), - content_type=None, - accept_content_type=accept_content_type, - ) - -if __name__ == '__main__': - unittest.main() diff --git a/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_response_body_post_uri_format_response_body_for_content_types/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_response_body_post_uri_format_response_body_for_content_types/__init__.py index 0604e737101..e69de29bb2d 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_response_body_post_uri_format_response_body_for_content_types/__init__.py +++ b/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_response_body_post_uri_format_response_body_for_content_types/__init__.py @@ -1,217 +0,0 @@ -# coding: utf-8 - -""" - - - Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator -""" - -import unittest -from unittest.mock import patch - -import urllib3 - -import unit_test_api -from unit_test_api.paths.response_body_post_uri_format_response_body_for_content_types.post import operation as post # noqa: E501 -from unit_test_api import schemas, api_client -from unit_test_api.configurations import api_configuration, schema_configuration - -from .. import ApiTestMixin - - -class TestPost(ApiTestMixin, unittest.TestCase): - """ - Post unit test stubs - """ - api_config = api_configuration.ApiConfiguration() - schema_config = schema_configuration.SchemaConfiguration() - used_api_client = api_client.ApiClient(configuration=api_config, schema_config=schema_config) - api = post.ApiForPost(api_client=used_api_client) # noqa: E501 - - response_status = 200 - response_body_schema = post.response_200.ResponseFor200.content["application/json"].schema - - def test_all_string_formats_ignore_objects_passes(self): - # all string formats ignore objects - accept_content_type = 'application/json' - - with patch.object(urllib3.PoolManager, 'request') as mock_request: - payload = ( - { - } - ) - mock_request.return_value = self.response( - self.json_bytes(payload), - status=self.response_status - ) - api_response = self.api.post( - accept_content_types=(accept_content_type,) - ) - self.assert_pool_manager_request_called_with( - mock_request, - self.api_config.get_server_url('servers', None) + "/responseBody/postUriFormatResponseBodyForContentTypes", - method='post'.upper(), - accept_content_type=accept_content_type, - ) - - assert isinstance(api_response.response, urllib3.HTTPResponse) - assert isinstance(api_response.body, self.response_body_schema) - deserialized_response_body = self.response_body_schema.from_openapi_data_( - payload, - configuration_=self.schema_config - ) - assert api_response.body == deserialized_response_body - - def test_all_string_formats_ignore_booleans_passes(self): - # all string formats ignore booleans - accept_content_type = 'application/json' - - with patch.object(urllib3.PoolManager, 'request') as mock_request: - payload = ( - False - ) - mock_request.return_value = self.response( - self.json_bytes(payload), - status=self.response_status - ) - api_response = self.api.post( - accept_content_types=(accept_content_type,) - ) - self.assert_pool_manager_request_called_with( - mock_request, - self.api_config.get_server_url('servers', None) + "/responseBody/postUriFormatResponseBodyForContentTypes", - method='post'.upper(), - accept_content_type=accept_content_type, - ) - - assert isinstance(api_response.response, urllib3.HTTPResponse) - assert isinstance(api_response.body, self.response_body_schema) - deserialized_response_body = self.response_body_schema.from_openapi_data_( - payload, - configuration_=self.schema_config - ) - assert api_response.body == deserialized_response_body - - def test_all_string_formats_ignore_integers_passes(self): - # all string formats ignore integers - accept_content_type = 'application/json' - - with patch.object(urllib3.PoolManager, 'request') as mock_request: - payload = ( - 12 - ) - mock_request.return_value = self.response( - self.json_bytes(payload), - status=self.response_status - ) - api_response = self.api.post( - accept_content_types=(accept_content_type,) - ) - self.assert_pool_manager_request_called_with( - mock_request, - self.api_config.get_server_url('servers', None) + "/responseBody/postUriFormatResponseBodyForContentTypes", - method='post'.upper(), - accept_content_type=accept_content_type, - ) - - assert isinstance(api_response.response, urllib3.HTTPResponse) - assert isinstance(api_response.body, self.response_body_schema) - deserialized_response_body = self.response_body_schema.from_openapi_data_( - payload, - configuration_=self.schema_config - ) - assert api_response.body == deserialized_response_body - - def test_all_string_formats_ignore_floats_passes(self): - # all string formats ignore floats - accept_content_type = 'application/json' - - with patch.object(urllib3.PoolManager, 'request') as mock_request: - payload = ( - 13.7 - ) - mock_request.return_value = self.response( - self.json_bytes(payload), - status=self.response_status - ) - api_response = self.api.post( - accept_content_types=(accept_content_type,) - ) - self.assert_pool_manager_request_called_with( - mock_request, - self.api_config.get_server_url('servers', None) + "/responseBody/postUriFormatResponseBodyForContentTypes", - method='post'.upper(), - accept_content_type=accept_content_type, - ) - - assert isinstance(api_response.response, urllib3.HTTPResponse) - assert isinstance(api_response.body, self.response_body_schema) - deserialized_response_body = self.response_body_schema.from_openapi_data_( - payload, - configuration_=self.schema_config - ) - assert api_response.body == deserialized_response_body - - def test_all_string_formats_ignore_arrays_passes(self): - # all string formats ignore arrays - accept_content_type = 'application/json' - - with patch.object(urllib3.PoolManager, 'request') as mock_request: - payload = ( - [ - ] - ) - mock_request.return_value = self.response( - self.json_bytes(payload), - status=self.response_status - ) - api_response = self.api.post( - accept_content_types=(accept_content_type,) - ) - self.assert_pool_manager_request_called_with( - mock_request, - self.api_config.get_server_url('servers', None) + "/responseBody/postUriFormatResponseBodyForContentTypes", - method='post'.upper(), - accept_content_type=accept_content_type, - ) - - assert isinstance(api_response.response, urllib3.HTTPResponse) - assert isinstance(api_response.body, self.response_body_schema) - deserialized_response_body = self.response_body_schema.from_openapi_data_( - payload, - configuration_=self.schema_config - ) - assert api_response.body == deserialized_response_body - - def test_all_string_formats_ignore_nulls_passes(self): - # all string formats ignore nulls - accept_content_type = 'application/json' - - with patch.object(urllib3.PoolManager, 'request') as mock_request: - payload = ( - None - ) - mock_request.return_value = self.response( - self.json_bytes(payload), - status=self.response_status - ) - api_response = self.api.post( - accept_content_types=(accept_content_type,) - ) - self.assert_pool_manager_request_called_with( - mock_request, - self.api_config.get_server_url('servers', None) + "/responseBody/postUriFormatResponseBodyForContentTypes", - method='post'.upper(), - accept_content_type=accept_content_type, - ) - - assert isinstance(api_response.response, urllib3.HTTPResponse) - assert isinstance(api_response.body, self.response_body_schema) - deserialized_response_body = self.response_body_schema.from_openapi_data_( - payload, - configuration_=self.schema_config - ) - assert api_response.body == deserialized_response_body - -if __name__ == '__main__': - unittest.main() diff --git a/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_response_body_post_uri_reference_format_response_body_for_content_types/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_response_body_post_uri_reference_format_response_body_for_content_types/__init__.py index 2c5f5bef2c2..e69de29bb2d 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_response_body_post_uri_reference_format_response_body_for_content_types/__init__.py +++ b/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_response_body_post_uri_reference_format_response_body_for_content_types/__init__.py @@ -1,217 +0,0 @@ -# coding: utf-8 - -""" - - - Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator -""" - -import unittest -from unittest.mock import patch - -import urllib3 - -import unit_test_api -from unit_test_api.paths.response_body_post_uri_reference_format_response_body_for_content_types.post import operation as post # noqa: E501 -from unit_test_api import schemas, api_client -from unit_test_api.configurations import api_configuration, schema_configuration - -from .. import ApiTestMixin - - -class TestPost(ApiTestMixin, unittest.TestCase): - """ - Post unit test stubs - """ - api_config = api_configuration.ApiConfiguration() - schema_config = schema_configuration.SchemaConfiguration() - used_api_client = api_client.ApiClient(configuration=api_config, schema_config=schema_config) - api = post.ApiForPost(api_client=used_api_client) # noqa: E501 - - response_status = 200 - response_body_schema = post.response_200.ResponseFor200.content["application/json"].schema - - def test_all_string_formats_ignore_objects_passes(self): - # all string formats ignore objects - accept_content_type = 'application/json' - - with patch.object(urllib3.PoolManager, 'request') as mock_request: - payload = ( - { - } - ) - mock_request.return_value = self.response( - self.json_bytes(payload), - status=self.response_status - ) - api_response = self.api.post( - accept_content_types=(accept_content_type,) - ) - self.assert_pool_manager_request_called_with( - mock_request, - self.api_config.get_server_url('servers', None) + "/responseBody/postUriReferenceFormatResponseBodyForContentTypes", - method='post'.upper(), - accept_content_type=accept_content_type, - ) - - assert isinstance(api_response.response, urllib3.HTTPResponse) - assert isinstance(api_response.body, self.response_body_schema) - deserialized_response_body = self.response_body_schema.from_openapi_data_( - payload, - configuration_=self.schema_config - ) - assert api_response.body == deserialized_response_body - - def test_all_string_formats_ignore_booleans_passes(self): - # all string formats ignore booleans - accept_content_type = 'application/json' - - with patch.object(urllib3.PoolManager, 'request') as mock_request: - payload = ( - False - ) - mock_request.return_value = self.response( - self.json_bytes(payload), - status=self.response_status - ) - api_response = self.api.post( - accept_content_types=(accept_content_type,) - ) - self.assert_pool_manager_request_called_with( - mock_request, - self.api_config.get_server_url('servers', None) + "/responseBody/postUriReferenceFormatResponseBodyForContentTypes", - method='post'.upper(), - accept_content_type=accept_content_type, - ) - - assert isinstance(api_response.response, urllib3.HTTPResponse) - assert isinstance(api_response.body, self.response_body_schema) - deserialized_response_body = self.response_body_schema.from_openapi_data_( - payload, - configuration_=self.schema_config - ) - assert api_response.body == deserialized_response_body - - def test_all_string_formats_ignore_integers_passes(self): - # all string formats ignore integers - accept_content_type = 'application/json' - - with patch.object(urllib3.PoolManager, 'request') as mock_request: - payload = ( - 12 - ) - mock_request.return_value = self.response( - self.json_bytes(payload), - status=self.response_status - ) - api_response = self.api.post( - accept_content_types=(accept_content_type,) - ) - self.assert_pool_manager_request_called_with( - mock_request, - self.api_config.get_server_url('servers', None) + "/responseBody/postUriReferenceFormatResponseBodyForContentTypes", - method='post'.upper(), - accept_content_type=accept_content_type, - ) - - assert isinstance(api_response.response, urllib3.HTTPResponse) - assert isinstance(api_response.body, self.response_body_schema) - deserialized_response_body = self.response_body_schema.from_openapi_data_( - payload, - configuration_=self.schema_config - ) - assert api_response.body == deserialized_response_body - - def test_all_string_formats_ignore_floats_passes(self): - # all string formats ignore floats - accept_content_type = 'application/json' - - with patch.object(urllib3.PoolManager, 'request') as mock_request: - payload = ( - 13.7 - ) - mock_request.return_value = self.response( - self.json_bytes(payload), - status=self.response_status - ) - api_response = self.api.post( - accept_content_types=(accept_content_type,) - ) - self.assert_pool_manager_request_called_with( - mock_request, - self.api_config.get_server_url('servers', None) + "/responseBody/postUriReferenceFormatResponseBodyForContentTypes", - method='post'.upper(), - accept_content_type=accept_content_type, - ) - - assert isinstance(api_response.response, urllib3.HTTPResponse) - assert isinstance(api_response.body, self.response_body_schema) - deserialized_response_body = self.response_body_schema.from_openapi_data_( - payload, - configuration_=self.schema_config - ) - assert api_response.body == deserialized_response_body - - def test_all_string_formats_ignore_arrays_passes(self): - # all string formats ignore arrays - accept_content_type = 'application/json' - - with patch.object(urllib3.PoolManager, 'request') as mock_request: - payload = ( - [ - ] - ) - mock_request.return_value = self.response( - self.json_bytes(payload), - status=self.response_status - ) - api_response = self.api.post( - accept_content_types=(accept_content_type,) - ) - self.assert_pool_manager_request_called_with( - mock_request, - self.api_config.get_server_url('servers', None) + "/responseBody/postUriReferenceFormatResponseBodyForContentTypes", - method='post'.upper(), - accept_content_type=accept_content_type, - ) - - assert isinstance(api_response.response, urllib3.HTTPResponse) - assert isinstance(api_response.body, self.response_body_schema) - deserialized_response_body = self.response_body_schema.from_openapi_data_( - payload, - configuration_=self.schema_config - ) - assert api_response.body == deserialized_response_body - - def test_all_string_formats_ignore_nulls_passes(self): - # all string formats ignore nulls - accept_content_type = 'application/json' - - with patch.object(urllib3.PoolManager, 'request') as mock_request: - payload = ( - None - ) - mock_request.return_value = self.response( - self.json_bytes(payload), - status=self.response_status - ) - api_response = self.api.post( - accept_content_types=(accept_content_type,) - ) - self.assert_pool_manager_request_called_with( - mock_request, - self.api_config.get_server_url('servers', None) + "/responseBody/postUriReferenceFormatResponseBodyForContentTypes", - method='post'.upper(), - accept_content_type=accept_content_type, - ) - - assert isinstance(api_response.response, urllib3.HTTPResponse) - assert isinstance(api_response.body, self.response_body_schema) - deserialized_response_body = self.response_body_schema.from_openapi_data_( - payload, - configuration_=self.schema_config - ) - assert api_response.body == deserialized_response_body - -if __name__ == '__main__': - unittest.main() diff --git a/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_response_body_post_uri_template_format_response_body_for_content_types/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_response_body_post_uri_template_format_response_body_for_content_types/__init__.py index 75229d137c3..e69de29bb2d 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_response_body_post_uri_template_format_response_body_for_content_types/__init__.py +++ b/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_response_body_post_uri_template_format_response_body_for_content_types/__init__.py @@ -1,217 +0,0 @@ -# coding: utf-8 - -""" - - - Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator -""" - -import unittest -from unittest.mock import patch - -import urllib3 - -import unit_test_api -from unit_test_api.paths.response_body_post_uri_template_format_response_body_for_content_types.post import operation as post # noqa: E501 -from unit_test_api import schemas, api_client -from unit_test_api.configurations import api_configuration, schema_configuration - -from .. import ApiTestMixin - - -class TestPost(ApiTestMixin, unittest.TestCase): - """ - Post unit test stubs - """ - api_config = api_configuration.ApiConfiguration() - schema_config = schema_configuration.SchemaConfiguration() - used_api_client = api_client.ApiClient(configuration=api_config, schema_config=schema_config) - api = post.ApiForPost(api_client=used_api_client) # noqa: E501 - - response_status = 200 - response_body_schema = post.response_200.ResponseFor200.content["application/json"].schema - - def test_all_string_formats_ignore_objects_passes(self): - # all string formats ignore objects - accept_content_type = 'application/json' - - with patch.object(urllib3.PoolManager, 'request') as mock_request: - payload = ( - { - } - ) - mock_request.return_value = self.response( - self.json_bytes(payload), - status=self.response_status - ) - api_response = self.api.post( - accept_content_types=(accept_content_type,) - ) - self.assert_pool_manager_request_called_with( - mock_request, - self.api_config.get_server_url('servers', None) + "/responseBody/postUriTemplateFormatResponseBodyForContentTypes", - method='post'.upper(), - accept_content_type=accept_content_type, - ) - - assert isinstance(api_response.response, urllib3.HTTPResponse) - assert isinstance(api_response.body, self.response_body_schema) - deserialized_response_body = self.response_body_schema.from_openapi_data_( - payload, - configuration_=self.schema_config - ) - assert api_response.body == deserialized_response_body - - def test_all_string_formats_ignore_booleans_passes(self): - # all string formats ignore booleans - accept_content_type = 'application/json' - - with patch.object(urllib3.PoolManager, 'request') as mock_request: - payload = ( - False - ) - mock_request.return_value = self.response( - self.json_bytes(payload), - status=self.response_status - ) - api_response = self.api.post( - accept_content_types=(accept_content_type,) - ) - self.assert_pool_manager_request_called_with( - mock_request, - self.api_config.get_server_url('servers', None) + "/responseBody/postUriTemplateFormatResponseBodyForContentTypes", - method='post'.upper(), - accept_content_type=accept_content_type, - ) - - assert isinstance(api_response.response, urllib3.HTTPResponse) - assert isinstance(api_response.body, self.response_body_schema) - deserialized_response_body = self.response_body_schema.from_openapi_data_( - payload, - configuration_=self.schema_config - ) - assert api_response.body == deserialized_response_body - - def test_all_string_formats_ignore_integers_passes(self): - # all string formats ignore integers - accept_content_type = 'application/json' - - with patch.object(urllib3.PoolManager, 'request') as mock_request: - payload = ( - 12 - ) - mock_request.return_value = self.response( - self.json_bytes(payload), - status=self.response_status - ) - api_response = self.api.post( - accept_content_types=(accept_content_type,) - ) - self.assert_pool_manager_request_called_with( - mock_request, - self.api_config.get_server_url('servers', None) + "/responseBody/postUriTemplateFormatResponseBodyForContentTypes", - method='post'.upper(), - accept_content_type=accept_content_type, - ) - - assert isinstance(api_response.response, urllib3.HTTPResponse) - assert isinstance(api_response.body, self.response_body_schema) - deserialized_response_body = self.response_body_schema.from_openapi_data_( - payload, - configuration_=self.schema_config - ) - assert api_response.body == deserialized_response_body - - def test_all_string_formats_ignore_floats_passes(self): - # all string formats ignore floats - accept_content_type = 'application/json' - - with patch.object(urllib3.PoolManager, 'request') as mock_request: - payload = ( - 13.7 - ) - mock_request.return_value = self.response( - self.json_bytes(payload), - status=self.response_status - ) - api_response = self.api.post( - accept_content_types=(accept_content_type,) - ) - self.assert_pool_manager_request_called_with( - mock_request, - self.api_config.get_server_url('servers', None) + "/responseBody/postUriTemplateFormatResponseBodyForContentTypes", - method='post'.upper(), - accept_content_type=accept_content_type, - ) - - assert isinstance(api_response.response, urllib3.HTTPResponse) - assert isinstance(api_response.body, self.response_body_schema) - deserialized_response_body = self.response_body_schema.from_openapi_data_( - payload, - configuration_=self.schema_config - ) - assert api_response.body == deserialized_response_body - - def test_all_string_formats_ignore_arrays_passes(self): - # all string formats ignore arrays - accept_content_type = 'application/json' - - with patch.object(urllib3.PoolManager, 'request') as mock_request: - payload = ( - [ - ] - ) - mock_request.return_value = self.response( - self.json_bytes(payload), - status=self.response_status - ) - api_response = self.api.post( - accept_content_types=(accept_content_type,) - ) - self.assert_pool_manager_request_called_with( - mock_request, - self.api_config.get_server_url('servers', None) + "/responseBody/postUriTemplateFormatResponseBodyForContentTypes", - method='post'.upper(), - accept_content_type=accept_content_type, - ) - - assert isinstance(api_response.response, urllib3.HTTPResponse) - assert isinstance(api_response.body, self.response_body_schema) - deserialized_response_body = self.response_body_schema.from_openapi_data_( - payload, - configuration_=self.schema_config - ) - assert api_response.body == deserialized_response_body - - def test_all_string_formats_ignore_nulls_passes(self): - # all string formats ignore nulls - accept_content_type = 'application/json' - - with patch.object(urllib3.PoolManager, 'request') as mock_request: - payload = ( - None - ) - mock_request.return_value = self.response( - self.json_bytes(payload), - status=self.response_status - ) - api_response = self.api.post( - accept_content_types=(accept_content_type,) - ) - self.assert_pool_manager_request_called_with( - mock_request, - self.api_config.get_server_url('servers', None) + "/responseBody/postUriTemplateFormatResponseBodyForContentTypes", - method='post'.upper(), - accept_content_type=accept_content_type, - ) - - assert isinstance(api_response.response, urllib3.HTTPResponse) - assert isinstance(api_response.body, self.response_body_schema) - deserialized_response_body = self.response_body_schema.from_openapi_data_( - payload, - configuration_=self.schema_config - ) - assert api_response.body == deserialized_response_body - -if __name__ == '__main__': - unittest.main() diff --git a/samples/openapi3/client/features/nonCompliantUseDiscriminatorIfCompositionFails/python/src/this_package/paths/operators/post/operation.py b/samples/openapi3/client/features/nonCompliantUseDiscriminatorIfCompositionFails/python/src/this_package/paths/operators/post/operation.py index 756798e7be2..943b994e91d 100644 --- a/samples/openapi3/client/features/nonCompliantUseDiscriminatorIfCompositionFails/python/src/this_package/paths/operators/post/operation.py +++ b/samples/openapi3/client/features/nonCompliantUseDiscriminatorIfCompositionFails/python/src/this_package/paths/operators/post/operation.py @@ -237,7 +237,8 @@ class instances status: typing_extensions.Literal[ '200', ] - api_response = _status_code_to_response[status].deserialize(response, self.api_client.schema_configuration) + api_response = _status_code_to_response[status].deserialize( + response, self.api_client.schema_configuration) else: api_response = api_client.ApiResponseWithoutDeserialization(response=response) diff --git a/samples/openapi3/client/features/nonCompliantUseDiscriminatorIfCompositionFails/python/test/test_paths/test_operators/__init__.py b/samples/openapi3/client/features/nonCompliantUseDiscriminatorIfCompositionFails/python/test/test_paths/test_operators/__init__.py index 0ffc30ce3a8..e69de29bb2d 100644 --- a/samples/openapi3/client/features/nonCompliantUseDiscriminatorIfCompositionFails/python/test/test_paths/test_operators/__init__.py +++ b/samples/openapi3/client/features/nonCompliantUseDiscriminatorIfCompositionFails/python/test/test_paths/test_operators/__init__.py @@ -1,35 +0,0 @@ -# coding: utf-8 - -""" - - - Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator -""" - -import unittest -from unittest.mock import patch - -import urllib3 - -import this_package -from this_package.paths.operators.post import operation as post # noqa: E501 -from this_package import schemas, api_client -from this_package.configurations import api_configuration, schema_configuration - -from .. import ApiTestMixin - - -class TestPost(ApiTestMixin, unittest.TestCase): - """ - Post unit test stubs - """ - api_config = api_configuration.ApiConfiguration() - schema_config = schema_configuration.SchemaConfiguration() - used_api_client = api_client.ApiClient(configuration=api_config, schema_config=schema_config) - api = post.ApiForPost(api_client=used_api_client) # noqa: E501 - - response_status = 200 - response_body = '' - -if __name__ == '__main__': - unittest.main() diff --git a/samples/openapi3/client/features/security/python/src/this_package/paths/path_with_no_explicit_security/get/operation.py b/samples/openapi3/client/features/security/python/src/this_package/paths/path_with_no_explicit_security/get/operation.py index 0a1b919eb73..20d56082394 100644 --- a/samples/openapi3/client/features/security/python/src/this_package/paths/path_with_no_explicit_security/get/operation.py +++ b/samples/openapi3/client/features/security/python/src/this_package/paths/path_with_no_explicit_security/get/operation.py @@ -106,7 +106,8 @@ class instances status: typing_extensions.Literal[ '200', ] - api_response = _status_code_to_response[status].deserialize(response, self.api_client.schema_configuration) + api_response = _status_code_to_response[status].deserialize( + response, self.api_client.schema_configuration) else: api_response = api_client.ApiResponseWithoutDeserialization(response=response) diff --git a/samples/openapi3/client/features/security/python/src/this_package/paths/path_with_one_explicit_security/get/operation.py b/samples/openapi3/client/features/security/python/src/this_package/paths/path_with_one_explicit_security/get/operation.py index 3ec64c82018..2f2ff6e8182 100644 --- a/samples/openapi3/client/features/security/python/src/this_package/paths/path_with_one_explicit_security/get/operation.py +++ b/samples/openapi3/client/features/security/python/src/this_package/paths/path_with_one_explicit_security/get/operation.py @@ -121,7 +121,8 @@ class instances status: typing_extensions.Literal[ '200', ] - api_response = _status_code_to_response[status].deserialize(response, self.api_client.schema_configuration) + api_response = _status_code_to_response[status].deserialize( + response, self.api_client.schema_configuration) else: api_response = api_client.ApiResponseWithoutDeserialization(response=response) diff --git a/samples/openapi3/client/features/security/python/src/this_package/paths/path_with_security_from_root/get/operation.py b/samples/openapi3/client/features/security/python/src/this_package/paths/path_with_security_from_root/get/operation.py index 0df615399a5..9d24a8b4cd5 100644 --- a/samples/openapi3/client/features/security/python/src/this_package/paths/path_with_security_from_root/get/operation.py +++ b/samples/openapi3/client/features/security/python/src/this_package/paths/path_with_security_from_root/get/operation.py @@ -129,7 +129,8 @@ class instances status: typing_extensions.Literal[ '200', ] - api_response = _status_code_to_response[status].deserialize(response, self.api_client.schema_configuration) + api_response = _status_code_to_response[status].deserialize( + response, self.api_client.schema_configuration) else: api_response = api_client.ApiResponseWithoutDeserialization(response=response) diff --git a/samples/openapi3/client/features/security/python/src/this_package/paths/path_with_two_explicit_security/get/operation.py b/samples/openapi3/client/features/security/python/src/this_package/paths/path_with_two_explicit_security/get/operation.py index 31f68edd2b8..771c2a088d1 100644 --- a/samples/openapi3/client/features/security/python/src/this_package/paths/path_with_two_explicit_security/get/operation.py +++ b/samples/openapi3/client/features/security/python/src/this_package/paths/path_with_two_explicit_security/get/operation.py @@ -125,7 +125,8 @@ class instances status: typing_extensions.Literal[ '200', ] - api_response = _status_code_to_response[status].deserialize(response, self.api_client.schema_configuration) + api_response = _status_code_to_response[status].deserialize( + response, self.api_client.schema_configuration) else: api_response = api_client.ApiResponseWithoutDeserialization(response=response) diff --git a/samples/openapi3/client/features/security/python/test/test_paths/test_path_with_no_explicit_security/__init__.py b/samples/openapi3/client/features/security/python/test/test_paths/test_path_with_no_explicit_security/__init__.py index c67de147f3a..e69de29bb2d 100644 --- a/samples/openapi3/client/features/security/python/test/test_paths/test_path_with_no_explicit_security/__init__.py +++ b/samples/openapi3/client/features/security/python/test/test_paths/test_path_with_no_explicit_security/__init__.py @@ -1,36 +0,0 @@ -# coding: utf-8 - -""" - - - Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator -""" - -import unittest -from unittest.mock import patch - -import urllib3 - -import this_package -from this_package.paths.path_with_no_explicit_security.get import operation as get # noqa: E501 -from this_package import schemas, api_client -from this_package.configurations import api_configuration, schema_configuration - -from .. import ApiTestMixin - - -class TestGet(ApiTestMixin, unittest.TestCase): - """ - Get unit test stubs - path with no explicit security # noqa: E501 - """ - api_config = api_configuration.ApiConfiguration() - schema_config = schema_configuration.SchemaConfiguration() - used_api_client = api_client.ApiClient(configuration=api_config, schema_config=schema_config) - api = get.ApiForGet(api_client=used_api_client) # noqa: E501 - - response_status = 200 - response_body = '' - -if __name__ == '__main__': - unittest.main() diff --git a/samples/openapi3/client/features/security/python/test/test_paths/test_path_with_one_explicit_security/__init__.py b/samples/openapi3/client/features/security/python/test/test_paths/test_path_with_one_explicit_security/__init__.py index 09575bc6f92..e69de29bb2d 100644 --- a/samples/openapi3/client/features/security/python/test/test_paths/test_path_with_one_explicit_security/__init__.py +++ b/samples/openapi3/client/features/security/python/test/test_paths/test_path_with_one_explicit_security/__init__.py @@ -1,36 +0,0 @@ -# coding: utf-8 - -""" - - - Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator -""" - -import unittest -from unittest.mock import patch - -import urllib3 - -import this_package -from this_package.paths.path_with_one_explicit_security.get import operation as get # noqa: E501 -from this_package import schemas, api_client -from this_package.configurations import api_configuration, schema_configuration - -from .. import ApiTestMixin - - -class TestGet(ApiTestMixin, unittest.TestCase): - """ - Get unit test stubs - path with one explicit security # noqa: E501 - """ - api_config = api_configuration.ApiConfiguration() - schema_config = schema_configuration.SchemaConfiguration() - used_api_client = api_client.ApiClient(configuration=api_config, schema_config=schema_config) - api = get.ApiForGet(api_client=used_api_client) # noqa: E501 - - response_status = 200 - response_body = '' - -if __name__ == '__main__': - unittest.main() diff --git a/samples/openapi3/client/features/security/python/test/test_paths/test_path_with_security_from_root/__init__.py b/samples/openapi3/client/features/security/python/test/test_paths/test_path_with_security_from_root/__init__.py index ea4c0d9109d..e69de29bb2d 100644 --- a/samples/openapi3/client/features/security/python/test/test_paths/test_path_with_security_from_root/__init__.py +++ b/samples/openapi3/client/features/security/python/test/test_paths/test_path_with_security_from_root/__init__.py @@ -1,36 +0,0 @@ -# coding: utf-8 - -""" - - - Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator -""" - -import unittest -from unittest.mock import patch - -import urllib3 - -import this_package -from this_package.paths.path_with_security_from_root.get import operation as get # noqa: E501 -from this_package import schemas, api_client -from this_package.configurations import api_configuration, schema_configuration - -from .. import ApiTestMixin - - -class TestGet(ApiTestMixin, unittest.TestCase): - """ - Get unit test stubs - path with security from root # noqa: E501 - """ - api_config = api_configuration.ApiConfiguration() - schema_config = schema_configuration.SchemaConfiguration() - used_api_client = api_client.ApiClient(configuration=api_config, schema_config=schema_config) - api = get.ApiForGet(api_client=used_api_client) # noqa: E501 - - response_status = 200 - response_body = '' - -if __name__ == '__main__': - unittest.main() diff --git a/samples/openapi3/client/features/security/python/test/test_paths/test_path_with_two_explicit_security/__init__.py b/samples/openapi3/client/features/security/python/test/test_paths/test_path_with_two_explicit_security/__init__.py index 67d8a3b7dff..e69de29bb2d 100644 --- a/samples/openapi3/client/features/security/python/test/test_paths/test_path_with_two_explicit_security/__init__.py +++ b/samples/openapi3/client/features/security/python/test/test_paths/test_path_with_two_explicit_security/__init__.py @@ -1,36 +0,0 @@ -# coding: utf-8 - -""" - - - Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator -""" - -import unittest -from unittest.mock import patch - -import urllib3 - -import this_package -from this_package.paths.path_with_two_explicit_security.get import operation as get # noqa: E501 -from this_package import schemas, api_client -from this_package.configurations import api_configuration, schema_configuration - -from .. import ApiTestMixin - - -class TestGet(ApiTestMixin, unittest.TestCase): - """ - Get unit test stubs - path with two explicit security # noqa: E501 - """ - api_config = api_configuration.ApiConfiguration() - schema_config = schema_configuration.SchemaConfiguration() - used_api_client = api_client.ApiClient(configuration=api_config, schema_config=schema_config) - api = get.ApiForGet(api_client=used_api_client) # noqa: E501 - - response_status = 200 - response_body = '' - -if __name__ == '__main__': - unittest.main() diff --git a/samples/openapi3/client/petstore/python/.openapi-generator/FILES b/samples/openapi3/client/petstore/python/.openapi-generator/FILES index 0176f80ee2f..360f0cb76f0 100644 --- a/samples/openapi3/client/petstore/python/.openapi-generator/FILES +++ b/samples/openapi3/client/petstore/python/.openapi-generator/FILES @@ -205,6 +205,7 @@ docs/paths/fake_test_query_paramters/put.md docs/paths/fake_upload_download_file/post.md docs/paths/fake_upload_file/post.md docs/paths/fake_upload_files/post.md +docs/paths/fake_wild_card_responses/get.md docs/paths/foo/get.md docs/paths/pet/post.md docs/paths/pet/put.md @@ -273,6 +274,7 @@ src/petstore_api/apis/paths/fake_test_query_paramters.py src/petstore_api/apis/paths/fake_upload_download_file.py src/petstore_api/apis/paths/fake_upload_file.py src/petstore_api/apis/paths/fake_upload_files.py +src/petstore_api/apis/paths/fake_wild_card_responses.py src/petstore_api/apis/paths/foo.py src/petstore_api/apis/paths/pet.py src/petstore_api/apis/paths/pet_find_by_status.py @@ -1007,6 +1009,34 @@ src/petstore_api/paths/fake_upload_files/post/responses/response_200/__init__.py src/petstore_api/paths/fake_upload_files/post/responses/response_200/content/__init__.py src/petstore_api/paths/fake_upload_files/post/responses/response_200/content/application_json/__init__.py src/petstore_api/paths/fake_upload_files/post/responses/response_200/content/application_json/schema.py +src/petstore_api/paths/fake_wild_card_responses/__init__.py +src/petstore_api/paths/fake_wild_card_responses/get/__init__.py +src/petstore_api/paths/fake_wild_card_responses/get/operation.py +src/petstore_api/paths/fake_wild_card_responses/get/responses/__init__.py +src/petstore_api/paths/fake_wild_card_responses/get/responses/response_1xx/__init__.py +src/petstore_api/paths/fake_wild_card_responses/get/responses/response_1xx/content/__init__.py +src/petstore_api/paths/fake_wild_card_responses/get/responses/response_1xx/content/application_json/__init__.py +src/petstore_api/paths/fake_wild_card_responses/get/responses/response_1xx/content/application_json/schema.py +src/petstore_api/paths/fake_wild_card_responses/get/responses/response_200/__init__.py +src/petstore_api/paths/fake_wild_card_responses/get/responses/response_200/content/__init__.py +src/petstore_api/paths/fake_wild_card_responses/get/responses/response_200/content/application_json/__init__.py +src/petstore_api/paths/fake_wild_card_responses/get/responses/response_200/content/application_json/schema.py +src/petstore_api/paths/fake_wild_card_responses/get/responses/response_2xx/__init__.py +src/petstore_api/paths/fake_wild_card_responses/get/responses/response_2xx/content/__init__.py +src/petstore_api/paths/fake_wild_card_responses/get/responses/response_2xx/content/application_json/__init__.py +src/petstore_api/paths/fake_wild_card_responses/get/responses/response_2xx/content/application_json/schema.py +src/petstore_api/paths/fake_wild_card_responses/get/responses/response_3xx/__init__.py +src/petstore_api/paths/fake_wild_card_responses/get/responses/response_3xx/content/__init__.py +src/petstore_api/paths/fake_wild_card_responses/get/responses/response_3xx/content/application_json/__init__.py +src/petstore_api/paths/fake_wild_card_responses/get/responses/response_3xx/content/application_json/schema.py +src/petstore_api/paths/fake_wild_card_responses/get/responses/response_4xx/__init__.py +src/petstore_api/paths/fake_wild_card_responses/get/responses/response_4xx/content/__init__.py +src/petstore_api/paths/fake_wild_card_responses/get/responses/response_4xx/content/application_json/__init__.py +src/petstore_api/paths/fake_wild_card_responses/get/responses/response_4xx/content/application_json/schema.py +src/petstore_api/paths/fake_wild_card_responses/get/responses/response_5xx/__init__.py +src/petstore_api/paths/fake_wild_card_responses/get/responses/response_5xx/content/__init__.py +src/petstore_api/paths/fake_wild_card_responses/get/responses/response_5xx/content/application_json/__init__.py +src/petstore_api/paths/fake_wild_card_responses/get/responses/response_5xx/content/application_json/schema.py src/petstore_api/paths/foo/__init__.py src/petstore_api/paths/foo/get/__init__.py src/petstore_api/paths/foo/get/operation.py @@ -1327,12 +1357,10 @@ test/test_paths/__init__.py test/test_paths/__init__.py test/test_paths/__init__.py test/test_paths/__init__.py +test/test_paths/__init__.py test/test_paths/test_another_fake_dummy/__init__.py test/test_paths/test_another_fake_dummy/test_patch.py test/test_paths/test_fake/__init__.py -test/test_paths/test_fake/__init__.py -test/test_paths/test_fake/__init__.py -test/test_paths/test_fake/__init__.py test/test_paths/test_fake/test_delete.py test/test_paths/test_fake/test_get.py test/test_paths/test_fake/test_patch.py @@ -1403,10 +1431,11 @@ test/test_paths/test_fake_upload_file/__init__.py test/test_paths/test_fake_upload_file/test_post.py test/test_paths/test_fake_upload_files/__init__.py test/test_paths/test_fake_upload_files/test_post.py +test/test_paths/test_fake_wild_card_responses/__init__.py +test/test_paths/test_fake_wild_card_responses/test_get.py test/test_paths/test_foo/__init__.py test/test_paths/test_foo/test_get.py test/test_paths/test_pet/__init__.py -test/test_paths/test_pet/__init__.py test/test_paths/test_pet/test_post.py test/test_paths/test_pet/test_put.py test/test_paths/test_pet_find_by_status/__init__.py @@ -1414,8 +1443,6 @@ test/test_paths/test_pet_find_by_status/test_get.py test/test_paths/test_pet_find_by_tags/__init__.py test/test_paths/test_pet_find_by_tags/test_get.py test/test_paths/test_pet_pet_id/__init__.py -test/test_paths/test_pet_pet_id/__init__.py -test/test_paths/test_pet_pet_id/__init__.py test/test_paths/test_pet_pet_id/test_delete.py test/test_paths/test_pet_pet_id/test_get.py test/test_paths/test_pet_pet_id/test_post.py @@ -1426,7 +1453,6 @@ test/test_paths/test_store_inventory/test_get.py test/test_paths/test_store_order/__init__.py test/test_paths/test_store_order/test_post.py test/test_paths/test_store_order_order_id/__init__.py -test/test_paths/test_store_order_order_id/__init__.py test/test_paths/test_store_order_order_id/test_delete.py test/test_paths/test_store_order_order_id/test_get.py test/test_paths/test_user/__init__.py @@ -1440,8 +1466,6 @@ test/test_paths/test_user_login/test_get.py test/test_paths/test_user_logout/__init__.py test/test_paths/test_user_logout/test_get.py test/test_paths/test_user_username/__init__.py -test/test_paths/test_user_username/__init__.py -test/test_paths/test_user_username/__init__.py test/test_paths/test_user_username/test_delete.py test/test_paths/test_user_username/test_get.py test/test_paths/test_user_username/test_put.py diff --git a/samples/openapi3/client/petstore/python/README.md b/samples/openapi3/client/petstore/python/README.md index f1a57b64489..ac25d4c3691 100644 --- a/samples/openapi3/client/petstore/python/README.md +++ b/samples/openapi3/client/petstore/python/README.md @@ -249,6 +249,7 @@ HTTP request | Method | Description /fake/uploadDownloadFile **post** | [FakeApi](docs/apis/tags/fake_api.md).[upload_download_file](docs/paths/fake_upload_download_file/post.md) | uploads a file and downloads a file using application/octet-stream /fake/uploadFile **post** | [FakeApi](docs/apis/tags/fake_api.md).[upload_file](docs/paths/fake_upload_file/post.md) | uploads a file using multipart/form-data /fake/uploadFiles **post** | [FakeApi](docs/apis/tags/fake_api.md).[upload_files](docs/paths/fake_upload_files/post.md) | uploads files using multipart/form-data +/fake/wildCardResponses **get** | [FakeApi](docs/apis/tags/fake_api.md).[wild_card_responses](docs/paths/fake_wild_card_responses/get.md) | operation with wildcard responses /fake/{petId}/uploadImageWithRequiredFile **post** | [PetApi](docs/apis/tags/pet_api.md).[upload_file_with_required_file](docs/paths/fake_pet_id_upload_image_with_required_file/post.md) | uploads an image (required) /fake_classname_test **patch** | [FakeClassnameTags123Api](docs/apis/tags/fake_classname_tags123_api.md).[classname](docs/paths/fake_classname_test/patch.md) | To test class name in snake case /foo **get** | [DefaultApi](docs/apis/tags/default_api.md).[foo_get](docs/paths/foo/get.md) | diff --git a/samples/openapi3/client/petstore/python/docs/apis/tags/fake_api.md b/samples/openapi3/client/petstore/python/docs/apis/tags/fake_api.md index 48920a07cb5..9ced55d55f5 100644 --- a/samples/openapi3/client/petstore/python/docs/apis/tags/fake_api.md +++ b/samples/openapi3/client/petstore/python/docs/apis/tags/fake_api.md @@ -44,5 +44,6 @@ Method | Description [**upload_download_file**](../../paths/fake_upload_download_file/post.md) | uploads a file and downloads a file using application/octet-stream [**upload_file**](../../paths/fake_upload_file/post.md) | uploads a file using multipart/form-data [**upload_files**](../../paths/fake_upload_files/post.md) | uploads files using multipart/form-data +[**wild_card_responses**](../../paths/fake_wild_card_responses/get.md) | operation with wildcard responses [[Back to top]](#top) [[Back to Endpoints]](../../../README.md#Endpoints) [[Back to README]](../../../README.md) diff --git a/samples/openapi3/client/petstore/python/docs/paths/fake_wild_card_responses/get.md b/samples/openapi3/client/petstore/python/docs/paths/fake_wild_card_responses/get.md new file mode 100644 index 00000000000..8a05219793d --- /dev/null +++ b/samples/openapi3/client/petstore/python/docs/paths/fake_wild_card_responses/get.md @@ -0,0 +1,235 @@ +petstore_api.paths.fake_wild_card_responses.operation +# Operation Method Name + +| Method Name | Api Class | Notes | +| ----------- | --------- | ----- | +| wild_card_responses | [FakeApi](../../apis/tags/fake_api.md) | This api is only for tag=fake | +| get | ApiForGet | This api is only for this endpoint | +| get | FakeWildCardResponses | This api is only for path=/fake/wildCardResponses | + +## Table of Contents +- [General Info](#general-info) +- [Arguments](#arguments) +- [Return Types](#return-types) +- [Servers](#servers) +- [Code Sample](#code-sample) + +## General Info +| Field | Value | +| ----- | ----- | +| Summary | operation with wildcard responses | +| Path | "/fake/wildCardResponses" | +| HTTP Method | get | + +## Arguments + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +accept_content_types | typing.Tuple[str] | default is ("application/json", ) | Tells the server the content type(s) that are accepted by the client +server_index | typing.Optional[int] | default is None | Allows one to select a different server +stream | bool | default is False | if True then the response.content will be streamed and loaded from a file like object. When downloading a file, set this to True to force the code to deserialize the content to a FileSchema file +timeout | typing.Optional[typing.Union[int, typing.Tuple]] | default is None | the timeout used by the rest client +skip_deserialization | bool | default is False | when True, headers and body will be unset and an instance of api_client.ApiResponseWithoutDeserialization will be returned + +## Return Types + +HTTP Status Code | Class | Description +------------- | ------------- | ------------- +n/a | api_client.ApiResponseWithoutDeserialization | When skip_deserialization is True this response is returned +1XX | [ResponseFor1XX.response_cls](#responsefor1xx-response_cls) | 1XX response +200 | [ResponseFor200.response_cls](#responsefor200-response_cls) | success +2XX | [ResponseFor2XX.response_cls](#responsefor2xx-response_cls) | 2XX response +3XX | [ResponseFor3XX.response_cls](#responsefor3xx-response_cls) | 3XX response +4XX | [ResponseFor4XX.response_cls](#responsefor4xx-response_cls) | 4XX response +5XX | [ResponseFor5XX.response_cls](#responsefor5xx-response_cls) | 5XX response + +## ResponseFor1XX + +### Description +1XX response + +### ResponseFor1XX response_cls +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +response | urllib3.HTTPResponse | Raw response | +[body](#responsefor1xx-body) | [content.application_json.schema](#responsefor1xx-content-applicationjson-schema) | | +headers | Unset | headers were not defined | + +### ResponseFor1XX Body +Content-Type | Schema +------------ | ------- +"application/json" | [content.application_json.Schema](#responsefor1xx-content-applicationjson-schema) + +### Body Details +#### ResponseFor1XX content ApplicationJson Schema + +##### Type Info +Input Type | Accessed Type | Description | Notes +------------ | ------------- | ------------- | ------------- +dict, frozendict.frozendict, str, datetime.date, datetime.datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader | frozendict.frozendict, str, decimal.Decimal, BoolClass, NoneClass, tuple, bytes, io.FileIO | | + +## ResponseFor200 + +### Description +success + +### ResponseFor200 response_cls +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +response | urllib3.HTTPResponse | Raw response | +[body](#responsefor200-body) | [content.application_json.schema](#responsefor200-content-applicationjson-schema) | | +headers | Unset | headers were not defined | + +### ResponseFor200 Body +Content-Type | Schema +------------ | ------- +"application/json" | [content.application_json.Schema](#responsefor200-content-applicationjson-schema) + +### Body Details +#### ResponseFor200 content ApplicationJson Schema + +##### Type Info +Input Type | Accessed Type | Description | Notes +------------ | ------------- | ------------- | ------------- +dict, frozendict.frozendict, str, datetime.date, datetime.datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader | frozendict.frozendict, str, decimal.Decimal, BoolClass, NoneClass, tuple, bytes, io.FileIO | | + +## ResponseFor2XX + +### Description +2XX response + +### ResponseFor2XX response_cls +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +response | urllib3.HTTPResponse | Raw response | +[body](#responsefor2xx-body) | [content.application_json.schema](#responsefor2xx-content-applicationjson-schema) | | +headers | Unset | headers were not defined | + +### ResponseFor2XX Body +Content-Type | Schema +------------ | ------- +"application/json" | [content.application_json.Schema](#responsefor2xx-content-applicationjson-schema) + +### Body Details +#### ResponseFor2XX content ApplicationJson Schema + +##### Type Info +Input Type | Accessed Type | Description | Notes +------------ | ------------- | ------------- | ------------- +dict, frozendict.frozendict, str, datetime.date, datetime.datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader | frozendict.frozendict, str, decimal.Decimal, BoolClass, NoneClass, tuple, bytes, io.FileIO | | + +## ResponseFor3XX + +### Description +3XX response + +### ResponseFor3XX response_cls +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +response | urllib3.HTTPResponse | Raw response | +[body](#responsefor3xx-body) | [content.application_json.schema](#responsefor3xx-content-applicationjson-schema) | | +headers | Unset | headers were not defined | + +### ResponseFor3XX Body +Content-Type | Schema +------------ | ------- +"application/json" | [content.application_json.Schema](#responsefor3xx-content-applicationjson-schema) + +### Body Details +#### ResponseFor3XX content ApplicationJson Schema + +##### Type Info +Input Type | Accessed Type | Description | Notes +------------ | ------------- | ------------- | ------------- +dict, frozendict.frozendict, str, datetime.date, datetime.datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader | frozendict.frozendict, str, decimal.Decimal, BoolClass, NoneClass, tuple, bytes, io.FileIO | | + +## ResponseFor4XX + +### Description +4XX response + +### ResponseFor4XX response_cls +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +response | urllib3.HTTPResponse | Raw response | +[body](#responsefor4xx-body) | [content.application_json.schema](#responsefor4xx-content-applicationjson-schema) | | +headers | Unset | headers were not defined | + +### ResponseFor4XX Body +Content-Type | Schema +------------ | ------- +"application/json" | [content.application_json.Schema](#responsefor4xx-content-applicationjson-schema) + +### Body Details +#### ResponseFor4XX content ApplicationJson Schema + +##### Type Info +Input Type | Accessed Type | Description | Notes +------------ | ------------- | ------------- | ------------- +dict, frozendict.frozendict, str, datetime.date, datetime.datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader | frozendict.frozendict, str, decimal.Decimal, BoolClass, NoneClass, tuple, bytes, io.FileIO | | + +## ResponseFor5XX + +### Description +5XX response + +### ResponseFor5XX response_cls +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +response | urllib3.HTTPResponse | Raw response | +[body](#responsefor5xx-body) | [content.application_json.schema](#responsefor5xx-content-applicationjson-schema) | | +headers | Unset | headers were not defined | + +### ResponseFor5XX Body +Content-Type | Schema +------------ | ------- +"application/json" | [content.application_json.Schema](#responsefor5xx-content-applicationjson-schema) + +### Body Details +#### ResponseFor5XX content ApplicationJson Schema + +##### Type Info +Input Type | Accessed Type | Description | Notes +------------ | ------------- | ------------- | ------------- +dict, frozendict.frozendict, str, datetime.date, datetime.datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader | frozendict.frozendict, str, decimal.Decimal, BoolClass, NoneClass, tuple, bytes, io.FileIO | | + +## Servers + +Set the available servers by defining your used servers in ApiConfiguration.server_info +Then select your server by setting a server index in ApiConfiguration.server_index_info or by +passing server_index in to the endpoint method. +- these servers are the general api servers +- defaults to server_index=0, server.url = http://petstore.swagger.io:80/v2 + +server_index | Class | Description +------------ | ----- | ------------ +0 | [Server0](../../../servers/server_0.md) | petstore server +1 | [Server1](../../../servers/server_1.md) | The local server +2 | [Server2](../../../servers/server_2.md) | staging server with no variables + +## Code Sample + +```python +import petstore_api +from petstore_api.configurations import api_configuration +from petstore_api.apis.tags import fake_api +from pprint import pprint +used_configuration = api_configuration.ApiConfiguration( +) +# Enter a context with an instance of the API client +with petstore_api.ApiClient(used_configuration) as api_client: + # Create an instance of the API class + api_instance = fake_api.FakeApi(api_client) + + # example, this endpoint has no required or optional parameters + try: + # operation with wildcard responses + api_response = api_instance.wild_card_responses() + pprint(api_response) + except petstore_api.ApiException as e: + print("Exception when calling FakeApi->wild_card_responses: %s\n" % e) +``` + +[[Back to top]](#top) +[[Back to FakeApi API]](../../apis/tags/fake_api.md) +[[Back to Endpoints]](../../../README.md#Endpoints) [[Back to README]](../../../README.md) \ No newline at end of file diff --git a/samples/openapi3/client/petstore/python/src/petstore_api/apis/path_to_api.py b/samples/openapi3/client/petstore/python/src/petstore_api/apis/path_to_api.py index a135c4ce714..783a5d94372 100644 --- a/samples/openapi3/client/petstore/python/src/petstore_api/apis/path_to_api.py +++ b/samples/openapi3/client/petstore/python/src/petstore_api/apis/path_to_api.py @@ -34,6 +34,7 @@ from petstore_api.apis.paths.fake_upload_download_file import FakeUploadDownloadFile from petstore_api.apis.paths.fake_upload_file import FakeUploadFile from petstore_api.apis.paths.fake_upload_files import FakeUploadFiles +from petstore_api.apis.paths.fake_wild_card_responses import FakeWildCardResponses from petstore_api.apis.paths.fake_pet_id_upload_image_with_required_file import FakePetIdUploadImageWithRequiredFile from petstore_api.apis.paths.fake_classname_test import FakeClassnameTest from petstore_api.apis.paths.foo import Foo @@ -88,6 +89,7 @@ "/fake/uploadDownloadFile": typing.Type[FakeUploadDownloadFile], "/fake/uploadFile": typing.Type[FakeUploadFile], "/fake/uploadFiles": typing.Type[FakeUploadFiles], + "/fake/wildCardResponses": typing.Type[FakeWildCardResponses], "/fake/{petId}/uploadImageWithRequiredFile": typing.Type[FakePetIdUploadImageWithRequiredFile], "/fake_classname_test": typing.Type[FakeClassnameTest], "/foo": typing.Type[Foo], @@ -143,6 +145,7 @@ "/fake/uploadDownloadFile": FakeUploadDownloadFile, "/fake/uploadFile": FakeUploadFile, "/fake/uploadFiles": FakeUploadFiles, + "/fake/wildCardResponses": FakeWildCardResponses, "/fake/{petId}/uploadImageWithRequiredFile": FakePetIdUploadImageWithRequiredFile, "/fake_classname_test": FakeClassnameTest, "/foo": Foo, diff --git a/samples/openapi3/client/petstore/python/src/petstore_api/apis/paths/fake_wild_card_responses.py b/samples/openapi3/client/petstore/python/src/petstore_api/apis/paths/fake_wild_card_responses.py new file mode 100644 index 00000000000..9c5e89f191f --- /dev/null +++ b/samples/openapi3/client/petstore/python/src/petstore_api/apis/paths/fake_wild_card_responses.py @@ -0,0 +1,15 @@ +# coding: utf-8 + +""" + + + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator +""" + +from petstore_api.paths.fake_wild_card_responses.get.operation import ApiForGet + + +class FakeWildCardResponses( + ApiForGet, +): + pass diff --git a/samples/openapi3/client/petstore/python/src/petstore_api/apis/tags/fake_api.py b/samples/openapi3/client/petstore/python/src/petstore_api/apis/tags/fake_api.py index 25d970c05a7..0b08e0ab287 100644 --- a/samples/openapi3/client/petstore/python/src/petstore_api/apis/tags/fake_api.py +++ b/samples/openapi3/client/petstore/python/src/petstore_api/apis/tags/fake_api.py @@ -11,6 +11,7 @@ from petstore_api.paths.fake_multiple_securities.get.operation import MultipleSecurities from petstore_api.paths.fake_query_param_with_json_content_type.get.operation import QueryParamWithJsonContentType from petstore_api.paths.fake_parameter_collisions1_abab_self_ab.post.operation import ParameterCollisions +from petstore_api.paths.fake_wild_card_responses.get.operation import WildCardResponses from petstore_api.paths.fake_refs_array_of_enums.post.operation import ArrayOfEnums from petstore_api.paths.fake_additional_properties_with_array_of_enums.get.operation import AdditionalPropertiesWithArrayOfEnums from petstore_api.paths.fake_json_patch.patch.operation import JsonPatch @@ -49,6 +50,7 @@ class FakeApi( MultipleSecurities, QueryParamWithJsonContentType, ParameterCollisions, + WildCardResponses, ArrayOfEnums, AdditionalPropertiesWithArrayOfEnums, JsonPatch, diff --git a/samples/openapi3/client/petstore/python/src/petstore_api/paths/another_fake_dummy/patch/operation.py b/samples/openapi3/client/petstore/python/src/petstore_api/paths/another_fake_dummy/patch/operation.py index 2f578798ffb..6ed9d3dc60e 100644 --- a/samples/openapi3/client/petstore/python/src/petstore_api/paths/another_fake_dummy/patch/operation.py +++ b/samples/openapi3/client/petstore/python/src/petstore_api/paths/another_fake_dummy/patch/operation.py @@ -177,7 +177,8 @@ class instances status: typing_extensions.Literal[ '200', ] - api_response = _status_code_to_response[status].deserialize(response, self.api_client.schema_configuration) + api_response = _status_code_to_response[status].deserialize( + response, self.api_client.schema_configuration) else: api_response = api_client.ApiResponseWithoutDeserialization(response=response) diff --git a/samples/openapi3/client/petstore/python/src/petstore_api/paths/another_fake_dummy/patch/responses/response_200/__init__.py b/samples/openapi3/client/petstore/python/src/petstore_api/paths/another_fake_dummy/patch/responses/response_200/__init__.py index 703121eadd8..60c9bf3cf80 100644 --- a/samples/openapi3/client/petstore/python/src/petstore_api/paths/another_fake_dummy/patch/responses/response_200/__init__.py +++ b/samples/openapi3/client/petstore/python/src/petstore_api/paths/another_fake_dummy/patch/responses/response_200/__init__.py @@ -25,9 +25,7 @@ @dataclasses.dataclass class _ApiResponse(api_client.ApiResponse): response: urllib3.HTTPResponse - body: typing.Union[ - application_json_schema.Schema, - ] + body: application_json_schema.Schema headers: schemas.Unset = schemas.unset diff --git a/samples/openapi3/client/petstore/python/src/petstore_api/paths/fake/delete/operation.py b/samples/openapi3/client/petstore/python/src/petstore_api/paths/fake/delete/operation.py index e7ed6f93a54..ee010b6bfc9 100644 --- a/samples/openapi3/client/petstore/python/src/petstore_api/paths/fake/delete/operation.py +++ b/samples/openapi3/client/petstore/python/src/petstore_api/paths/fake/delete/operation.py @@ -214,7 +214,8 @@ class instances status: typing_extensions.Literal[ '200', ] - api_response = _status_code_to_response[status].deserialize(response, self.api_client.schema_configuration) + api_response = _status_code_to_response[status].deserialize( + response, self.api_client.schema_configuration) else: api_response = api_client.ApiResponseWithoutDeserialization(response=response) diff --git a/samples/openapi3/client/petstore/python/src/petstore_api/paths/fake/get/operation.py b/samples/openapi3/client/petstore/python/src/petstore_api/paths/fake/get/operation.py index 2e48552c810..c36fb107971 100644 --- a/samples/openapi3/client/petstore/python/src/petstore_api/paths/fake/get/operation.py +++ b/samples/openapi3/client/petstore/python/src/petstore_api/paths/fake/get/operation.py @@ -277,7 +277,8 @@ class instances '200', '404', ] - api_response = _status_code_to_response[status].deserialize(response, self.api_client.schema_configuration) + api_response = _status_code_to_response[status].deserialize( + response, self.api_client.schema_configuration) else: api_response = api_client.ApiResponseWithoutDeserialization(response=response) diff --git a/samples/openapi3/client/petstore/python/src/petstore_api/paths/fake/get/responses/response_404/__init__.py b/samples/openapi3/client/petstore/python/src/petstore_api/paths/fake/get/responses/response_404/__init__.py index 74b5192a578..1b4e0a00f87 100644 --- a/samples/openapi3/client/petstore/python/src/petstore_api/paths/fake/get/responses/response_404/__init__.py +++ b/samples/openapi3/client/petstore/python/src/petstore_api/paths/fake/get/responses/response_404/__init__.py @@ -25,9 +25,7 @@ @dataclasses.dataclass class _ApiResponse(api_client.ApiResponse): response: urllib3.HTTPResponse - body: typing.Union[ - application_json_schema.Schema, - ] + body: application_json_schema.Schema headers: schemas.Unset = schemas.unset diff --git a/samples/openapi3/client/petstore/python/src/petstore_api/paths/fake/patch/operation.py b/samples/openapi3/client/petstore/python/src/petstore_api/paths/fake/patch/operation.py index 531d47432c1..489018998d4 100644 --- a/samples/openapi3/client/petstore/python/src/petstore_api/paths/fake/patch/operation.py +++ b/samples/openapi3/client/petstore/python/src/petstore_api/paths/fake/patch/operation.py @@ -177,7 +177,8 @@ class instances status: typing_extensions.Literal[ '200', ] - api_response = _status_code_to_response[status].deserialize(response, self.api_client.schema_configuration) + api_response = _status_code_to_response[status].deserialize( + response, self.api_client.schema_configuration) else: api_response = api_client.ApiResponseWithoutDeserialization(response=response) diff --git a/samples/openapi3/client/petstore/python/src/petstore_api/paths/fake/patch/responses/response_200/__init__.py b/samples/openapi3/client/petstore/python/src/petstore_api/paths/fake/patch/responses/response_200/__init__.py index 703121eadd8..60c9bf3cf80 100644 --- a/samples/openapi3/client/petstore/python/src/petstore_api/paths/fake/patch/responses/response_200/__init__.py +++ b/samples/openapi3/client/petstore/python/src/petstore_api/paths/fake/patch/responses/response_200/__init__.py @@ -25,9 +25,7 @@ @dataclasses.dataclass class _ApiResponse(api_client.ApiResponse): response: urllib3.HTTPResponse - body: typing.Union[ - application_json_schema.Schema, - ] + body: application_json_schema.Schema headers: schemas.Unset = schemas.unset diff --git a/samples/openapi3/client/petstore/python/src/petstore_api/paths/fake/post/operation.py b/samples/openapi3/client/petstore/python/src/petstore_api/paths/fake/post/operation.py index 1d2150f6655..fd76dbd938a 100644 --- a/samples/openapi3/client/petstore/python/src/petstore_api/paths/fake/post/operation.py +++ b/samples/openapi3/client/petstore/python/src/petstore_api/paths/fake/post/operation.py @@ -190,7 +190,8 @@ class instances '200', '404', ] - api_response = _status_code_to_response[status].deserialize(response, self.api_client.schema_configuration) + api_response = _status_code_to_response[status].deserialize( + response, self.api_client.schema_configuration) else: api_response = api_client.ApiResponseWithoutDeserialization(response=response) diff --git a/samples/openapi3/client/petstore/python/src/petstore_api/paths/fake_additional_properties_with_array_of_enums/get/operation.py b/samples/openapi3/client/petstore/python/src/petstore_api/paths/fake_additional_properties_with_array_of_enums/get/operation.py index 0831ae94d47..364c5d4d932 100644 --- a/samples/openapi3/client/petstore/python/src/petstore_api/paths/fake_additional_properties_with_array_of_enums/get/operation.py +++ b/samples/openapi3/client/petstore/python/src/petstore_api/paths/fake_additional_properties_with_array_of_enums/get/operation.py @@ -180,7 +180,8 @@ class instances status: typing_extensions.Literal[ '200', ] - api_response = _status_code_to_response[status].deserialize(response, self.api_client.schema_configuration) + api_response = _status_code_to_response[status].deserialize( + response, self.api_client.schema_configuration) else: api_response = api_client.ApiResponseWithoutDeserialization(response=response) diff --git a/samples/openapi3/client/petstore/python/src/petstore_api/paths/fake_additional_properties_with_array_of_enums/get/responses/response_200/__init__.py b/samples/openapi3/client/petstore/python/src/petstore_api/paths/fake_additional_properties_with_array_of_enums/get/responses/response_200/__init__.py index 703121eadd8..60c9bf3cf80 100644 --- a/samples/openapi3/client/petstore/python/src/petstore_api/paths/fake_additional_properties_with_array_of_enums/get/responses/response_200/__init__.py +++ b/samples/openapi3/client/petstore/python/src/petstore_api/paths/fake_additional_properties_with_array_of_enums/get/responses/response_200/__init__.py @@ -25,9 +25,7 @@ @dataclasses.dataclass class _ApiResponse(api_client.ApiResponse): response: urllib3.HTTPResponse - body: typing.Union[ - application_json_schema.Schema, - ] + body: application_json_schema.Schema headers: schemas.Unset = schemas.unset diff --git a/samples/openapi3/client/petstore/python/src/petstore_api/paths/fake_body_with_file_schema/put/operation.py b/samples/openapi3/client/petstore/python/src/petstore_api/paths/fake_body_with_file_schema/put/operation.py index 4e7908f2206..709360fe839 100644 --- a/samples/openapi3/client/petstore/python/src/petstore_api/paths/fake_body_with_file_schema/put/operation.py +++ b/samples/openapi3/client/petstore/python/src/petstore_api/paths/fake_body_with_file_schema/put/operation.py @@ -164,7 +164,8 @@ class instances status: typing_extensions.Literal[ '200', ] - api_response = _status_code_to_response[status].deserialize(response, self.api_client.schema_configuration) + api_response = _status_code_to_response[status].deserialize( + response, self.api_client.schema_configuration) else: api_response = api_client.ApiResponseWithoutDeserialization(response=response) diff --git a/samples/openapi3/client/petstore/python/src/petstore_api/paths/fake_body_with_query_params/put/operation.py b/samples/openapi3/client/petstore/python/src/petstore_api/paths/fake_body_with_query_params/put/operation.py index 64e20a9c7db..647714f3ae9 100644 --- a/samples/openapi3/client/petstore/python/src/petstore_api/paths/fake_body_with_query_params/put/operation.py +++ b/samples/openapi3/client/petstore/python/src/petstore_api/paths/fake_body_with_query_params/put/operation.py @@ -205,7 +205,8 @@ class instances status: typing_extensions.Literal[ '200', ] - api_response = _status_code_to_response[status].deserialize(response, self.api_client.schema_configuration) + api_response = _status_code_to_response[status].deserialize( + response, self.api_client.schema_configuration) else: api_response = api_client.ApiResponseWithoutDeserialization(response=response) diff --git a/samples/openapi3/client/petstore/python/src/petstore_api/paths/fake_case_sensitive_params/put/operation.py b/samples/openapi3/client/petstore/python/src/petstore_api/paths/fake_case_sensitive_params/put/operation.py index 9bffef5a4e0..eca1a2feb84 100644 --- a/samples/openapi3/client/petstore/python/src/petstore_api/paths/fake_case_sensitive_params/put/operation.py +++ b/samples/openapi3/client/petstore/python/src/petstore_api/paths/fake_case_sensitive_params/put/operation.py @@ -153,7 +153,8 @@ class instances status: typing_extensions.Literal[ '200', ] - api_response = _status_code_to_response[status].deserialize(response, self.api_client.schema_configuration) + api_response = _status_code_to_response[status].deserialize( + response, self.api_client.schema_configuration) else: api_response = api_client.ApiResponseWithoutDeserialization(response=response) diff --git a/samples/openapi3/client/petstore/python/src/petstore_api/paths/fake_classname_test/patch/operation.py b/samples/openapi3/client/petstore/python/src/petstore_api/paths/fake_classname_test/patch/operation.py index 586c63af64b..05e700661dd 100644 --- a/samples/openapi3/client/petstore/python/src/petstore_api/paths/fake_classname_test/patch/operation.py +++ b/samples/openapi3/client/petstore/python/src/petstore_api/paths/fake_classname_test/patch/operation.py @@ -193,7 +193,8 @@ class instances status: typing_extensions.Literal[ '200', ] - api_response = _status_code_to_response[status].deserialize(response, self.api_client.schema_configuration) + api_response = _status_code_to_response[status].deserialize( + response, self.api_client.schema_configuration) else: api_response = api_client.ApiResponseWithoutDeserialization(response=response) diff --git a/samples/openapi3/client/petstore/python/src/petstore_api/paths/fake_classname_test/patch/responses/response_200/__init__.py b/samples/openapi3/client/petstore/python/src/petstore_api/paths/fake_classname_test/patch/responses/response_200/__init__.py index 703121eadd8..60c9bf3cf80 100644 --- a/samples/openapi3/client/petstore/python/src/petstore_api/paths/fake_classname_test/patch/responses/response_200/__init__.py +++ b/samples/openapi3/client/petstore/python/src/petstore_api/paths/fake_classname_test/patch/responses/response_200/__init__.py @@ -25,9 +25,7 @@ @dataclasses.dataclass class _ApiResponse(api_client.ApiResponse): response: urllib3.HTTPResponse - body: typing.Union[ - application_json_schema.Schema, - ] + body: application_json_schema.Schema headers: schemas.Unset = schemas.unset diff --git a/samples/openapi3/client/petstore/python/src/petstore_api/paths/fake_delete_coffee_id/delete/operation.py b/samples/openapi3/client/petstore/python/src/petstore_api/paths/fake_delete_coffee_id/delete/operation.py index 3ae8f3c65cf..28fa0bb49bc 100644 --- a/samples/openapi3/client/petstore/python/src/petstore_api/paths/fake_delete_coffee_id/delete/operation.py +++ b/samples/openapi3/client/petstore/python/src/petstore_api/paths/fake_delete_coffee_id/delete/operation.py @@ -154,7 +154,8 @@ class instances status: typing_extensions.Literal[ '200', ] - api_response = _status_code_to_response[status].deserialize(response, self.api_client.schema_configuration) + api_response = _status_code_to_response[status].deserialize( + response, self.api_client.schema_configuration) else: api_response = default_response.deserialize(response, self.api_client.schema_configuration) diff --git a/samples/openapi3/client/petstore/python/src/petstore_api/paths/fake_health/get/operation.py b/samples/openapi3/client/petstore/python/src/petstore_api/paths/fake_health/get/operation.py index 9bd5c3d8306..4d85ebee813 100644 --- a/samples/openapi3/client/petstore/python/src/petstore_api/paths/fake_health/get/operation.py +++ b/samples/openapi3/client/petstore/python/src/petstore_api/paths/fake_health/get/operation.py @@ -121,7 +121,8 @@ class instances status: typing_extensions.Literal[ '200', ] - api_response = _status_code_to_response[status].deserialize(response, self.api_client.schema_configuration) + api_response = _status_code_to_response[status].deserialize( + response, self.api_client.schema_configuration) else: api_response = api_client.ApiResponseWithoutDeserialization(response=response) diff --git a/samples/openapi3/client/petstore/python/src/petstore_api/paths/fake_health/get/responses/response_200/__init__.py b/samples/openapi3/client/petstore/python/src/petstore_api/paths/fake_health/get/responses/response_200/__init__.py index 703121eadd8..60c9bf3cf80 100644 --- a/samples/openapi3/client/petstore/python/src/petstore_api/paths/fake_health/get/responses/response_200/__init__.py +++ b/samples/openapi3/client/petstore/python/src/petstore_api/paths/fake_health/get/responses/response_200/__init__.py @@ -25,9 +25,7 @@ @dataclasses.dataclass class _ApiResponse(api_client.ApiResponse): response: urllib3.HTTPResponse - body: typing.Union[ - application_json_schema.Schema, - ] + body: application_json_schema.Schema headers: schemas.Unset = schemas.unset diff --git a/samples/openapi3/client/petstore/python/src/petstore_api/paths/fake_inline_additional_properties/post/operation.py b/samples/openapi3/client/petstore/python/src/petstore_api/paths/fake_inline_additional_properties/post/operation.py index 8e31826b36e..a889927c150 100644 --- a/samples/openapi3/client/petstore/python/src/petstore_api/paths/fake_inline_additional_properties/post/operation.py +++ b/samples/openapi3/client/petstore/python/src/petstore_api/paths/fake_inline_additional_properties/post/operation.py @@ -165,7 +165,8 @@ class instances status: typing_extensions.Literal[ '200', ] - api_response = _status_code_to_response[status].deserialize(response, self.api_client.schema_configuration) + api_response = _status_code_to_response[status].deserialize( + response, self.api_client.schema_configuration) else: api_response = api_client.ApiResponseWithoutDeserialization(response=response) diff --git a/samples/openapi3/client/petstore/python/src/petstore_api/paths/fake_inline_composition/post/operation.py b/samples/openapi3/client/petstore/python/src/petstore_api/paths/fake_inline_composition/post/operation.py index 9038e91719b..56777b65806 100644 --- a/samples/openapi3/client/petstore/python/src/petstore_api/paths/fake_inline_composition/post/operation.py +++ b/samples/openapi3/client/petstore/python/src/petstore_api/paths/fake_inline_composition/post/operation.py @@ -319,7 +319,8 @@ class instances status: typing_extensions.Literal[ '200', ] - api_response = _status_code_to_response[status].deserialize(response, self.api_client.schema_configuration) + api_response = _status_code_to_response[status].deserialize( + response, self.api_client.schema_configuration) else: api_response = api_client.ApiResponseWithoutDeserialization(response=response) diff --git a/samples/openapi3/client/petstore/python/src/petstore_api/paths/fake_json_form_data/get/operation.py b/samples/openapi3/client/petstore/python/src/petstore_api/paths/fake_json_form_data/get/operation.py index b47b836833f..d8e8e2b094b 100644 --- a/samples/openapi3/client/petstore/python/src/petstore_api/paths/fake_json_form_data/get/operation.py +++ b/samples/openapi3/client/petstore/python/src/petstore_api/paths/fake_json_form_data/get/operation.py @@ -168,7 +168,8 @@ class instances status: typing_extensions.Literal[ '200', ] - api_response = _status_code_to_response[status].deserialize(response, self.api_client.schema_configuration) + api_response = _status_code_to_response[status].deserialize( + response, self.api_client.schema_configuration) else: api_response = api_client.ApiResponseWithoutDeserialization(response=response) diff --git a/samples/openapi3/client/petstore/python/src/petstore_api/paths/fake_json_patch/patch/operation.py b/samples/openapi3/client/petstore/python/src/petstore_api/paths/fake_json_patch/patch/operation.py index d1bb730de1d..317ef231c3c 100644 --- a/samples/openapi3/client/petstore/python/src/petstore_api/paths/fake_json_patch/patch/operation.py +++ b/samples/openapi3/client/petstore/python/src/petstore_api/paths/fake_json_patch/patch/operation.py @@ -168,7 +168,8 @@ class instances status: typing_extensions.Literal[ '200', ] - api_response = _status_code_to_response[status].deserialize(response, self.api_client.schema_configuration) + api_response = _status_code_to_response[status].deserialize( + response, self.api_client.schema_configuration) else: api_response = api_client.ApiResponseWithoutDeserialization(response=response) diff --git a/samples/openapi3/client/petstore/python/src/petstore_api/paths/fake_json_with_charset/post/operation.py b/samples/openapi3/client/petstore/python/src/petstore_api/paths/fake_json_with_charset/post/operation.py index a95ab21766f..dc03691f1d5 100644 --- a/samples/openapi3/client/petstore/python/src/petstore_api/paths/fake_json_with_charset/post/operation.py +++ b/samples/openapi3/client/petstore/python/src/petstore_api/paths/fake_json_with_charset/post/operation.py @@ -250,7 +250,8 @@ class instances status: typing_extensions.Literal[ '200', ] - api_response = _status_code_to_response[status].deserialize(response, self.api_client.schema_configuration) + api_response = _status_code_to_response[status].deserialize( + response, self.api_client.schema_configuration) else: api_response = api_client.ApiResponseWithoutDeserialization(response=response) diff --git a/samples/openapi3/client/petstore/python/src/petstore_api/paths/fake_json_with_charset/post/responses/response_200/__init__.py b/samples/openapi3/client/petstore/python/src/petstore_api/paths/fake_json_with_charset/post/responses/response_200/__init__.py index ec9594041ae..fcd145814bf 100644 --- a/samples/openapi3/client/petstore/python/src/petstore_api/paths/fake_json_with_charset/post/responses/response_200/__init__.py +++ b/samples/openapi3/client/petstore/python/src/petstore_api/paths/fake_json_with_charset/post/responses/response_200/__init__.py @@ -25,9 +25,7 @@ @dataclasses.dataclass class _ApiResponse(api_client.ApiResponse): response: urllib3.HTTPResponse - body: typing.Union[ - application_json_charsetutf8_schema.Schema, - ] + body: application_json_charsetutf8_schema.Schema headers: schemas.Unset = schemas.unset diff --git a/samples/openapi3/client/petstore/python/src/petstore_api/paths/fake_multiple_response_bodies/get/operation.py b/samples/openapi3/client/petstore/python/src/petstore_api/paths/fake_multiple_response_bodies/get/operation.py index aaece5bb85d..a0e90e930fc 100644 --- a/samples/openapi3/client/petstore/python/src/petstore_api/paths/fake_multiple_response_bodies/get/operation.py +++ b/samples/openapi3/client/petstore/python/src/petstore_api/paths/fake_multiple_response_bodies/get/operation.py @@ -131,7 +131,8 @@ class instances '200', '202', ] - api_response = _status_code_to_response[status].deserialize(response, self.api_client.schema_configuration) + api_response = _status_code_to_response[status].deserialize( + response, self.api_client.schema_configuration) else: api_response = api_client.ApiResponseWithoutDeserialization(response=response) diff --git a/samples/openapi3/client/petstore/python/src/petstore_api/paths/fake_multiple_response_bodies/get/responses/response_200/__init__.py b/samples/openapi3/client/petstore/python/src/petstore_api/paths/fake_multiple_response_bodies/get/responses/response_200/__init__.py index 703121eadd8..60c9bf3cf80 100644 --- a/samples/openapi3/client/petstore/python/src/petstore_api/paths/fake_multiple_response_bodies/get/responses/response_200/__init__.py +++ b/samples/openapi3/client/petstore/python/src/petstore_api/paths/fake_multiple_response_bodies/get/responses/response_200/__init__.py @@ -25,9 +25,7 @@ @dataclasses.dataclass class _ApiResponse(api_client.ApiResponse): response: urllib3.HTTPResponse - body: typing.Union[ - application_json_schema.Schema, - ] + body: application_json_schema.Schema headers: schemas.Unset = schemas.unset diff --git a/samples/openapi3/client/petstore/python/src/petstore_api/paths/fake_multiple_response_bodies/get/responses/response_202/__init__.py b/samples/openapi3/client/petstore/python/src/petstore_api/paths/fake_multiple_response_bodies/get/responses/response_202/__init__.py index 777e28f58b1..5582938ee1f 100644 --- a/samples/openapi3/client/petstore/python/src/petstore_api/paths/fake_multiple_response_bodies/get/responses/response_202/__init__.py +++ b/samples/openapi3/client/petstore/python/src/petstore_api/paths/fake_multiple_response_bodies/get/responses/response_202/__init__.py @@ -25,9 +25,7 @@ @dataclasses.dataclass class _ApiResponse(api_client.ApiResponse): response: urllib3.HTTPResponse - body: typing.Union[ - application_json_schema.Schema, - ] + body: application_json_schema.Schema headers: schemas.Unset = schemas.unset diff --git a/samples/openapi3/client/petstore/python/src/petstore_api/paths/fake_multiple_securities/get/operation.py b/samples/openapi3/client/petstore/python/src/petstore_api/paths/fake_multiple_securities/get/operation.py index a1856b647c8..c0f8eff3337 100644 --- a/samples/openapi3/client/petstore/python/src/petstore_api/paths/fake_multiple_securities/get/operation.py +++ b/samples/openapi3/client/petstore/python/src/petstore_api/paths/fake_multiple_securities/get/operation.py @@ -142,7 +142,8 @@ class instances status: typing_extensions.Literal[ '200', ] - api_response = _status_code_to_response[status].deserialize(response, self.api_client.schema_configuration) + api_response = _status_code_to_response[status].deserialize( + response, self.api_client.schema_configuration) else: api_response = api_client.ApiResponseWithoutDeserialization(response=response) diff --git a/samples/openapi3/client/petstore/python/src/petstore_api/paths/fake_multiple_securities/get/responses/response_200/__init__.py b/samples/openapi3/client/petstore/python/src/petstore_api/paths/fake_multiple_securities/get/responses/response_200/__init__.py index 703121eadd8..60c9bf3cf80 100644 --- a/samples/openapi3/client/petstore/python/src/petstore_api/paths/fake_multiple_securities/get/responses/response_200/__init__.py +++ b/samples/openapi3/client/petstore/python/src/petstore_api/paths/fake_multiple_securities/get/responses/response_200/__init__.py @@ -25,9 +25,7 @@ @dataclasses.dataclass class _ApiResponse(api_client.ApiResponse): response: urllib3.HTTPResponse - body: typing.Union[ - application_json_schema.Schema, - ] + body: application_json_schema.Schema headers: schemas.Unset = schemas.unset diff --git a/samples/openapi3/client/petstore/python/src/petstore_api/paths/fake_obj_in_query/get/operation.py b/samples/openapi3/client/petstore/python/src/petstore_api/paths/fake_obj_in_query/get/operation.py index 9a1ac35c768..f41de158096 100644 --- a/samples/openapi3/client/petstore/python/src/petstore_api/paths/fake_obj_in_query/get/operation.py +++ b/samples/openapi3/client/petstore/python/src/petstore_api/paths/fake_obj_in_query/get/operation.py @@ -146,7 +146,8 @@ class instances status: typing_extensions.Literal[ '200', ] - api_response = _status_code_to_response[status].deserialize(response, self.api_client.schema_configuration) + api_response = _status_code_to_response[status].deserialize( + response, self.api_client.schema_configuration) else: api_response = api_client.ApiResponseWithoutDeserialization(response=response) diff --git a/samples/openapi3/client/petstore/python/src/petstore_api/paths/fake_parameter_collisions1_abab_self_ab/post/operation.py b/samples/openapi3/client/petstore/python/src/petstore_api/paths/fake_parameter_collisions1_abab_self_ab/post/operation.py index 7a8466a7e46..7933db855a7 100644 --- a/samples/openapi3/client/petstore/python/src/petstore_api/paths/fake_parameter_collisions1_abab_self_ab/post/operation.py +++ b/samples/openapi3/client/petstore/python/src/petstore_api/paths/fake_parameter_collisions1_abab_self_ab/post/operation.py @@ -445,7 +445,8 @@ class instances status: typing_extensions.Literal[ '200', ] - api_response = _status_code_to_response[status].deserialize(response, self.api_client.schema_configuration) + api_response = _status_code_to_response[status].deserialize( + response, self.api_client.schema_configuration) else: api_response = api_client.ApiResponseWithoutDeserialization(response=response) diff --git a/samples/openapi3/client/petstore/python/src/petstore_api/paths/fake_parameter_collisions1_abab_self_ab/post/responses/response_200/__init__.py b/samples/openapi3/client/petstore/python/src/petstore_api/paths/fake_parameter_collisions1_abab_self_ab/post/responses/response_200/__init__.py index 703121eadd8..60c9bf3cf80 100644 --- a/samples/openapi3/client/petstore/python/src/petstore_api/paths/fake_parameter_collisions1_abab_self_ab/post/responses/response_200/__init__.py +++ b/samples/openapi3/client/petstore/python/src/petstore_api/paths/fake_parameter_collisions1_abab_self_ab/post/responses/response_200/__init__.py @@ -25,9 +25,7 @@ @dataclasses.dataclass class _ApiResponse(api_client.ApiResponse): response: urllib3.HTTPResponse - body: typing.Union[ - application_json_schema.Schema, - ] + body: application_json_schema.Schema headers: schemas.Unset = schemas.unset diff --git a/samples/openapi3/client/petstore/python/src/petstore_api/paths/fake_pet_id_upload_image_with_required_file/post/operation.py b/samples/openapi3/client/petstore/python/src/petstore_api/paths/fake_pet_id_upload_image_with_required_file/post/operation.py index 6d8b1f401b0..6d9499d7c61 100644 --- a/samples/openapi3/client/petstore/python/src/petstore_api/paths/fake_pet_id_upload_image_with_required_file/post/operation.py +++ b/samples/openapi3/client/petstore/python/src/petstore_api/paths/fake_pet_id_upload_image_with_required_file/post/operation.py @@ -237,7 +237,8 @@ class instances status: typing_extensions.Literal[ '200', ] - api_response = _status_code_to_response[status].deserialize(response, self.api_client.schema_configuration) + api_response = _status_code_to_response[status].deserialize( + response, self.api_client.schema_configuration) else: api_response = api_client.ApiResponseWithoutDeserialization(response=response) diff --git a/samples/openapi3/client/petstore/python/src/petstore_api/paths/fake_pet_id_upload_image_with_required_file/post/responses/response_200/__init__.py b/samples/openapi3/client/petstore/python/src/petstore_api/paths/fake_pet_id_upload_image_with_required_file/post/responses/response_200/__init__.py index 703121eadd8..60c9bf3cf80 100644 --- a/samples/openapi3/client/petstore/python/src/petstore_api/paths/fake_pet_id_upload_image_with_required_file/post/responses/response_200/__init__.py +++ b/samples/openapi3/client/petstore/python/src/petstore_api/paths/fake_pet_id_upload_image_with_required_file/post/responses/response_200/__init__.py @@ -25,9 +25,7 @@ @dataclasses.dataclass class _ApiResponse(api_client.ApiResponse): response: urllib3.HTTPResponse - body: typing.Union[ - application_json_schema.Schema, - ] + body: application_json_schema.Schema headers: schemas.Unset = schemas.unset diff --git a/samples/openapi3/client/petstore/python/src/petstore_api/paths/fake_query_param_with_json_content_type/get/operation.py b/samples/openapi3/client/petstore/python/src/petstore_api/paths/fake_query_param_with_json_content_type/get/operation.py index f26976c93b7..3882fc24a93 100644 --- a/samples/openapi3/client/petstore/python/src/petstore_api/paths/fake_query_param_with_json_content_type/get/operation.py +++ b/samples/openapi3/client/petstore/python/src/petstore_api/paths/fake_query_param_with_json_content_type/get/operation.py @@ -161,7 +161,8 @@ class instances status: typing_extensions.Literal[ '200', ] - api_response = _status_code_to_response[status].deserialize(response, self.api_client.schema_configuration) + api_response = _status_code_to_response[status].deserialize( + response, self.api_client.schema_configuration) else: api_response = api_client.ApiResponseWithoutDeserialization(response=response) diff --git a/samples/openapi3/client/petstore/python/src/petstore_api/paths/fake_query_param_with_json_content_type/get/responses/response_200/__init__.py b/samples/openapi3/client/petstore/python/src/petstore_api/paths/fake_query_param_with_json_content_type/get/responses/response_200/__init__.py index 703121eadd8..60c9bf3cf80 100644 --- a/samples/openapi3/client/petstore/python/src/petstore_api/paths/fake_query_param_with_json_content_type/get/responses/response_200/__init__.py +++ b/samples/openapi3/client/petstore/python/src/petstore_api/paths/fake_query_param_with_json_content_type/get/responses/response_200/__init__.py @@ -25,9 +25,7 @@ @dataclasses.dataclass class _ApiResponse(api_client.ApiResponse): response: urllib3.HTTPResponse - body: typing.Union[ - application_json_schema.Schema, - ] + body: application_json_schema.Schema headers: schemas.Unset = schemas.unset diff --git a/samples/openapi3/client/petstore/python/src/petstore_api/paths/fake_ref_obj_in_query/get/operation.py b/samples/openapi3/client/petstore/python/src/petstore_api/paths/fake_ref_obj_in_query/get/operation.py index a8d2c669ab0..68d10d7c7db 100644 --- a/samples/openapi3/client/petstore/python/src/petstore_api/paths/fake_ref_obj_in_query/get/operation.py +++ b/samples/openapi3/client/petstore/python/src/petstore_api/paths/fake_ref_obj_in_query/get/operation.py @@ -146,7 +146,8 @@ class instances status: typing_extensions.Literal[ '200', ] - api_response = _status_code_to_response[status].deserialize(response, self.api_client.schema_configuration) + api_response = _status_code_to_response[status].deserialize( + response, self.api_client.schema_configuration) else: api_response = api_client.ApiResponseWithoutDeserialization(response=response) diff --git a/samples/openapi3/client/petstore/python/src/petstore_api/paths/fake_refs_array_of_enums/post/operation.py b/samples/openapi3/client/petstore/python/src/petstore_api/paths/fake_refs_array_of_enums/post/operation.py index d53932065bc..3829c073fb3 100644 --- a/samples/openapi3/client/petstore/python/src/petstore_api/paths/fake_refs_array_of_enums/post/operation.py +++ b/samples/openapi3/client/petstore/python/src/petstore_api/paths/fake_refs_array_of_enums/post/operation.py @@ -180,7 +180,8 @@ class instances status: typing_extensions.Literal[ '200', ] - api_response = _status_code_to_response[status].deserialize(response, self.api_client.schema_configuration) + api_response = _status_code_to_response[status].deserialize( + response, self.api_client.schema_configuration) else: api_response = api_client.ApiResponseWithoutDeserialization(response=response) diff --git a/samples/openapi3/client/petstore/python/src/petstore_api/paths/fake_refs_array_of_enums/post/responses/response_200/__init__.py b/samples/openapi3/client/petstore/python/src/petstore_api/paths/fake_refs_array_of_enums/post/responses/response_200/__init__.py index 703121eadd8..60c9bf3cf80 100644 --- a/samples/openapi3/client/petstore/python/src/petstore_api/paths/fake_refs_array_of_enums/post/responses/response_200/__init__.py +++ b/samples/openapi3/client/petstore/python/src/petstore_api/paths/fake_refs_array_of_enums/post/responses/response_200/__init__.py @@ -25,9 +25,7 @@ @dataclasses.dataclass class _ApiResponse(api_client.ApiResponse): response: urllib3.HTTPResponse - body: typing.Union[ - application_json_schema.Schema, - ] + body: application_json_schema.Schema headers: schemas.Unset = schemas.unset diff --git a/samples/openapi3/client/petstore/python/src/petstore_api/paths/fake_refs_arraymodel/post/operation.py b/samples/openapi3/client/petstore/python/src/petstore_api/paths/fake_refs_arraymodel/post/operation.py index 59d9a621384..e9458959b71 100644 --- a/samples/openapi3/client/petstore/python/src/petstore_api/paths/fake_refs_arraymodel/post/operation.py +++ b/samples/openapi3/client/petstore/python/src/petstore_api/paths/fake_refs_arraymodel/post/operation.py @@ -179,7 +179,8 @@ class instances status: typing_extensions.Literal[ '200', ] - api_response = _status_code_to_response[status].deserialize(response, self.api_client.schema_configuration) + api_response = _status_code_to_response[status].deserialize( + response, self.api_client.schema_configuration) else: api_response = api_client.ApiResponseWithoutDeserialization(response=response) diff --git a/samples/openapi3/client/petstore/python/src/petstore_api/paths/fake_refs_arraymodel/post/responses/response_200/__init__.py b/samples/openapi3/client/petstore/python/src/petstore_api/paths/fake_refs_arraymodel/post/responses/response_200/__init__.py index 703121eadd8..60c9bf3cf80 100644 --- a/samples/openapi3/client/petstore/python/src/petstore_api/paths/fake_refs_arraymodel/post/responses/response_200/__init__.py +++ b/samples/openapi3/client/petstore/python/src/petstore_api/paths/fake_refs_arraymodel/post/responses/response_200/__init__.py @@ -25,9 +25,7 @@ @dataclasses.dataclass class _ApiResponse(api_client.ApiResponse): response: urllib3.HTTPResponse - body: typing.Union[ - application_json_schema.Schema, - ] + body: application_json_schema.Schema headers: schemas.Unset = schemas.unset diff --git a/samples/openapi3/client/petstore/python/src/petstore_api/paths/fake_refs_boolean/post/operation.py b/samples/openapi3/client/petstore/python/src/petstore_api/paths/fake_refs_boolean/post/operation.py index af01644e35a..f3ebabb5d23 100644 --- a/samples/openapi3/client/petstore/python/src/petstore_api/paths/fake_refs_boolean/post/operation.py +++ b/samples/openapi3/client/petstore/python/src/petstore_api/paths/fake_refs_boolean/post/operation.py @@ -174,7 +174,8 @@ class instances status: typing_extensions.Literal[ '200', ] - api_response = _status_code_to_response[status].deserialize(response, self.api_client.schema_configuration) + api_response = _status_code_to_response[status].deserialize( + response, self.api_client.schema_configuration) else: api_response = api_client.ApiResponseWithoutDeserialization(response=response) diff --git a/samples/openapi3/client/petstore/python/src/petstore_api/paths/fake_refs_boolean/post/responses/response_200/__init__.py b/samples/openapi3/client/petstore/python/src/petstore_api/paths/fake_refs_boolean/post/responses/response_200/__init__.py index 703121eadd8..60c9bf3cf80 100644 --- a/samples/openapi3/client/petstore/python/src/petstore_api/paths/fake_refs_boolean/post/responses/response_200/__init__.py +++ b/samples/openapi3/client/petstore/python/src/petstore_api/paths/fake_refs_boolean/post/responses/response_200/__init__.py @@ -25,9 +25,7 @@ @dataclasses.dataclass class _ApiResponse(api_client.ApiResponse): response: urllib3.HTTPResponse - body: typing.Union[ - application_json_schema.Schema, - ] + body: application_json_schema.Schema headers: schemas.Unset = schemas.unset diff --git a/samples/openapi3/client/petstore/python/src/petstore_api/paths/fake_refs_composed_one_of_number_with_validations/post/operation.py b/samples/openapi3/client/petstore/python/src/petstore_api/paths/fake_refs_composed_one_of_number_with_validations/post/operation.py index 1ec3f7cd44c..8bd256cc1e9 100644 --- a/samples/openapi3/client/petstore/python/src/petstore_api/paths/fake_refs_composed_one_of_number_with_validations/post/operation.py +++ b/samples/openapi3/client/petstore/python/src/petstore_api/paths/fake_refs_composed_one_of_number_with_validations/post/operation.py @@ -249,7 +249,8 @@ class instances status: typing_extensions.Literal[ '200', ] - api_response = _status_code_to_response[status].deserialize(response, self.api_client.schema_configuration) + api_response = _status_code_to_response[status].deserialize( + response, self.api_client.schema_configuration) else: api_response = api_client.ApiResponseWithoutDeserialization(response=response) diff --git a/samples/openapi3/client/petstore/python/src/petstore_api/paths/fake_refs_composed_one_of_number_with_validations/post/responses/response_200/__init__.py b/samples/openapi3/client/petstore/python/src/petstore_api/paths/fake_refs_composed_one_of_number_with_validations/post/responses/response_200/__init__.py index 703121eadd8..60c9bf3cf80 100644 --- a/samples/openapi3/client/petstore/python/src/petstore_api/paths/fake_refs_composed_one_of_number_with_validations/post/responses/response_200/__init__.py +++ b/samples/openapi3/client/petstore/python/src/petstore_api/paths/fake_refs_composed_one_of_number_with_validations/post/responses/response_200/__init__.py @@ -25,9 +25,7 @@ @dataclasses.dataclass class _ApiResponse(api_client.ApiResponse): response: urllib3.HTTPResponse - body: typing.Union[ - application_json_schema.Schema, - ] + body: application_json_schema.Schema headers: schemas.Unset = schemas.unset diff --git a/samples/openapi3/client/petstore/python/src/petstore_api/paths/fake_refs_enum/post/operation.py b/samples/openapi3/client/petstore/python/src/petstore_api/paths/fake_refs_enum/post/operation.py index 4438de9e131..685c279a0dc 100644 --- a/samples/openapi3/client/petstore/python/src/petstore_api/paths/fake_refs_enum/post/operation.py +++ b/samples/openapi3/client/petstore/python/src/petstore_api/paths/fake_refs_enum/post/operation.py @@ -179,7 +179,8 @@ class instances status: typing_extensions.Literal[ '200', ] - api_response = _status_code_to_response[status].deserialize(response, self.api_client.schema_configuration) + api_response = _status_code_to_response[status].deserialize( + response, self.api_client.schema_configuration) else: api_response = api_client.ApiResponseWithoutDeserialization(response=response) diff --git a/samples/openapi3/client/petstore/python/src/petstore_api/paths/fake_refs_enum/post/responses/response_200/__init__.py b/samples/openapi3/client/petstore/python/src/petstore_api/paths/fake_refs_enum/post/responses/response_200/__init__.py index 703121eadd8..60c9bf3cf80 100644 --- a/samples/openapi3/client/petstore/python/src/petstore_api/paths/fake_refs_enum/post/responses/response_200/__init__.py +++ b/samples/openapi3/client/petstore/python/src/petstore_api/paths/fake_refs_enum/post/responses/response_200/__init__.py @@ -25,9 +25,7 @@ @dataclasses.dataclass class _ApiResponse(api_client.ApiResponse): response: urllib3.HTTPResponse - body: typing.Union[ - application_json_schema.Schema, - ] + body: application_json_schema.Schema headers: schemas.Unset = schemas.unset diff --git a/samples/openapi3/client/petstore/python/src/petstore_api/paths/fake_refs_mammal/post/operation.py b/samples/openapi3/client/petstore/python/src/petstore_api/paths/fake_refs_mammal/post/operation.py index 0ac1ac7596f..e151792b0c9 100644 --- a/samples/openapi3/client/petstore/python/src/petstore_api/paths/fake_refs_mammal/post/operation.py +++ b/samples/openapi3/client/petstore/python/src/petstore_api/paths/fake_refs_mammal/post/operation.py @@ -246,7 +246,8 @@ class instances status: typing_extensions.Literal[ '200', ] - api_response = _status_code_to_response[status].deserialize(response, self.api_client.schema_configuration) + api_response = _status_code_to_response[status].deserialize( + response, self.api_client.schema_configuration) else: api_response = api_client.ApiResponseWithoutDeserialization(response=response) diff --git a/samples/openapi3/client/petstore/python/src/petstore_api/paths/fake_refs_mammal/post/responses/response_200/__init__.py b/samples/openapi3/client/petstore/python/src/petstore_api/paths/fake_refs_mammal/post/responses/response_200/__init__.py index 703121eadd8..60c9bf3cf80 100644 --- a/samples/openapi3/client/petstore/python/src/petstore_api/paths/fake_refs_mammal/post/responses/response_200/__init__.py +++ b/samples/openapi3/client/petstore/python/src/petstore_api/paths/fake_refs_mammal/post/responses/response_200/__init__.py @@ -25,9 +25,7 @@ @dataclasses.dataclass class _ApiResponse(api_client.ApiResponse): response: urllib3.HTTPResponse - body: typing.Union[ - application_json_schema.Schema, - ] + body: application_json_schema.Schema headers: schemas.Unset = schemas.unset diff --git a/samples/openapi3/client/petstore/python/src/petstore_api/paths/fake_refs_number/post/operation.py b/samples/openapi3/client/petstore/python/src/petstore_api/paths/fake_refs_number/post/operation.py index 512a6e33b84..180458bfb36 100644 --- a/samples/openapi3/client/petstore/python/src/petstore_api/paths/fake_refs_number/post/operation.py +++ b/samples/openapi3/client/petstore/python/src/petstore_api/paths/fake_refs_number/post/operation.py @@ -184,7 +184,8 @@ class instances status: typing_extensions.Literal[ '200', ] - api_response = _status_code_to_response[status].deserialize(response, self.api_client.schema_configuration) + api_response = _status_code_to_response[status].deserialize( + response, self.api_client.schema_configuration) else: api_response = api_client.ApiResponseWithoutDeserialization(response=response) diff --git a/samples/openapi3/client/petstore/python/src/petstore_api/paths/fake_refs_number/post/responses/response_200/__init__.py b/samples/openapi3/client/petstore/python/src/petstore_api/paths/fake_refs_number/post/responses/response_200/__init__.py index 703121eadd8..60c9bf3cf80 100644 --- a/samples/openapi3/client/petstore/python/src/petstore_api/paths/fake_refs_number/post/responses/response_200/__init__.py +++ b/samples/openapi3/client/petstore/python/src/petstore_api/paths/fake_refs_number/post/responses/response_200/__init__.py @@ -25,9 +25,7 @@ @dataclasses.dataclass class _ApiResponse(api_client.ApiResponse): response: urllib3.HTTPResponse - body: typing.Union[ - application_json_schema.Schema, - ] + body: application_json_schema.Schema headers: schemas.Unset = schemas.unset diff --git a/samples/openapi3/client/petstore/python/src/petstore_api/paths/fake_refs_object_model_with_ref_props/post/operation.py b/samples/openapi3/client/petstore/python/src/petstore_api/paths/fake_refs_object_model_with_ref_props/post/operation.py index b04426f1abb..f3efdcfe205 100644 --- a/samples/openapi3/client/petstore/python/src/petstore_api/paths/fake_refs_object_model_with_ref_props/post/operation.py +++ b/samples/openapi3/client/petstore/python/src/petstore_api/paths/fake_refs_object_model_with_ref_props/post/operation.py @@ -179,7 +179,8 @@ class instances status: typing_extensions.Literal[ '200', ] - api_response = _status_code_to_response[status].deserialize(response, self.api_client.schema_configuration) + api_response = _status_code_to_response[status].deserialize( + response, self.api_client.schema_configuration) else: api_response = api_client.ApiResponseWithoutDeserialization(response=response) diff --git a/samples/openapi3/client/petstore/python/src/petstore_api/paths/fake_refs_object_model_with_ref_props/post/responses/response_200/__init__.py b/samples/openapi3/client/petstore/python/src/petstore_api/paths/fake_refs_object_model_with_ref_props/post/responses/response_200/__init__.py index 703121eadd8..60c9bf3cf80 100644 --- a/samples/openapi3/client/petstore/python/src/petstore_api/paths/fake_refs_object_model_with_ref_props/post/responses/response_200/__init__.py +++ b/samples/openapi3/client/petstore/python/src/petstore_api/paths/fake_refs_object_model_with_ref_props/post/responses/response_200/__init__.py @@ -25,9 +25,7 @@ @dataclasses.dataclass class _ApiResponse(api_client.ApiResponse): response: urllib3.HTTPResponse - body: typing.Union[ - application_json_schema.Schema, - ] + body: application_json_schema.Schema headers: schemas.Unset = schemas.unset diff --git a/samples/openapi3/client/petstore/python/src/petstore_api/paths/fake_refs_string/post/operation.py b/samples/openapi3/client/petstore/python/src/petstore_api/paths/fake_refs_string/post/operation.py index a3471ba46bc..3ea9ffe1c52 100644 --- a/samples/openapi3/client/petstore/python/src/petstore_api/paths/fake_refs_string/post/operation.py +++ b/samples/openapi3/client/petstore/python/src/petstore_api/paths/fake_refs_string/post/operation.py @@ -174,7 +174,8 @@ class instances status: typing_extensions.Literal[ '200', ] - api_response = _status_code_to_response[status].deserialize(response, self.api_client.schema_configuration) + api_response = _status_code_to_response[status].deserialize( + response, self.api_client.schema_configuration) else: api_response = api_client.ApiResponseWithoutDeserialization(response=response) diff --git a/samples/openapi3/client/petstore/python/src/petstore_api/paths/fake_refs_string/post/responses/response_200/__init__.py b/samples/openapi3/client/petstore/python/src/petstore_api/paths/fake_refs_string/post/responses/response_200/__init__.py index 703121eadd8..60c9bf3cf80 100644 --- a/samples/openapi3/client/petstore/python/src/petstore_api/paths/fake_refs_string/post/responses/response_200/__init__.py +++ b/samples/openapi3/client/petstore/python/src/petstore_api/paths/fake_refs_string/post/responses/response_200/__init__.py @@ -25,9 +25,7 @@ @dataclasses.dataclass class _ApiResponse(api_client.ApiResponse): response: urllib3.HTTPResponse - body: typing.Union[ - application_json_schema.Schema, - ] + body: application_json_schema.Schema headers: schemas.Unset = schemas.unset diff --git a/samples/openapi3/client/petstore/python/src/petstore_api/paths/fake_response_without_schema/get/operation.py b/samples/openapi3/client/petstore/python/src/petstore_api/paths/fake_response_without_schema/get/operation.py index 7d042546321..32ab25ec395 100644 --- a/samples/openapi3/client/petstore/python/src/petstore_api/paths/fake_response_without_schema/get/operation.py +++ b/samples/openapi3/client/petstore/python/src/petstore_api/paths/fake_response_without_schema/get/operation.py @@ -122,7 +122,8 @@ class instances status: typing_extensions.Literal[ '200', ] - api_response = _status_code_to_response[status].deserialize(response, self.api_client.schema_configuration) + api_response = _status_code_to_response[status].deserialize( + response, self.api_client.schema_configuration) else: api_response = api_client.ApiResponseWithoutDeserialization(response=response) diff --git a/samples/openapi3/client/petstore/python/src/petstore_api/paths/fake_test_query_paramters/put/operation.py b/samples/openapi3/client/petstore/python/src/petstore_api/paths/fake_test_query_paramters/put/operation.py index bce3d1bb925..3aa9eb40a9f 100644 --- a/samples/openapi3/client/petstore/python/src/petstore_api/paths/fake_test_query_paramters/put/operation.py +++ b/samples/openapi3/client/petstore/python/src/petstore_api/paths/fake_test_query_paramters/put/operation.py @@ -162,7 +162,8 @@ class instances status: typing_extensions.Literal[ '200', ] - api_response = _status_code_to_response[status].deserialize(response, self.api_client.schema_configuration) + api_response = _status_code_to_response[status].deserialize( + response, self.api_client.schema_configuration) else: api_response = api_client.ApiResponseWithoutDeserialization(response=response) diff --git a/samples/openapi3/client/petstore/python/src/petstore_api/paths/fake_upload_download_file/post/operation.py b/samples/openapi3/client/petstore/python/src/petstore_api/paths/fake_upload_download_file/post/operation.py index c301babed63..7e297da59fe 100644 --- a/samples/openapi3/client/petstore/python/src/petstore_api/paths/fake_upload_download_file/post/operation.py +++ b/samples/openapi3/client/petstore/python/src/petstore_api/paths/fake_upload_download_file/post/operation.py @@ -182,7 +182,8 @@ class instances status: typing_extensions.Literal[ '200', ] - api_response = _status_code_to_response[status].deserialize(response, self.api_client.schema_configuration) + api_response = _status_code_to_response[status].deserialize( + response, self.api_client.schema_configuration) else: api_response = api_client.ApiResponseWithoutDeserialization(response=response) diff --git a/samples/openapi3/client/petstore/python/src/petstore_api/paths/fake_upload_download_file/post/responses/response_200/__init__.py b/samples/openapi3/client/petstore/python/src/petstore_api/paths/fake_upload_download_file/post/responses/response_200/__init__.py index c43f7301eef..1f81bfefebe 100644 --- a/samples/openapi3/client/petstore/python/src/petstore_api/paths/fake_upload_download_file/post/responses/response_200/__init__.py +++ b/samples/openapi3/client/petstore/python/src/petstore_api/paths/fake_upload_download_file/post/responses/response_200/__init__.py @@ -25,9 +25,7 @@ @dataclasses.dataclass class _ApiResponse(api_client.ApiResponse): response: urllib3.HTTPResponse - body: typing.Union[ - application_octet_stream_schema.Schema, - ] + body: application_octet_stream_schema.Schema headers: schemas.Unset = schemas.unset diff --git a/samples/openapi3/client/petstore/python/src/petstore_api/paths/fake_upload_file/post/operation.py b/samples/openapi3/client/petstore/python/src/petstore_api/paths/fake_upload_file/post/operation.py index eda9a9ad46d..ce608bc2983 100644 --- a/samples/openapi3/client/petstore/python/src/petstore_api/paths/fake_upload_file/post/operation.py +++ b/samples/openapi3/client/petstore/python/src/petstore_api/paths/fake_upload_file/post/operation.py @@ -180,7 +180,8 @@ class instances status: typing_extensions.Literal[ '200', ] - api_response = _status_code_to_response[status].deserialize(response, self.api_client.schema_configuration) + api_response = _status_code_to_response[status].deserialize( + response, self.api_client.schema_configuration) else: api_response = api_client.ApiResponseWithoutDeserialization(response=response) diff --git a/samples/openapi3/client/petstore/python/src/petstore_api/paths/fake_upload_file/post/responses/response_200/__init__.py b/samples/openapi3/client/petstore/python/src/petstore_api/paths/fake_upload_file/post/responses/response_200/__init__.py index 703121eadd8..60c9bf3cf80 100644 --- a/samples/openapi3/client/petstore/python/src/petstore_api/paths/fake_upload_file/post/responses/response_200/__init__.py +++ b/samples/openapi3/client/petstore/python/src/petstore_api/paths/fake_upload_file/post/responses/response_200/__init__.py @@ -25,9 +25,7 @@ @dataclasses.dataclass class _ApiResponse(api_client.ApiResponse): response: urllib3.HTTPResponse - body: typing.Union[ - application_json_schema.Schema, - ] + body: application_json_schema.Schema headers: schemas.Unset = schemas.unset diff --git a/samples/openapi3/client/petstore/python/src/petstore_api/paths/fake_upload_files/post/operation.py b/samples/openapi3/client/petstore/python/src/petstore_api/paths/fake_upload_files/post/operation.py index 00dc8f8edc9..c873e2be5f0 100644 --- a/samples/openapi3/client/petstore/python/src/petstore_api/paths/fake_upload_files/post/operation.py +++ b/samples/openapi3/client/petstore/python/src/petstore_api/paths/fake_upload_files/post/operation.py @@ -180,7 +180,8 @@ class instances status: typing_extensions.Literal[ '200', ] - api_response = _status_code_to_response[status].deserialize(response, self.api_client.schema_configuration) + api_response = _status_code_to_response[status].deserialize( + response, self.api_client.schema_configuration) else: api_response = api_client.ApiResponseWithoutDeserialization(response=response) diff --git a/samples/openapi3/client/petstore/python/src/petstore_api/paths/fake_upload_files/post/responses/response_200/__init__.py b/samples/openapi3/client/petstore/python/src/petstore_api/paths/fake_upload_files/post/responses/response_200/__init__.py index 703121eadd8..60c9bf3cf80 100644 --- a/samples/openapi3/client/petstore/python/src/petstore_api/paths/fake_upload_files/post/responses/response_200/__init__.py +++ b/samples/openapi3/client/petstore/python/src/petstore_api/paths/fake_upload_files/post/responses/response_200/__init__.py @@ -25,9 +25,7 @@ @dataclasses.dataclass class _ApiResponse(api_client.ApiResponse): response: urllib3.HTTPResponse - body: typing.Union[ - application_json_schema.Schema, - ] + body: application_json_schema.Schema headers: schemas.Unset = schemas.unset diff --git a/samples/openapi3/client/petstore/python/src/petstore_api/paths/fake_wild_card_responses/__init__.py b/samples/openapi3/client/petstore/python/src/petstore_api/paths/fake_wild_card_responses/__init__.py new file mode 100644 index 00000000000..eebf4174b26 --- /dev/null +++ b/samples/openapi3/client/petstore/python/src/petstore_api/paths/fake_wild_card_responses/__init__.py @@ -0,0 +1,5 @@ +# do not import all endpoints into this module because that uses a lot of memory and stack frames +# if you need the ability to import all endpoints from this module, import them with +# from petstore_api.apis.paths.fake_wild_card_responses import FakeWildCardResponses + +path = "/fake/wildCardResponses" \ No newline at end of file diff --git a/samples/openapi3/client/petstore/python/src/petstore_api/paths/fake_wild_card_responses/get/__init__.py b/samples/openapi3/client/petstore/python/src/petstore_api/paths/fake_wild_card_responses/get/__init__.py new file mode 100644 index 00000000000..e69de29bb2d diff --git a/samples/openapi3/client/petstore/python/src/petstore_api/paths/fake_wild_card_responses/get/operation.py b/samples/openapi3/client/petstore/python/src/petstore_api/paths/fake_wild_card_responses/get/operation.py new file mode 100644 index 00000000000..0ce8f8bb16b --- /dev/null +++ b/samples/openapi3/client/petstore/python/src/petstore_api/paths/fake_wild_card_responses/get/operation.py @@ -0,0 +1,291 @@ +# coding: utf-8 + +""" + + + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator +""" + +from dataclasses import dataclass +import typing_extensions +import urllib3 +from urllib3._collections import HTTPHeaderDict + +from petstore_api import api_client, exceptions +import datetime # noqa: F401 +import decimal # noqa: F401 +import functools # noqa: F401 +import io # noqa: F401 +import re # noqa: F401 +import typing # noqa: F401 +import typing_extensions # noqa: F401 +import uuid # noqa: F401 + +import frozendict # noqa: F401 + +from petstore_api import schemas # noqa: F401 + +from .. import path +from .responses import ( + response_1xx, + response_200, + response_2xx, + response_3xx, + response_4xx, + response_5xx, +) + + + +__StatusCodeToResponse = typing_extensions.TypedDict( + '__StatusCodeToResponse', + { + '200': typing.Type[response_200.ResponseFor200], + } +) +_status_code_to_response: __StatusCodeToResponse = { + '200': response_200.ResponseFor200, +} +__RangedStatusCodeToResponse = typing_extensions.TypedDict( + '__RangedStatusCodeToResponse', + { + '1': typing.Type[response_1xx.ResponseFor1XX], + '2': typing.Type[response_2xx.ResponseFor2XX], + '3': typing.Type[response_3xx.ResponseFor3XX], + '4': typing.Type[response_4xx.ResponseFor4XX], + '5': typing.Type[response_5xx.ResponseFor5XX], + } +) +_ranged_status_code_to_response: __RangedStatusCodeToResponse = { + '1': response_1xx.ResponseFor1XX, + '2': response_2xx.ResponseFor2XX, + '3': response_3xx.ResponseFor3XX, + '4': response_4xx.ResponseFor4XX, + '5': response_5xx.ResponseFor5XX, +} + +_all_accept_content_types = ( + "application/json", +) + + +class BaseApi(api_client.Api): + @typing.overload + def _wild_card_responses( + self, + accept_content_types: typing.Tuple[str] = _all_accept_content_types, + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: typing_extensions.Literal[False] = ..., + ) -> typing.Union[ + response_200.ResponseFor200.response_cls, + response_2xx.ResponseFor2XX.response_cls, + ]: ... + + @typing.overload + def _wild_card_responses( + self, + skip_deserialization: typing_extensions.Literal[True], + accept_content_types: typing.Tuple[str] = _all_accept_content_types, + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + ) -> api_client.ApiResponseWithoutDeserialization: ... + + @typing.overload + def _wild_card_responses( + self, + accept_content_types: typing.Tuple[str] = _all_accept_content_types, + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = ..., + ) -> typing.Union[ + response_200.ResponseFor200.response_cls, + response_2xx.ResponseFor2XX.response_cls, + api_client.ApiResponseWithoutDeserialization, + ]: ... + + def _wild_card_responses( + self, + accept_content_types: typing.Tuple[str] = _all_accept_content_types, + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = False, + ): + """ + operation with wildcard responses + :param skip_deserialization: If true then api_response.response will be set but + api_response.body and api_response.headers will not be deserialized into schema + class instances + """ + used_path = path + + _headers = HTTPHeaderDict() + # TODO add cookie handling + if accept_content_types: + for accept_content_type in accept_content_types: + _headers.add('Accept', accept_content_type) + host = self.api_client.configuration.get_server_url( + 'servers', server_index + ) + + response = self.api_client.call_api( + resource_path=used_path, + method='get', + host=host, + headers=_headers, + stream=stream, + timeout=timeout, + ) + + if skip_deserialization: + api_response = api_client.ApiResponseWithoutDeserialization(response=response) + else: + status = str(response.status) + ranged_response_status_code = status[0] + if status in _status_code_to_response: + status: typing_extensions.Literal[ + '200', + ] + api_response = _status_code_to_response[status].deserialize( + response, self.api_client.schema_configuration) + elif ranged_response_status_code in _ranged_status_code_to_response: + ranged_response_status_code: typing_extensions.Literal[ + '1', + '2', + '3', + '4', + '5', + ] + api_response = _ranged_status_code_to_response[ranged_response_status_code].deserialize( + response, self.api_client.schema_configuration) + else: + api_response = api_client.ApiResponseWithoutDeserialization(response=response) + + if not 200 <= response.status <= 299: + raise exceptions.ApiException( + status=response.status, + reason=response.reason, + api_response=api_response + ) + + return api_response + + +class WildCardResponses(BaseApi): + # this class is used by api classes that refer to endpoints with operationId.snakeCase fn names + + @typing.overload + def wild_card_responses( + self, + accept_content_types: typing.Tuple[str] = _all_accept_content_types, + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: typing_extensions.Literal[False] = ..., + ) -> typing.Union[ + response_200.ResponseFor200.response_cls, + response_2xx.ResponseFor2XX.response_cls, + ]: ... + + @typing.overload + def wild_card_responses( + self, + skip_deserialization: typing_extensions.Literal[True], + accept_content_types: typing.Tuple[str] = _all_accept_content_types, + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + ) -> api_client.ApiResponseWithoutDeserialization: ... + + @typing.overload + def wild_card_responses( + self, + accept_content_types: typing.Tuple[str] = _all_accept_content_types, + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = ..., + ) -> typing.Union[ + response_200.ResponseFor200.response_cls, + response_2xx.ResponseFor2XX.response_cls, + api_client.ApiResponseWithoutDeserialization, + ]: ... + + def wild_card_responses( + self, + accept_content_types: typing.Tuple[str] = _all_accept_content_types, + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = False, + ): + return self._wild_card_responses( + accept_content_types=accept_content_types, + server_index=server_index, + stream=stream, + timeout=timeout, + skip_deserialization=skip_deserialization + ) + + +class ApiForGet(BaseApi): + # this class is used by api classes that refer to endpoints by path and http method names + + @typing.overload + def get( + self, + accept_content_types: typing.Tuple[str] = _all_accept_content_types, + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: typing_extensions.Literal[False] = ..., + ) -> typing.Union[ + response_200.ResponseFor200.response_cls, + response_2xx.ResponseFor2XX.response_cls, + ]: ... + + @typing.overload + def get( + self, + skip_deserialization: typing_extensions.Literal[True], + accept_content_types: typing.Tuple[str] = _all_accept_content_types, + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + ) -> api_client.ApiResponseWithoutDeserialization: ... + + @typing.overload + def get( + self, + accept_content_types: typing.Tuple[str] = _all_accept_content_types, + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = ..., + ) -> typing.Union[ + response_200.ResponseFor200.response_cls, + response_2xx.ResponseFor2XX.response_cls, + api_client.ApiResponseWithoutDeserialization, + ]: ... + + def get( + self, + accept_content_types: typing.Tuple[str] = _all_accept_content_types, + server_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = False, + ): + return self._wild_card_responses( + accept_content_types=accept_content_types, + server_index=server_index, + stream=stream, + timeout=timeout, + skip_deserialization=skip_deserialization + ) + + diff --git a/samples/openapi3/client/petstore/python/src/petstore_api/paths/fake_wild_card_responses/get/responses/__init__.py b/samples/openapi3/client/petstore/python/src/petstore_api/paths/fake_wild_card_responses/get/responses/__init__.py new file mode 100644 index 00000000000..e69de29bb2d diff --git a/samples/openapi3/client/petstore/python/src/petstore_api/paths/fake_wild_card_responses/get/responses/response_1xx/__init__.py b/samples/openapi3/client/petstore/python/src/petstore_api/paths/fake_wild_card_responses/get/responses/response_1xx/__init__.py new file mode 100644 index 00000000000..ab29228ce06 --- /dev/null +++ b/samples/openapi3/client/petstore/python/src/petstore_api/paths/fake_wild_card_responses/get/responses/response_1xx/__init__.py @@ -0,0 +1,46 @@ +# coding: utf-8 + +""" + + + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator +""" + +import dataclasses +import datetime +import decimal +import io +import typing +import uuid + +import frozendict +import typing_extensions +import urllib3 + +from petstore_api import api_client +from petstore_api import schemas +from .content.application_json import schema as application_json_schema + + +@dataclasses.dataclass +class _ApiResponse(api_client.ApiResponse): + response: urllib3.HTTPResponse + body: application_json_schema.Schema + headers: schemas.Unset = schemas.unset + + +class ResponseFor1XX(api_client.OpenApiResponse[_ApiResponse]): + response_cls = _ApiResponse + + + class __ApplicationJsonMediaType(api_client.MediaType): + schema: typing.Type[application_json_schema.Schema] = application_json_schema.Schema + __Content = typing_extensions.TypedDict( + '__Content', + { + 'application/json': typing.Type[__ApplicationJsonMediaType], + } + ) + content: __Content = { + 'application/json': __ApplicationJsonMediaType, + } diff --git a/samples/openapi3/client/petstore/python/src/petstore_api/paths/fake_wild_card_responses/get/responses/response_1xx/content/__init__.py b/samples/openapi3/client/petstore/python/src/petstore_api/paths/fake_wild_card_responses/get/responses/response_1xx/content/__init__.py new file mode 100644 index 00000000000..e69de29bb2d diff --git a/samples/openapi3/client/petstore/python/src/petstore_api/paths/fake_wild_card_responses/get/responses/response_1xx/content/application_json/__init__.py b/samples/openapi3/client/petstore/python/src/petstore_api/paths/fake_wild_card_responses/get/responses/response_1xx/content/application_json/__init__.py new file mode 100644 index 00000000000..e69de29bb2d diff --git a/samples/openapi3/client/petstore/python/src/petstore_api/paths/fake_wild_card_responses/get/responses/response_1xx/content/application_json/schema.py b/samples/openapi3/client/petstore/python/src/petstore_api/paths/fake_wild_card_responses/get/responses/response_1xx/content/application_json/schema.py new file mode 100644 index 00000000000..03b3f1d7666 --- /dev/null +++ b/samples/openapi3/client/petstore/python/src/petstore_api/paths/fake_wild_card_responses/get/responses/response_1xx/content/application_json/schema.py @@ -0,0 +1,24 @@ +# coding: utf-8 + +""" + OpenAPI Petstore + + This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 + + The version of the OpenAPI document: 1.0.0 + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator +""" + +import datetime # noqa: F401 +import decimal # noqa: F401 +import functools # noqa: F401 +import io # noqa: F401 +import re # noqa: F401 +import typing # noqa: F401 +import typing_extensions # noqa: F401 +import uuid # noqa: F401 + +import frozendict # noqa: F401 + +from petstore_api import schemas # noqa: F401 +Schema = schemas.AnyTypeSchema diff --git a/samples/openapi3/client/petstore/python/src/petstore_api/paths/fake_wild_card_responses/get/responses/response_200/__init__.py b/samples/openapi3/client/petstore/python/src/petstore_api/paths/fake_wild_card_responses/get/responses/response_200/__init__.py new file mode 100644 index 00000000000..60c9bf3cf80 --- /dev/null +++ b/samples/openapi3/client/petstore/python/src/petstore_api/paths/fake_wild_card_responses/get/responses/response_200/__init__.py @@ -0,0 +1,46 @@ +# coding: utf-8 + +""" + + + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator +""" + +import dataclasses +import datetime +import decimal +import io +import typing +import uuid + +import frozendict +import typing_extensions +import urllib3 + +from petstore_api import api_client +from petstore_api import schemas +from .content.application_json import schema as application_json_schema + + +@dataclasses.dataclass +class _ApiResponse(api_client.ApiResponse): + response: urllib3.HTTPResponse + body: application_json_schema.Schema + headers: schemas.Unset = schemas.unset + + +class ResponseFor200(api_client.OpenApiResponse[_ApiResponse]): + response_cls = _ApiResponse + + + class __ApplicationJsonMediaType(api_client.MediaType): + schema: typing.Type[application_json_schema.Schema] = application_json_schema.Schema + __Content = typing_extensions.TypedDict( + '__Content', + { + 'application/json': typing.Type[__ApplicationJsonMediaType], + } + ) + content: __Content = { + 'application/json': __ApplicationJsonMediaType, + } diff --git a/samples/openapi3/client/petstore/python/src/petstore_api/paths/fake_wild_card_responses/get/responses/response_200/content/__init__.py b/samples/openapi3/client/petstore/python/src/petstore_api/paths/fake_wild_card_responses/get/responses/response_200/content/__init__.py new file mode 100644 index 00000000000..e69de29bb2d diff --git a/samples/openapi3/client/petstore/python/src/petstore_api/paths/fake_wild_card_responses/get/responses/response_200/content/application_json/__init__.py b/samples/openapi3/client/petstore/python/src/petstore_api/paths/fake_wild_card_responses/get/responses/response_200/content/application_json/__init__.py new file mode 100644 index 00000000000..e69de29bb2d diff --git a/samples/openapi3/client/petstore/python/src/petstore_api/paths/fake_wild_card_responses/get/responses/response_200/content/application_json/schema.py b/samples/openapi3/client/petstore/python/src/petstore_api/paths/fake_wild_card_responses/get/responses/response_200/content/application_json/schema.py new file mode 100644 index 00000000000..03b3f1d7666 --- /dev/null +++ b/samples/openapi3/client/petstore/python/src/petstore_api/paths/fake_wild_card_responses/get/responses/response_200/content/application_json/schema.py @@ -0,0 +1,24 @@ +# coding: utf-8 + +""" + OpenAPI Petstore + + This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 + + The version of the OpenAPI document: 1.0.0 + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator +""" + +import datetime # noqa: F401 +import decimal # noqa: F401 +import functools # noqa: F401 +import io # noqa: F401 +import re # noqa: F401 +import typing # noqa: F401 +import typing_extensions # noqa: F401 +import uuid # noqa: F401 + +import frozendict # noqa: F401 + +from petstore_api import schemas # noqa: F401 +Schema = schemas.AnyTypeSchema diff --git a/samples/openapi3/client/petstore/python/src/petstore_api/paths/fake_wild_card_responses/get/responses/response_2xx/__init__.py b/samples/openapi3/client/petstore/python/src/petstore_api/paths/fake_wild_card_responses/get/responses/response_2xx/__init__.py new file mode 100644 index 00000000000..2a17044b3da --- /dev/null +++ b/samples/openapi3/client/petstore/python/src/petstore_api/paths/fake_wild_card_responses/get/responses/response_2xx/__init__.py @@ -0,0 +1,46 @@ +# coding: utf-8 + +""" + + + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator +""" + +import dataclasses +import datetime +import decimal +import io +import typing +import uuid + +import frozendict +import typing_extensions +import urllib3 + +from petstore_api import api_client +from petstore_api import schemas +from .content.application_json import schema as application_json_schema + + +@dataclasses.dataclass +class _ApiResponse(api_client.ApiResponse): + response: urllib3.HTTPResponse + body: application_json_schema.Schema + headers: schemas.Unset = schemas.unset + + +class ResponseFor2XX(api_client.OpenApiResponse[_ApiResponse]): + response_cls = _ApiResponse + + + class __ApplicationJsonMediaType(api_client.MediaType): + schema: typing.Type[application_json_schema.Schema] = application_json_schema.Schema + __Content = typing_extensions.TypedDict( + '__Content', + { + 'application/json': typing.Type[__ApplicationJsonMediaType], + } + ) + content: __Content = { + 'application/json': __ApplicationJsonMediaType, + } diff --git a/samples/openapi3/client/petstore/python/src/petstore_api/paths/fake_wild_card_responses/get/responses/response_2xx/content/__init__.py b/samples/openapi3/client/petstore/python/src/petstore_api/paths/fake_wild_card_responses/get/responses/response_2xx/content/__init__.py new file mode 100644 index 00000000000..e69de29bb2d diff --git a/samples/openapi3/client/petstore/python/src/petstore_api/paths/fake_wild_card_responses/get/responses/response_2xx/content/application_json/__init__.py b/samples/openapi3/client/petstore/python/src/petstore_api/paths/fake_wild_card_responses/get/responses/response_2xx/content/application_json/__init__.py new file mode 100644 index 00000000000..e69de29bb2d diff --git a/samples/openapi3/client/petstore/python/src/petstore_api/paths/fake_wild_card_responses/get/responses/response_2xx/content/application_json/schema.py b/samples/openapi3/client/petstore/python/src/petstore_api/paths/fake_wild_card_responses/get/responses/response_2xx/content/application_json/schema.py new file mode 100644 index 00000000000..03b3f1d7666 --- /dev/null +++ b/samples/openapi3/client/petstore/python/src/petstore_api/paths/fake_wild_card_responses/get/responses/response_2xx/content/application_json/schema.py @@ -0,0 +1,24 @@ +# coding: utf-8 + +""" + OpenAPI Petstore + + This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 + + The version of the OpenAPI document: 1.0.0 + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator +""" + +import datetime # noqa: F401 +import decimal # noqa: F401 +import functools # noqa: F401 +import io # noqa: F401 +import re # noqa: F401 +import typing # noqa: F401 +import typing_extensions # noqa: F401 +import uuid # noqa: F401 + +import frozendict # noqa: F401 + +from petstore_api import schemas # noqa: F401 +Schema = schemas.AnyTypeSchema diff --git a/samples/openapi3/client/petstore/python/src/petstore_api/paths/fake_wild_card_responses/get/responses/response_3xx/__init__.py b/samples/openapi3/client/petstore/python/src/petstore_api/paths/fake_wild_card_responses/get/responses/response_3xx/__init__.py new file mode 100644 index 00000000000..31a0690e812 --- /dev/null +++ b/samples/openapi3/client/petstore/python/src/petstore_api/paths/fake_wild_card_responses/get/responses/response_3xx/__init__.py @@ -0,0 +1,46 @@ +# coding: utf-8 + +""" + + + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator +""" + +import dataclasses +import datetime +import decimal +import io +import typing +import uuid + +import frozendict +import typing_extensions +import urllib3 + +from petstore_api import api_client +from petstore_api import schemas +from .content.application_json import schema as application_json_schema + + +@dataclasses.dataclass +class _ApiResponse(api_client.ApiResponse): + response: urllib3.HTTPResponse + body: application_json_schema.Schema + headers: schemas.Unset = schemas.unset + + +class ResponseFor3XX(api_client.OpenApiResponse[_ApiResponse]): + response_cls = _ApiResponse + + + class __ApplicationJsonMediaType(api_client.MediaType): + schema: typing.Type[application_json_schema.Schema] = application_json_schema.Schema + __Content = typing_extensions.TypedDict( + '__Content', + { + 'application/json': typing.Type[__ApplicationJsonMediaType], + } + ) + content: __Content = { + 'application/json': __ApplicationJsonMediaType, + } diff --git a/samples/openapi3/client/petstore/python/src/petstore_api/paths/fake_wild_card_responses/get/responses/response_3xx/content/__init__.py b/samples/openapi3/client/petstore/python/src/petstore_api/paths/fake_wild_card_responses/get/responses/response_3xx/content/__init__.py new file mode 100644 index 00000000000..e69de29bb2d diff --git a/samples/openapi3/client/petstore/python/src/petstore_api/paths/fake_wild_card_responses/get/responses/response_3xx/content/application_json/__init__.py b/samples/openapi3/client/petstore/python/src/petstore_api/paths/fake_wild_card_responses/get/responses/response_3xx/content/application_json/__init__.py new file mode 100644 index 00000000000..e69de29bb2d diff --git a/samples/openapi3/client/petstore/python/src/petstore_api/paths/fake_wild_card_responses/get/responses/response_3xx/content/application_json/schema.py b/samples/openapi3/client/petstore/python/src/petstore_api/paths/fake_wild_card_responses/get/responses/response_3xx/content/application_json/schema.py new file mode 100644 index 00000000000..03b3f1d7666 --- /dev/null +++ b/samples/openapi3/client/petstore/python/src/petstore_api/paths/fake_wild_card_responses/get/responses/response_3xx/content/application_json/schema.py @@ -0,0 +1,24 @@ +# coding: utf-8 + +""" + OpenAPI Petstore + + This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 + + The version of the OpenAPI document: 1.0.0 + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator +""" + +import datetime # noqa: F401 +import decimal # noqa: F401 +import functools # noqa: F401 +import io # noqa: F401 +import re # noqa: F401 +import typing # noqa: F401 +import typing_extensions # noqa: F401 +import uuid # noqa: F401 + +import frozendict # noqa: F401 + +from petstore_api import schemas # noqa: F401 +Schema = schemas.AnyTypeSchema diff --git a/samples/openapi3/client/petstore/python/src/petstore_api/paths/fake_wild_card_responses/get/responses/response_4xx/__init__.py b/samples/openapi3/client/petstore/python/src/petstore_api/paths/fake_wild_card_responses/get/responses/response_4xx/__init__.py new file mode 100644 index 00000000000..e696ce70cc5 --- /dev/null +++ b/samples/openapi3/client/petstore/python/src/petstore_api/paths/fake_wild_card_responses/get/responses/response_4xx/__init__.py @@ -0,0 +1,46 @@ +# coding: utf-8 + +""" + + + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator +""" + +import dataclasses +import datetime +import decimal +import io +import typing +import uuid + +import frozendict +import typing_extensions +import urllib3 + +from petstore_api import api_client +from petstore_api import schemas +from .content.application_json import schema as application_json_schema + + +@dataclasses.dataclass +class _ApiResponse(api_client.ApiResponse): + response: urllib3.HTTPResponse + body: application_json_schema.Schema + headers: schemas.Unset = schemas.unset + + +class ResponseFor4XX(api_client.OpenApiResponse[_ApiResponse]): + response_cls = _ApiResponse + + + class __ApplicationJsonMediaType(api_client.MediaType): + schema: typing.Type[application_json_schema.Schema] = application_json_schema.Schema + __Content = typing_extensions.TypedDict( + '__Content', + { + 'application/json': typing.Type[__ApplicationJsonMediaType], + } + ) + content: __Content = { + 'application/json': __ApplicationJsonMediaType, + } diff --git a/samples/openapi3/client/petstore/python/src/petstore_api/paths/fake_wild_card_responses/get/responses/response_4xx/content/__init__.py b/samples/openapi3/client/petstore/python/src/petstore_api/paths/fake_wild_card_responses/get/responses/response_4xx/content/__init__.py new file mode 100644 index 00000000000..e69de29bb2d diff --git a/samples/openapi3/client/petstore/python/src/petstore_api/paths/fake_wild_card_responses/get/responses/response_4xx/content/application_json/__init__.py b/samples/openapi3/client/petstore/python/src/petstore_api/paths/fake_wild_card_responses/get/responses/response_4xx/content/application_json/__init__.py new file mode 100644 index 00000000000..e69de29bb2d diff --git a/samples/openapi3/client/petstore/python/src/petstore_api/paths/fake_wild_card_responses/get/responses/response_4xx/content/application_json/schema.py b/samples/openapi3/client/petstore/python/src/petstore_api/paths/fake_wild_card_responses/get/responses/response_4xx/content/application_json/schema.py new file mode 100644 index 00000000000..03b3f1d7666 --- /dev/null +++ b/samples/openapi3/client/petstore/python/src/petstore_api/paths/fake_wild_card_responses/get/responses/response_4xx/content/application_json/schema.py @@ -0,0 +1,24 @@ +# coding: utf-8 + +""" + OpenAPI Petstore + + This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 + + The version of the OpenAPI document: 1.0.0 + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator +""" + +import datetime # noqa: F401 +import decimal # noqa: F401 +import functools # noqa: F401 +import io # noqa: F401 +import re # noqa: F401 +import typing # noqa: F401 +import typing_extensions # noqa: F401 +import uuid # noqa: F401 + +import frozendict # noqa: F401 + +from petstore_api import schemas # noqa: F401 +Schema = schemas.AnyTypeSchema diff --git a/samples/openapi3/client/petstore/python/src/petstore_api/paths/fake_wild_card_responses/get/responses/response_5xx/__init__.py b/samples/openapi3/client/petstore/python/src/petstore_api/paths/fake_wild_card_responses/get/responses/response_5xx/__init__.py new file mode 100644 index 00000000000..fe67442e0b9 --- /dev/null +++ b/samples/openapi3/client/petstore/python/src/petstore_api/paths/fake_wild_card_responses/get/responses/response_5xx/__init__.py @@ -0,0 +1,46 @@ +# coding: utf-8 + +""" + + + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator +""" + +import dataclasses +import datetime +import decimal +import io +import typing +import uuid + +import frozendict +import typing_extensions +import urllib3 + +from petstore_api import api_client +from petstore_api import schemas +from .content.application_json import schema as application_json_schema + + +@dataclasses.dataclass +class _ApiResponse(api_client.ApiResponse): + response: urllib3.HTTPResponse + body: application_json_schema.Schema + headers: schemas.Unset = schemas.unset + + +class ResponseFor5XX(api_client.OpenApiResponse[_ApiResponse]): + response_cls = _ApiResponse + + + class __ApplicationJsonMediaType(api_client.MediaType): + schema: typing.Type[application_json_schema.Schema] = application_json_schema.Schema + __Content = typing_extensions.TypedDict( + '__Content', + { + 'application/json': typing.Type[__ApplicationJsonMediaType], + } + ) + content: __Content = { + 'application/json': __ApplicationJsonMediaType, + } diff --git a/samples/openapi3/client/petstore/python/src/petstore_api/paths/fake_wild_card_responses/get/responses/response_5xx/content/__init__.py b/samples/openapi3/client/petstore/python/src/petstore_api/paths/fake_wild_card_responses/get/responses/response_5xx/content/__init__.py new file mode 100644 index 00000000000..e69de29bb2d diff --git a/samples/openapi3/client/petstore/python/src/petstore_api/paths/fake_wild_card_responses/get/responses/response_5xx/content/application_json/__init__.py b/samples/openapi3/client/petstore/python/src/petstore_api/paths/fake_wild_card_responses/get/responses/response_5xx/content/application_json/__init__.py new file mode 100644 index 00000000000..e69de29bb2d diff --git a/samples/openapi3/client/petstore/python/src/petstore_api/paths/fake_wild_card_responses/get/responses/response_5xx/content/application_json/schema.py b/samples/openapi3/client/petstore/python/src/petstore_api/paths/fake_wild_card_responses/get/responses/response_5xx/content/application_json/schema.py new file mode 100644 index 00000000000..03b3f1d7666 --- /dev/null +++ b/samples/openapi3/client/petstore/python/src/petstore_api/paths/fake_wild_card_responses/get/responses/response_5xx/content/application_json/schema.py @@ -0,0 +1,24 @@ +# coding: utf-8 + +""" + OpenAPI Petstore + + This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 + + The version of the OpenAPI document: 1.0.0 + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator +""" + +import datetime # noqa: F401 +import decimal # noqa: F401 +import functools # noqa: F401 +import io # noqa: F401 +import re # noqa: F401 +import typing # noqa: F401 +import typing_extensions # noqa: F401 +import uuid # noqa: F401 + +import frozendict # noqa: F401 + +from petstore_api import schemas # noqa: F401 +Schema = schemas.AnyTypeSchema diff --git a/samples/openapi3/client/petstore/python/src/petstore_api/paths/foo/get/responses/response_default/__init__.py b/samples/openapi3/client/petstore/python/src/petstore_api/paths/foo/get/responses/response_default/__init__.py index bccc14e333f..25fe5df6d0c 100644 --- a/samples/openapi3/client/petstore/python/src/petstore_api/paths/foo/get/responses/response_default/__init__.py +++ b/samples/openapi3/client/petstore/python/src/petstore_api/paths/foo/get/responses/response_default/__init__.py @@ -25,9 +25,7 @@ @dataclasses.dataclass class _ApiResponse(api_client.ApiResponse): response: urllib3.HTTPResponse - body: typing.Union[ - application_json_schema.Schema, - ] + body: application_json_schema.Schema headers: schemas.Unset = schemas.unset diff --git a/samples/openapi3/client/petstore/python/src/petstore_api/paths/pet/post/operation.py b/samples/openapi3/client/petstore/python/src/petstore_api/paths/pet/post/operation.py index 3735669c8b8..01f5fa93edc 100644 --- a/samples/openapi3/client/petstore/python/src/petstore_api/paths/pet/post/operation.py +++ b/samples/openapi3/client/petstore/python/src/petstore_api/paths/pet/post/operation.py @@ -213,7 +213,8 @@ class instances '200', '405', ] - api_response = _status_code_to_response[status].deserialize(response, self.api_client.schema_configuration) + api_response = _status_code_to_response[status].deserialize( + response, self.api_client.schema_configuration) else: api_response = api_client.ApiResponseWithoutDeserialization(response=response) diff --git a/samples/openapi3/client/petstore/python/src/petstore_api/paths/pet/put/operation.py b/samples/openapi3/client/petstore/python/src/petstore_api/paths/pet/put/operation.py index e166f940e58..c3a3c1afaa6 100644 --- a/samples/openapi3/client/petstore/python/src/petstore_api/paths/pet/put/operation.py +++ b/samples/openapi3/client/petstore/python/src/petstore_api/paths/pet/put/operation.py @@ -211,7 +211,8 @@ class instances '404', '405', ] - api_response = _status_code_to_response[status].deserialize(response, self.api_client.schema_configuration) + api_response = _status_code_to_response[status].deserialize( + response, self.api_client.schema_configuration) else: api_response = api_client.ApiResponseWithoutDeserialization(response=response) diff --git a/samples/openapi3/client/petstore/python/src/petstore_api/paths/pet_find_by_status/get/operation.py b/samples/openapi3/client/petstore/python/src/petstore_api/paths/pet_find_by_status/get/operation.py index 6f91665e51d..d2ce07eb89f 100644 --- a/samples/openapi3/client/petstore/python/src/petstore_api/paths/pet_find_by_status/get/operation.py +++ b/samples/openapi3/client/petstore/python/src/petstore_api/paths/pet_find_by_status/get/operation.py @@ -189,7 +189,8 @@ class instances '200', '400', ] - api_response = _status_code_to_response[status].deserialize(response, self.api_client.schema_configuration) + api_response = _status_code_to_response[status].deserialize( + response, self.api_client.schema_configuration) else: api_response = api_client.ApiResponseWithoutDeserialization(response=response) diff --git a/samples/openapi3/client/petstore/python/src/petstore_api/paths/pet_find_by_tags/get/operation.py b/samples/openapi3/client/petstore/python/src/petstore_api/paths/pet_find_by_tags/get/operation.py index 30c442b71fc..2a912fb8657 100644 --- a/samples/openapi3/client/petstore/python/src/petstore_api/paths/pet_find_by_tags/get/operation.py +++ b/samples/openapi3/client/petstore/python/src/petstore_api/paths/pet_find_by_tags/get/operation.py @@ -171,7 +171,8 @@ class instances '200', '400', ] - api_response = _status_code_to_response[status].deserialize(response, self.api_client.schema_configuration) + api_response = _status_code_to_response[status].deserialize( + response, self.api_client.schema_configuration) else: api_response = api_client.ApiResponseWithoutDeserialization(response=response) diff --git a/samples/openapi3/client/petstore/python/src/petstore_api/paths/pet_pet_id/delete/operation.py b/samples/openapi3/client/petstore/python/src/petstore_api/paths/pet_pet_id/delete/operation.py index e5eb14c6659..783b4031ac5 100644 --- a/samples/openapi3/client/petstore/python/src/petstore_api/paths/pet_pet_id/delete/operation.py +++ b/samples/openapi3/client/petstore/python/src/petstore_api/paths/pet_pet_id/delete/operation.py @@ -204,7 +204,8 @@ class instances status: typing_extensions.Literal[ '400', ] - api_response = _status_code_to_response[status].deserialize(response, self.api_client.schema_configuration) + api_response = _status_code_to_response[status].deserialize( + response, self.api_client.schema_configuration) else: api_response = api_client.ApiResponseWithoutDeserialization(response=response) diff --git a/samples/openapi3/client/petstore/python/src/petstore_api/paths/pet_pet_id/get/operation.py b/samples/openapi3/client/petstore/python/src/petstore_api/paths/pet_pet_id/get/operation.py index 06adf8f064f..ae0076fb125 100644 --- a/samples/openapi3/client/petstore/python/src/petstore_api/paths/pet_pet_id/get/operation.py +++ b/samples/openapi3/client/petstore/python/src/petstore_api/paths/pet_pet_id/get/operation.py @@ -187,7 +187,8 @@ class instances '400', '404', ] - api_response = _status_code_to_response[status].deserialize(response, self.api_client.schema_configuration) + api_response = _status_code_to_response[status].deserialize( + response, self.api_client.schema_configuration) else: api_response = api_client.ApiResponseWithoutDeserialization(response=response) diff --git a/samples/openapi3/client/petstore/python/src/petstore_api/paths/pet_pet_id/post/operation.py b/samples/openapi3/client/petstore/python/src/petstore_api/paths/pet_pet_id/post/operation.py index d6521f8ac40..6e95c688956 100644 --- a/samples/openapi3/client/petstore/python/src/petstore_api/paths/pet_pet_id/post/operation.py +++ b/samples/openapi3/client/petstore/python/src/petstore_api/paths/pet_pet_id/post/operation.py @@ -226,7 +226,8 @@ class instances status: typing_extensions.Literal[ '405', ] - api_response = _status_code_to_response[status].deserialize(response, self.api_client.schema_configuration) + api_response = _status_code_to_response[status].deserialize( + response, self.api_client.schema_configuration) else: api_response = api_client.ApiResponseWithoutDeserialization(response=response) diff --git a/samples/openapi3/client/petstore/python/src/petstore_api/paths/pet_pet_id_upload_image/post/operation.py b/samples/openapi3/client/petstore/python/src/petstore_api/paths/pet_pet_id_upload_image/post/operation.py index acd45a55ca4..f0a14c85374 100644 --- a/samples/openapi3/client/petstore/python/src/petstore_api/paths/pet_pet_id_upload_image/post/operation.py +++ b/samples/openapi3/client/petstore/python/src/petstore_api/paths/pet_pet_id_upload_image/post/operation.py @@ -237,7 +237,8 @@ class instances status: typing_extensions.Literal[ '200', ] - api_response = _status_code_to_response[status].deserialize(response, self.api_client.schema_configuration) + api_response = _status_code_to_response[status].deserialize( + response, self.api_client.schema_configuration) else: api_response = api_client.ApiResponseWithoutDeserialization(response=response) diff --git a/samples/openapi3/client/petstore/python/src/petstore_api/paths/store_inventory/get/operation.py b/samples/openapi3/client/petstore/python/src/petstore_api/paths/store_inventory/get/operation.py index e27e4e511d0..41d3ff767de 100644 --- a/samples/openapi3/client/petstore/python/src/petstore_api/paths/store_inventory/get/operation.py +++ b/samples/openapi3/client/petstore/python/src/petstore_api/paths/store_inventory/get/operation.py @@ -136,7 +136,8 @@ class instances status: typing_extensions.Literal[ '200', ] - api_response = _status_code_to_response[status].deserialize(response, self.api_client.schema_configuration) + api_response = _status_code_to_response[status].deserialize( + response, self.api_client.schema_configuration) else: api_response = api_client.ApiResponseWithoutDeserialization(response=response) diff --git a/samples/openapi3/client/petstore/python/src/petstore_api/paths/store_order/post/operation.py b/samples/openapi3/client/petstore/python/src/petstore_api/paths/store_order/post/operation.py index f04c61a1db8..15643077446 100644 --- a/samples/openapi3/client/petstore/python/src/petstore_api/paths/store_order/post/operation.py +++ b/samples/openapi3/client/petstore/python/src/petstore_api/paths/store_order/post/operation.py @@ -184,7 +184,8 @@ class instances '200', '400', ] - api_response = _status_code_to_response[status].deserialize(response, self.api_client.schema_configuration) + api_response = _status_code_to_response[status].deserialize( + response, self.api_client.schema_configuration) else: api_response = api_client.ApiResponseWithoutDeserialization(response=response) diff --git a/samples/openapi3/client/petstore/python/src/petstore_api/paths/store_order_order_id/delete/operation.py b/samples/openapi3/client/petstore/python/src/petstore_api/paths/store_order_order_id/delete/operation.py index 9b14d0ffda5..492731c8379 100644 --- a/samples/openapi3/client/petstore/python/src/petstore_api/paths/store_order_order_id/delete/operation.py +++ b/samples/openapi3/client/petstore/python/src/petstore_api/paths/store_order_order_id/delete/operation.py @@ -150,7 +150,8 @@ class instances '400', '404', ] - api_response = _status_code_to_response[status].deserialize(response, self.api_client.schema_configuration) + api_response = _status_code_to_response[status].deserialize( + response, self.api_client.schema_configuration) else: api_response = api_client.ApiResponseWithoutDeserialization(response=response) diff --git a/samples/openapi3/client/petstore/python/src/petstore_api/paths/store_order_order_id/get/operation.py b/samples/openapi3/client/petstore/python/src/petstore_api/paths/store_order_order_id/get/operation.py index 5e8280f3429..2a0de82a1c6 100644 --- a/samples/openapi3/client/petstore/python/src/petstore_api/paths/store_order_order_id/get/operation.py +++ b/samples/openapi3/client/petstore/python/src/petstore_api/paths/store_order_order_id/get/operation.py @@ -172,7 +172,8 @@ class instances '400', '404', ] - api_response = _status_code_to_response[status].deserialize(response, self.api_client.schema_configuration) + api_response = _status_code_to_response[status].deserialize( + response, self.api_client.schema_configuration) else: api_response = api_client.ApiResponseWithoutDeserialization(response=response) diff --git a/samples/openapi3/client/petstore/python/src/petstore_api/paths/user_login/get/operation.py b/samples/openapi3/client/petstore/python/src/petstore_api/paths/user_login/get/operation.py index 853bce64ba1..1c4b107d2df 100644 --- a/samples/openapi3/client/petstore/python/src/petstore_api/paths/user_login/get/operation.py +++ b/samples/openapi3/client/petstore/python/src/petstore_api/paths/user_login/get/operation.py @@ -173,7 +173,8 @@ class instances '200', '400', ] - api_response = _status_code_to_response[status].deserialize(response, self.api_client.schema_configuration) + api_response = _status_code_to_response[status].deserialize( + response, self.api_client.schema_configuration) else: api_response = api_client.ApiResponseWithoutDeserialization(response=response) diff --git a/samples/openapi3/client/petstore/python/src/petstore_api/paths/user_username/delete/operation.py b/samples/openapi3/client/petstore/python/src/petstore_api/paths/user_username/delete/operation.py index 859e836a7bb..90d0ecee454 100644 --- a/samples/openapi3/client/petstore/python/src/petstore_api/paths/user_username/delete/operation.py +++ b/samples/openapi3/client/petstore/python/src/petstore_api/paths/user_username/delete/operation.py @@ -152,7 +152,8 @@ class instances '200', '404', ] - api_response = _status_code_to_response[status].deserialize(response, self.api_client.schema_configuration) + api_response = _status_code_to_response[status].deserialize( + response, self.api_client.schema_configuration) else: api_response = api_client.ApiResponseWithoutDeserialization(response=response) diff --git a/samples/openapi3/client/petstore/python/src/petstore_api/paths/user_username/get/operation.py b/samples/openapi3/client/petstore/python/src/petstore_api/paths/user_username/get/operation.py index 928f3c821c0..69a0d0ca423 100644 --- a/samples/openapi3/client/petstore/python/src/petstore_api/paths/user_username/get/operation.py +++ b/samples/openapi3/client/petstore/python/src/petstore_api/paths/user_username/get/operation.py @@ -172,7 +172,8 @@ class instances '400', '404', ] - api_response = _status_code_to_response[status].deserialize(response, self.api_client.schema_configuration) + api_response = _status_code_to_response[status].deserialize( + response, self.api_client.schema_configuration) else: api_response = api_client.ApiResponseWithoutDeserialization(response=response) diff --git a/samples/openapi3/client/petstore/python/src/petstore_api/paths/user_username/put/operation.py b/samples/openapi3/client/petstore/python/src/petstore_api/paths/user_username/put/operation.py index b15bc67e362..681b26a0792 100644 --- a/samples/openapi3/client/petstore/python/src/petstore_api/paths/user_username/put/operation.py +++ b/samples/openapi3/client/petstore/python/src/petstore_api/paths/user_username/put/operation.py @@ -209,7 +209,8 @@ class instances '400', '404', ] - api_response = _status_code_to_response[status].deserialize(response, self.api_client.schema_configuration) + api_response = _status_code_to_response[status].deserialize( + response, self.api_client.schema_configuration) else: api_response = api_client.ApiResponseWithoutDeserialization(response=response) diff --git a/samples/openapi3/client/petstore/python/test/test_paths/test_another_fake_dummy/__init__.py b/samples/openapi3/client/petstore/python/test/test_paths/test_another_fake_dummy/__init__.py index 295ced7c297..e69de29bb2d 100644 --- a/samples/openapi3/client/petstore/python/test/test_paths/test_another_fake_dummy/__init__.py +++ b/samples/openapi3/client/petstore/python/test/test_paths/test_another_fake_dummy/__init__.py @@ -1,36 +0,0 @@ -# coding: utf-8 - -""" - - - Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator -""" - -import unittest -from unittest.mock import patch - -import urllib3 - -import petstore_api -from petstore_api.paths.another_fake_dummy.patch import operation as patch # noqa: E501 -from petstore_api import schemas, api_client -from petstore_api.configurations import api_configuration, schema_configuration - -from .. import ApiTestMixin - - -class TestPatch(ApiTestMixin, unittest.TestCase): - """ - Patch unit test stubs - To test special tags # noqa: E501 - """ - api_config = api_configuration.ApiConfiguration() - schema_config = schema_configuration.SchemaConfiguration() - used_api_client = api_client.ApiClient(configuration=api_config, schema_config=schema_config) - api = patch.ApiForPatch(api_client=used_api_client) # noqa: E501 - - response_status = 200 - response_body_schema = patch.response_200.ResponseFor200.content["application/json"].schema - -if __name__ == '__main__': - unittest.main() diff --git a/samples/openapi3/client/petstore/python/test/test_paths/test_fake/__init__.py b/samples/openapi3/client/petstore/python/test/test_paths/test_fake/__init__.py index ce587b120ba..e69de29bb2d 100644 --- a/samples/openapi3/client/petstore/python/test/test_paths/test_fake/__init__.py +++ b/samples/openapi3/client/petstore/python/test/test_paths/test_fake/__init__.py @@ -1,36 +0,0 @@ -# coding: utf-8 - -""" - - - Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator -""" - -import unittest -from unittest.mock import patch - -import urllib3 - -import petstore_api -from petstore_api.paths.fake.post import operation as post # noqa: E501 -from petstore_api import schemas, api_client -from petstore_api.configurations import api_configuration, schema_configuration - -from .. import ApiTestMixin - - -class TestPost(ApiTestMixin, unittest.TestCase): - """ - Post unit test stubs - Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 # noqa: E501 - """ - api_config = api_configuration.ApiConfiguration() - schema_config = schema_configuration.SchemaConfiguration() - used_api_client = api_client.ApiClient(configuration=api_config, schema_config=schema_config) - api = post.ApiForPost(api_client=used_api_client) # noqa: E501 - - response_status = 200 - response_body = '' - -if __name__ == '__main__': - unittest.main() diff --git a/samples/openapi3/client/petstore/python/test/test_paths/test_fake_additional_properties_with_array_of_enums/__init__.py b/samples/openapi3/client/petstore/python/test/test_paths/test_fake_additional_properties_with_array_of_enums/__init__.py index 15038a36a6f..e69de29bb2d 100644 --- a/samples/openapi3/client/petstore/python/test/test_paths/test_fake_additional_properties_with_array_of_enums/__init__.py +++ b/samples/openapi3/client/petstore/python/test/test_paths/test_fake_additional_properties_with_array_of_enums/__init__.py @@ -1,36 +0,0 @@ -# coding: utf-8 - -""" - - - Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator -""" - -import unittest -from unittest.mock import patch - -import urllib3 - -import petstore_api -from petstore_api.paths.fake_additional_properties_with_array_of_enums.get import operation as get # noqa: E501 -from petstore_api import schemas, api_client -from petstore_api.configurations import api_configuration, schema_configuration - -from .. import ApiTestMixin - - -class TestGet(ApiTestMixin, unittest.TestCase): - """ - Get unit test stubs - Additional Properties with Array of Enums # noqa: E501 - """ - api_config = api_configuration.ApiConfiguration() - schema_config = schema_configuration.SchemaConfiguration() - used_api_client = api_client.ApiClient(configuration=api_config, schema_config=schema_config) - api = get.ApiForGet(api_client=used_api_client) # noqa: E501 - - response_status = 200 - response_body_schema = get.response_200.ResponseFor200.content["application/json"].schema - -if __name__ == '__main__': - unittest.main() diff --git a/samples/openapi3/client/petstore/python/test/test_paths/test_fake_body_with_file_schema/__init__.py b/samples/openapi3/client/petstore/python/test/test_paths/test_fake_body_with_file_schema/__init__.py index d347f3e034a..e69de29bb2d 100644 --- a/samples/openapi3/client/petstore/python/test/test_paths/test_fake_body_with_file_schema/__init__.py +++ b/samples/openapi3/client/petstore/python/test/test_paths/test_fake_body_with_file_schema/__init__.py @@ -1,35 +0,0 @@ -# coding: utf-8 - -""" - - - Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator -""" - -import unittest -from unittest.mock import patch - -import urllib3 - -import petstore_api -from petstore_api.paths.fake_body_with_file_schema.put import operation as put # noqa: E501 -from petstore_api import schemas, api_client -from petstore_api.configurations import api_configuration, schema_configuration - -from .. import ApiTestMixin - - -class TestPut(ApiTestMixin, unittest.TestCase): - """ - Put unit test stubs - """ - api_config = api_configuration.ApiConfiguration() - schema_config = schema_configuration.SchemaConfiguration() - used_api_client = api_client.ApiClient(configuration=api_config, schema_config=schema_config) - api = put.ApiForPut(api_client=used_api_client) # noqa: E501 - - response_status = 200 - response_body = '' - -if __name__ == '__main__': - unittest.main() diff --git a/samples/openapi3/client/petstore/python/test/test_paths/test_fake_body_with_query_params/__init__.py b/samples/openapi3/client/petstore/python/test/test_paths/test_fake_body_with_query_params/__init__.py index ce4a1ce56d3..e69de29bb2d 100644 --- a/samples/openapi3/client/petstore/python/test/test_paths/test_fake_body_with_query_params/__init__.py +++ b/samples/openapi3/client/petstore/python/test/test_paths/test_fake_body_with_query_params/__init__.py @@ -1,35 +0,0 @@ -# coding: utf-8 - -""" - - - Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator -""" - -import unittest -from unittest.mock import patch - -import urllib3 - -import petstore_api -from petstore_api.paths.fake_body_with_query_params.put import operation as put # noqa: E501 -from petstore_api import schemas, api_client -from petstore_api.configurations import api_configuration, schema_configuration - -from .. import ApiTestMixin - - -class TestPut(ApiTestMixin, unittest.TestCase): - """ - Put unit test stubs - """ - api_config = api_configuration.ApiConfiguration() - schema_config = schema_configuration.SchemaConfiguration() - used_api_client = api_client.ApiClient(configuration=api_config, schema_config=schema_config) - api = put.ApiForPut(api_client=used_api_client) # noqa: E501 - - response_status = 200 - response_body = '' - -if __name__ == '__main__': - unittest.main() diff --git a/samples/openapi3/client/petstore/python/test/test_paths/test_fake_case_sensitive_params/__init__.py b/samples/openapi3/client/petstore/python/test/test_paths/test_fake_case_sensitive_params/__init__.py index 6b49adbffd5..e69de29bb2d 100644 --- a/samples/openapi3/client/petstore/python/test/test_paths/test_fake_case_sensitive_params/__init__.py +++ b/samples/openapi3/client/petstore/python/test/test_paths/test_fake_case_sensitive_params/__init__.py @@ -1,35 +0,0 @@ -# coding: utf-8 - -""" - - - Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator -""" - -import unittest -from unittest.mock import patch - -import urllib3 - -import petstore_api -from petstore_api.paths.fake_case_sensitive_params.put import operation as put # noqa: E501 -from petstore_api import schemas, api_client -from petstore_api.configurations import api_configuration, schema_configuration - -from .. import ApiTestMixin - - -class TestPut(ApiTestMixin, unittest.TestCase): - """ - Put unit test stubs - """ - api_config = api_configuration.ApiConfiguration() - schema_config = schema_configuration.SchemaConfiguration() - used_api_client = api_client.ApiClient(configuration=api_config, schema_config=schema_config) - api = put.ApiForPut(api_client=used_api_client) # noqa: E501 - - response_status = 200 - response_body = '' - -if __name__ == '__main__': - unittest.main() diff --git a/samples/openapi3/client/petstore/python/test/test_paths/test_fake_classname_test/__init__.py b/samples/openapi3/client/petstore/python/test/test_paths/test_fake_classname_test/__init__.py index d7a9c847f59..e69de29bb2d 100644 --- a/samples/openapi3/client/petstore/python/test/test_paths/test_fake_classname_test/__init__.py +++ b/samples/openapi3/client/petstore/python/test/test_paths/test_fake_classname_test/__init__.py @@ -1,36 +0,0 @@ -# coding: utf-8 - -""" - - - Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator -""" - -import unittest -from unittest.mock import patch - -import urllib3 - -import petstore_api -from petstore_api.paths.fake_classname_test.patch import operation as patch # noqa: E501 -from petstore_api import schemas, api_client -from petstore_api.configurations import api_configuration, schema_configuration - -from .. import ApiTestMixin - - -class TestPatch(ApiTestMixin, unittest.TestCase): - """ - Patch unit test stubs - To test class name in snake case # noqa: E501 - """ - api_config = api_configuration.ApiConfiguration() - schema_config = schema_configuration.SchemaConfiguration() - used_api_client = api_client.ApiClient(configuration=api_config, schema_config=schema_config) - api = patch.ApiForPatch(api_client=used_api_client) # noqa: E501 - - response_status = 200 - response_body_schema = patch.response_200.ResponseFor200.content["application/json"].schema - -if __name__ == '__main__': - unittest.main() diff --git a/samples/openapi3/client/petstore/python/test/test_paths/test_fake_delete_coffee_id/__init__.py b/samples/openapi3/client/petstore/python/test/test_paths/test_fake_delete_coffee_id/__init__.py index bff254ebddd..e69de29bb2d 100644 --- a/samples/openapi3/client/petstore/python/test/test_paths/test_fake_delete_coffee_id/__init__.py +++ b/samples/openapi3/client/petstore/python/test/test_paths/test_fake_delete_coffee_id/__init__.py @@ -1,36 +0,0 @@ -# coding: utf-8 - -""" - - - Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator -""" - -import unittest -from unittest.mock import patch - -import urllib3 - -import petstore_api -from petstore_api.paths.fake_delete_coffee_id.delete import operation as delete # noqa: E501 -from petstore_api import schemas, api_client -from petstore_api.configurations import api_configuration, schema_configuration - -from .. import ApiTestMixin - - -class TestDelete(ApiTestMixin, unittest.TestCase): - """ - Delete unit test stubs - Delete coffee # noqa: E501 - """ - api_config = api_configuration.ApiConfiguration() - schema_config = schema_configuration.SchemaConfiguration() - used_api_client = api_client.ApiClient(configuration=api_config, schema_config=schema_config) - api = delete.ApiForDelete(api_client=used_api_client) # noqa: E501 - - response_status = 200 - response_body = '' - -if __name__ == '__main__': - unittest.main() diff --git a/samples/openapi3/client/petstore/python/test/test_paths/test_fake_health/__init__.py b/samples/openapi3/client/petstore/python/test/test_paths/test_fake_health/__init__.py index ddad856cd1f..e69de29bb2d 100644 --- a/samples/openapi3/client/petstore/python/test/test_paths/test_fake_health/__init__.py +++ b/samples/openapi3/client/petstore/python/test/test_paths/test_fake_health/__init__.py @@ -1,36 +0,0 @@ -# coding: utf-8 - -""" - - - Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator -""" - -import unittest -from unittest.mock import patch - -import urllib3 - -import petstore_api -from petstore_api.paths.fake_health.get import operation as get # noqa: E501 -from petstore_api import schemas, api_client -from petstore_api.configurations import api_configuration, schema_configuration - -from .. import ApiTestMixin - - -class TestGet(ApiTestMixin, unittest.TestCase): - """ - Get unit test stubs - Health check endpoint # noqa: E501 - """ - api_config = api_configuration.ApiConfiguration() - schema_config = schema_configuration.SchemaConfiguration() - used_api_client = api_client.ApiClient(configuration=api_config, schema_config=schema_config) - api = get.ApiForGet(api_client=used_api_client) # noqa: E501 - - response_status = 200 - response_body_schema = get.response_200.ResponseFor200.content["application/json"].schema - -if __name__ == '__main__': - unittest.main() diff --git a/samples/openapi3/client/petstore/python/test/test_paths/test_fake_inline_additional_properties/__init__.py b/samples/openapi3/client/petstore/python/test/test_paths/test_fake_inline_additional_properties/__init__.py index 1d54a6c4ff2..e69de29bb2d 100644 --- a/samples/openapi3/client/petstore/python/test/test_paths/test_fake_inline_additional_properties/__init__.py +++ b/samples/openapi3/client/petstore/python/test/test_paths/test_fake_inline_additional_properties/__init__.py @@ -1,36 +0,0 @@ -# coding: utf-8 - -""" - - - Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator -""" - -import unittest -from unittest.mock import patch - -import urllib3 - -import petstore_api -from petstore_api.paths.fake_inline_additional_properties.post import operation as post # noqa: E501 -from petstore_api import schemas, api_client -from petstore_api.configurations import api_configuration, schema_configuration - -from .. import ApiTestMixin - - -class TestPost(ApiTestMixin, unittest.TestCase): - """ - Post unit test stubs - test inline additionalProperties # noqa: E501 - """ - api_config = api_configuration.ApiConfiguration() - schema_config = schema_configuration.SchemaConfiguration() - used_api_client = api_client.ApiClient(configuration=api_config, schema_config=schema_config) - api = post.ApiForPost(api_client=used_api_client) # noqa: E501 - - response_status = 200 - response_body = '' - -if __name__ == '__main__': - unittest.main() diff --git a/samples/openapi3/client/petstore/python/test/test_paths/test_fake_inline_composition/__init__.py b/samples/openapi3/client/petstore/python/test/test_paths/test_fake_inline_composition/__init__.py index 34ed20ab22f..e69de29bb2d 100644 --- a/samples/openapi3/client/petstore/python/test/test_paths/test_fake_inline_composition/__init__.py +++ b/samples/openapi3/client/petstore/python/test/test_paths/test_fake_inline_composition/__init__.py @@ -1,37 +0,0 @@ -# coding: utf-8 - -""" - - - Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator -""" - -import unittest -from unittest.mock import patch - -import urllib3 - -import petstore_api -from petstore_api.paths.fake_inline_composition.post import operation as post # noqa: E501 -from petstore_api import schemas, api_client -from petstore_api.configurations import api_configuration, schema_configuration - -from .. import ApiTestMixin - - -class TestPost(ApiTestMixin, unittest.TestCase): - """ - Post unit test stubs - testing composed schemas at inline locations # noqa: E501 - """ - api_config = api_configuration.ApiConfiguration() - schema_config = schema_configuration.SchemaConfiguration() - used_api_client = api_client.ApiClient(configuration=api_config, schema_config=schema_config) - api = post.ApiForPost(api_client=used_api_client) # noqa: E501 - - response_status = 200 - response_body_schema = post.response_200.ResponseFor200.content["application/json"].schema - response_body_schema = post.response_200.ResponseFor200.content["multipart/form-data"].schema - -if __name__ == '__main__': - unittest.main() diff --git a/samples/openapi3/client/petstore/python/test/test_paths/test_fake_json_form_data/__init__.py b/samples/openapi3/client/petstore/python/test/test_paths/test_fake_json_form_data/__init__.py index 77572401d63..e69de29bb2d 100644 --- a/samples/openapi3/client/petstore/python/test/test_paths/test_fake_json_form_data/__init__.py +++ b/samples/openapi3/client/petstore/python/test/test_paths/test_fake_json_form_data/__init__.py @@ -1,36 +0,0 @@ -# coding: utf-8 - -""" - - - Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator -""" - -import unittest -from unittest.mock import patch - -import urllib3 - -import petstore_api -from petstore_api.paths.fake_json_form_data.get import operation as get # noqa: E501 -from petstore_api import schemas, api_client -from petstore_api.configurations import api_configuration, schema_configuration - -from .. import ApiTestMixin - - -class TestGet(ApiTestMixin, unittest.TestCase): - """ - Get unit test stubs - test json serialization of form data # noqa: E501 - """ - api_config = api_configuration.ApiConfiguration() - schema_config = schema_configuration.SchemaConfiguration() - used_api_client = api_client.ApiClient(configuration=api_config, schema_config=schema_config) - api = get.ApiForGet(api_client=used_api_client) # noqa: E501 - - response_status = 200 - response_body = '' - -if __name__ == '__main__': - unittest.main() diff --git a/samples/openapi3/client/petstore/python/test/test_paths/test_fake_json_patch/__init__.py b/samples/openapi3/client/petstore/python/test/test_paths/test_fake_json_patch/__init__.py index c85ae28eaba..e69de29bb2d 100644 --- a/samples/openapi3/client/petstore/python/test/test_paths/test_fake_json_patch/__init__.py +++ b/samples/openapi3/client/petstore/python/test/test_paths/test_fake_json_patch/__init__.py @@ -1,36 +0,0 @@ -# coding: utf-8 - -""" - - - Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator -""" - -import unittest -from unittest.mock import patch - -import urllib3 - -import petstore_api -from petstore_api.paths.fake_json_patch.patch import operation as patch # noqa: E501 -from petstore_api import schemas, api_client -from petstore_api.configurations import api_configuration, schema_configuration - -from .. import ApiTestMixin - - -class TestPatch(ApiTestMixin, unittest.TestCase): - """ - Patch unit test stubs - json patch # noqa: E501 - """ - api_config = api_configuration.ApiConfiguration() - schema_config = schema_configuration.SchemaConfiguration() - used_api_client = api_client.ApiClient(configuration=api_config, schema_config=schema_config) - api = patch.ApiForPatch(api_client=used_api_client) # noqa: E501 - - response_status = 200 - response_body = '' - -if __name__ == '__main__': - unittest.main() diff --git a/samples/openapi3/client/petstore/python/test/test_paths/test_fake_json_with_charset/__init__.py b/samples/openapi3/client/petstore/python/test/test_paths/test_fake_json_with_charset/__init__.py index b73bc057686..e69de29bb2d 100644 --- a/samples/openapi3/client/petstore/python/test/test_paths/test_fake_json_with_charset/__init__.py +++ b/samples/openapi3/client/petstore/python/test/test_paths/test_fake_json_with_charset/__init__.py @@ -1,36 +0,0 @@ -# coding: utf-8 - -""" - - - Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator -""" - -import unittest -from unittest.mock import patch - -import urllib3 - -import petstore_api -from petstore_api.paths.fake_json_with_charset.post import operation as post # noqa: E501 -from petstore_api import schemas, api_client -from petstore_api.configurations import api_configuration, schema_configuration - -from .. import ApiTestMixin - - -class TestPost(ApiTestMixin, unittest.TestCase): - """ - Post unit test stubs - json with charset tx and rx # noqa: E501 - """ - api_config = api_configuration.ApiConfiguration() - schema_config = schema_configuration.SchemaConfiguration() - used_api_client = api_client.ApiClient(configuration=api_config, schema_config=schema_config) - api = post.ApiForPost(api_client=used_api_client) # noqa: E501 - - response_status = 200 - response_body_schema = post.response_200.ResponseFor200.content["application/json; charset=utf-8"].schema - -if __name__ == '__main__': - unittest.main() diff --git a/samples/openapi3/client/petstore/python/test/test_paths/test_fake_multiple_response_bodies/__init__.py b/samples/openapi3/client/petstore/python/test/test_paths/test_fake_multiple_response_bodies/__init__.py index 49f35805fef..e69de29bb2d 100644 --- a/samples/openapi3/client/petstore/python/test/test_paths/test_fake_multiple_response_bodies/__init__.py +++ b/samples/openapi3/client/petstore/python/test/test_paths/test_fake_multiple_response_bodies/__init__.py @@ -1,36 +0,0 @@ -# coding: utf-8 - -""" - - - Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator -""" - -import unittest -from unittest.mock import patch - -import urllib3 - -import petstore_api -from petstore_api.paths.fake_multiple_response_bodies.get import operation as get # noqa: E501 -from petstore_api import schemas, api_client -from petstore_api.configurations import api_configuration, schema_configuration - -from .. import ApiTestMixin - - -class TestGet(ApiTestMixin, unittest.TestCase): - """ - Get unit test stubs - multiple responses have response bodies # noqa: E501 - """ - api_config = api_configuration.ApiConfiguration() - schema_config = schema_configuration.SchemaConfiguration() - used_api_client = api_client.ApiClient(configuration=api_config, schema_config=schema_config) - api = get.ApiForGet(api_client=used_api_client) # noqa: E501 - - response_status = 200 - response_body_schema = get.response_200.ResponseFor200.content["application/json"].schema - -if __name__ == '__main__': - unittest.main() diff --git a/samples/openapi3/client/petstore/python/test/test_paths/test_fake_multiple_securities/__init__.py b/samples/openapi3/client/petstore/python/test/test_paths/test_fake_multiple_securities/__init__.py index 10f2dc70147..e69de29bb2d 100644 --- a/samples/openapi3/client/petstore/python/test/test_paths/test_fake_multiple_securities/__init__.py +++ b/samples/openapi3/client/petstore/python/test/test_paths/test_fake_multiple_securities/__init__.py @@ -1,36 +0,0 @@ -# coding: utf-8 - -""" - - - Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator -""" - -import unittest -from unittest.mock import patch - -import urllib3 - -import petstore_api -from petstore_api.paths.fake_multiple_securities.get import operation as get # noqa: E501 -from petstore_api import schemas, api_client -from petstore_api.configurations import api_configuration, schema_configuration - -from .. import ApiTestMixin - - -class TestGet(ApiTestMixin, unittest.TestCase): - """ - Get unit test stubs - multiple security requirements # noqa: E501 - """ - api_config = api_configuration.ApiConfiguration() - schema_config = schema_configuration.SchemaConfiguration() - used_api_client = api_client.ApiClient(configuration=api_config, schema_config=schema_config) - api = get.ApiForGet(api_client=used_api_client) # noqa: E501 - - response_status = 200 - response_body_schema = get.response_200.ResponseFor200.content["application/json"].schema - -if __name__ == '__main__': - unittest.main() diff --git a/samples/openapi3/client/petstore/python/test/test_paths/test_fake_obj_in_query/__init__.py b/samples/openapi3/client/petstore/python/test/test_paths/test_fake_obj_in_query/__init__.py index 2d057036cfd..e69de29bb2d 100644 --- a/samples/openapi3/client/petstore/python/test/test_paths/test_fake_obj_in_query/__init__.py +++ b/samples/openapi3/client/petstore/python/test/test_paths/test_fake_obj_in_query/__init__.py @@ -1,36 +0,0 @@ -# coding: utf-8 - -""" - - - Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator -""" - -import unittest -from unittest.mock import patch - -import urllib3 - -import petstore_api -from petstore_api.paths.fake_obj_in_query.get import operation as get # noqa: E501 -from petstore_api import schemas, api_client -from petstore_api.configurations import api_configuration, schema_configuration - -from .. import ApiTestMixin - - -class TestGet(ApiTestMixin, unittest.TestCase): - """ - Get unit test stubs - user list # noqa: E501 - """ - api_config = api_configuration.ApiConfiguration() - schema_config = schema_configuration.SchemaConfiguration() - used_api_client = api_client.ApiClient(configuration=api_config, schema_config=schema_config) - api = get.ApiForGet(api_client=used_api_client) # noqa: E501 - - response_status = 200 - response_body = '' - -if __name__ == '__main__': - unittest.main() diff --git a/samples/openapi3/client/petstore/python/test/test_paths/test_fake_parameter_collisions1_abab_self_ab/__init__.py b/samples/openapi3/client/petstore/python/test/test_paths/test_fake_parameter_collisions1_abab_self_ab/__init__.py index 6f656ac6a3d..e69de29bb2d 100644 --- a/samples/openapi3/client/petstore/python/test/test_paths/test_fake_parameter_collisions1_abab_self_ab/__init__.py +++ b/samples/openapi3/client/petstore/python/test/test_paths/test_fake_parameter_collisions1_abab_self_ab/__init__.py @@ -1,36 +0,0 @@ -# coding: utf-8 - -""" - - - Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator -""" - -import unittest -from unittest.mock import patch - -import urllib3 - -import petstore_api -from petstore_api.paths.fake_parameter_collisions1_abab_self_ab.post import operation as post # noqa: E501 -from petstore_api import schemas, api_client -from petstore_api.configurations import api_configuration, schema_configuration - -from .. import ApiTestMixin - - -class TestPost(ApiTestMixin, unittest.TestCase): - """ - Post unit test stubs - parameter collision case # noqa: E501 - """ - api_config = api_configuration.ApiConfiguration() - schema_config = schema_configuration.SchemaConfiguration() - used_api_client = api_client.ApiClient(configuration=api_config, schema_config=schema_config) - api = post.ApiForPost(api_client=used_api_client) # noqa: E501 - - response_status = 200 - response_body_schema = post.response_200.ResponseFor200.content["application/json"].schema - -if __name__ == '__main__': - unittest.main() diff --git a/samples/openapi3/client/petstore/python/test/test_paths/test_fake_pet_id_upload_image_with_required_file/__init__.py b/samples/openapi3/client/petstore/python/test/test_paths/test_fake_pet_id_upload_image_with_required_file/__init__.py index 2bc6225690b..e69de29bb2d 100644 --- a/samples/openapi3/client/petstore/python/test/test_paths/test_fake_pet_id_upload_image_with_required_file/__init__.py +++ b/samples/openapi3/client/petstore/python/test/test_paths/test_fake_pet_id_upload_image_with_required_file/__init__.py @@ -1,36 +0,0 @@ -# coding: utf-8 - -""" - - - Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator -""" - -import unittest -from unittest.mock import patch - -import urllib3 - -import petstore_api -from petstore_api.paths.fake_pet_id_upload_image_with_required_file.post import operation as post # noqa: E501 -from petstore_api import schemas, api_client -from petstore_api.configurations import api_configuration, schema_configuration - -from .. import ApiTestMixin - - -class TestPost(ApiTestMixin, unittest.TestCase): - """ - Post unit test stubs - uploads an image (required) # noqa: E501 - """ - api_config = api_configuration.ApiConfiguration() - schema_config = schema_configuration.SchemaConfiguration() - used_api_client = api_client.ApiClient(configuration=api_config, schema_config=schema_config) - api = post.ApiForPost(api_client=used_api_client) # noqa: E501 - - response_status = 200 - response_body_schema = post.response_200.ResponseFor200.content["application/json"].schema - -if __name__ == '__main__': - unittest.main() diff --git a/samples/openapi3/client/petstore/python/test/test_paths/test_fake_query_param_with_json_content_type/__init__.py b/samples/openapi3/client/petstore/python/test/test_paths/test_fake_query_param_with_json_content_type/__init__.py index 1c392f19d65..e69de29bb2d 100644 --- a/samples/openapi3/client/petstore/python/test/test_paths/test_fake_query_param_with_json_content_type/__init__.py +++ b/samples/openapi3/client/petstore/python/test/test_paths/test_fake_query_param_with_json_content_type/__init__.py @@ -1,36 +0,0 @@ -# coding: utf-8 - -""" - - - Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator -""" - -import unittest -from unittest.mock import patch - -import urllib3 - -import petstore_api -from petstore_api.paths.fake_query_param_with_json_content_type.get import operation as get # noqa: E501 -from petstore_api import schemas, api_client -from petstore_api.configurations import api_configuration, schema_configuration - -from .. import ApiTestMixin - - -class TestGet(ApiTestMixin, unittest.TestCase): - """ - Get unit test stubs - query param with json content-type # noqa: E501 - """ - api_config = api_configuration.ApiConfiguration() - schema_config = schema_configuration.SchemaConfiguration() - used_api_client = api_client.ApiClient(configuration=api_config, schema_config=schema_config) - api = get.ApiForGet(api_client=used_api_client) # noqa: E501 - - response_status = 200 - response_body_schema = get.response_200.ResponseFor200.content["application/json"].schema - -if __name__ == '__main__': - unittest.main() diff --git a/samples/openapi3/client/petstore/python/test/test_paths/test_fake_ref_obj_in_query/__init__.py b/samples/openapi3/client/petstore/python/test/test_paths/test_fake_ref_obj_in_query/__init__.py index 589474c5072..e69de29bb2d 100644 --- a/samples/openapi3/client/petstore/python/test/test_paths/test_fake_ref_obj_in_query/__init__.py +++ b/samples/openapi3/client/petstore/python/test/test_paths/test_fake_ref_obj_in_query/__init__.py @@ -1,36 +0,0 @@ -# coding: utf-8 - -""" - - - Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator -""" - -import unittest -from unittest.mock import patch - -import urllib3 - -import petstore_api -from petstore_api.paths.fake_ref_obj_in_query.get import operation as get # noqa: E501 -from petstore_api import schemas, api_client -from petstore_api.configurations import api_configuration, schema_configuration - -from .. import ApiTestMixin - - -class TestGet(ApiTestMixin, unittest.TestCase): - """ - Get unit test stubs - user list # noqa: E501 - """ - api_config = api_configuration.ApiConfiguration() - schema_config = schema_configuration.SchemaConfiguration() - used_api_client = api_client.ApiClient(configuration=api_config, schema_config=schema_config) - api = get.ApiForGet(api_client=used_api_client) # noqa: E501 - - response_status = 200 - response_body = '' - -if __name__ == '__main__': - unittest.main() diff --git a/samples/openapi3/client/petstore/python/test/test_paths/test_fake_refs_array_of_enums/__init__.py b/samples/openapi3/client/petstore/python/test/test_paths/test_fake_refs_array_of_enums/__init__.py index e47b4b131f2..e69de29bb2d 100644 --- a/samples/openapi3/client/petstore/python/test/test_paths/test_fake_refs_array_of_enums/__init__.py +++ b/samples/openapi3/client/petstore/python/test/test_paths/test_fake_refs_array_of_enums/__init__.py @@ -1,36 +0,0 @@ -# coding: utf-8 - -""" - - - Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator -""" - -import unittest -from unittest.mock import patch - -import urllib3 - -import petstore_api -from petstore_api.paths.fake_refs_array_of_enums.post import operation as post # noqa: E501 -from petstore_api import schemas, api_client -from petstore_api.configurations import api_configuration, schema_configuration - -from .. import ApiTestMixin - - -class TestPost(ApiTestMixin, unittest.TestCase): - """ - Post unit test stubs - Array of Enums # noqa: E501 - """ - api_config = api_configuration.ApiConfiguration() - schema_config = schema_configuration.SchemaConfiguration() - used_api_client = api_client.ApiClient(configuration=api_config, schema_config=schema_config) - api = post.ApiForPost(api_client=used_api_client) # noqa: E501 - - response_status = 200 - response_body_schema = post.response_200.ResponseFor200.content["application/json"].schema - -if __name__ == '__main__': - unittest.main() diff --git a/samples/openapi3/client/petstore/python/test/test_paths/test_fake_refs_arraymodel/__init__.py b/samples/openapi3/client/petstore/python/test/test_paths/test_fake_refs_arraymodel/__init__.py index 95361d1239f..e69de29bb2d 100644 --- a/samples/openapi3/client/petstore/python/test/test_paths/test_fake_refs_arraymodel/__init__.py +++ b/samples/openapi3/client/petstore/python/test/test_paths/test_fake_refs_arraymodel/__init__.py @@ -1,35 +0,0 @@ -# coding: utf-8 - -""" - - - Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator -""" - -import unittest -from unittest.mock import patch - -import urllib3 - -import petstore_api -from petstore_api.paths.fake_refs_arraymodel.post import operation as post # noqa: E501 -from petstore_api import schemas, api_client -from petstore_api.configurations import api_configuration, schema_configuration - -from .. import ApiTestMixin - - -class TestPost(ApiTestMixin, unittest.TestCase): - """ - Post unit test stubs - """ - api_config = api_configuration.ApiConfiguration() - schema_config = schema_configuration.SchemaConfiguration() - used_api_client = api_client.ApiClient(configuration=api_config, schema_config=schema_config) - api = post.ApiForPost(api_client=used_api_client) # noqa: E501 - - response_status = 200 - response_body_schema = post.response_200.ResponseFor200.content["application/json"].schema - -if __name__ == '__main__': - unittest.main() diff --git a/samples/openapi3/client/petstore/python/test/test_paths/test_fake_refs_boolean/__init__.py b/samples/openapi3/client/petstore/python/test/test_paths/test_fake_refs_boolean/__init__.py index 75d542bd834..e69de29bb2d 100644 --- a/samples/openapi3/client/petstore/python/test/test_paths/test_fake_refs_boolean/__init__.py +++ b/samples/openapi3/client/petstore/python/test/test_paths/test_fake_refs_boolean/__init__.py @@ -1,35 +0,0 @@ -# coding: utf-8 - -""" - - - Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator -""" - -import unittest -from unittest.mock import patch - -import urllib3 - -import petstore_api -from petstore_api.paths.fake_refs_boolean.post import operation as post # noqa: E501 -from petstore_api import schemas, api_client -from petstore_api.configurations import api_configuration, schema_configuration - -from .. import ApiTestMixin - - -class TestPost(ApiTestMixin, unittest.TestCase): - """ - Post unit test stubs - """ - api_config = api_configuration.ApiConfiguration() - schema_config = schema_configuration.SchemaConfiguration() - used_api_client = api_client.ApiClient(configuration=api_config, schema_config=schema_config) - api = post.ApiForPost(api_client=used_api_client) # noqa: E501 - - response_status = 200 - response_body_schema = post.response_200.ResponseFor200.content["application/json"].schema - -if __name__ == '__main__': - unittest.main() diff --git a/samples/openapi3/client/petstore/python/test/test_paths/test_fake_refs_composed_one_of_number_with_validations/__init__.py b/samples/openapi3/client/petstore/python/test/test_paths/test_fake_refs_composed_one_of_number_with_validations/__init__.py index 77e8c909de1..e69de29bb2d 100644 --- a/samples/openapi3/client/petstore/python/test/test_paths/test_fake_refs_composed_one_of_number_with_validations/__init__.py +++ b/samples/openapi3/client/petstore/python/test/test_paths/test_fake_refs_composed_one_of_number_with_validations/__init__.py @@ -1,35 +0,0 @@ -# coding: utf-8 - -""" - - - Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator -""" - -import unittest -from unittest.mock import patch - -import urllib3 - -import petstore_api -from petstore_api.paths.fake_refs_composed_one_of_number_with_validations.post import operation as post # noqa: E501 -from petstore_api import schemas, api_client -from petstore_api.configurations import api_configuration, schema_configuration - -from .. import ApiTestMixin - - -class TestPost(ApiTestMixin, unittest.TestCase): - """ - Post unit test stubs - """ - api_config = api_configuration.ApiConfiguration() - schema_config = schema_configuration.SchemaConfiguration() - used_api_client = api_client.ApiClient(configuration=api_config, schema_config=schema_config) - api = post.ApiForPost(api_client=used_api_client) # noqa: E501 - - response_status = 200 - response_body_schema = post.response_200.ResponseFor200.content["application/json"].schema - -if __name__ == '__main__': - unittest.main() diff --git a/samples/openapi3/client/petstore/python/test/test_paths/test_fake_refs_enum/__init__.py b/samples/openapi3/client/petstore/python/test/test_paths/test_fake_refs_enum/__init__.py index 5c248907fb9..e69de29bb2d 100644 --- a/samples/openapi3/client/petstore/python/test/test_paths/test_fake_refs_enum/__init__.py +++ b/samples/openapi3/client/petstore/python/test/test_paths/test_fake_refs_enum/__init__.py @@ -1,35 +0,0 @@ -# coding: utf-8 - -""" - - - Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator -""" - -import unittest -from unittest.mock import patch - -import urllib3 - -import petstore_api -from petstore_api.paths.fake_refs_enum.post import operation as post # noqa: E501 -from petstore_api import schemas, api_client -from petstore_api.configurations import api_configuration, schema_configuration - -from .. import ApiTestMixin - - -class TestPost(ApiTestMixin, unittest.TestCase): - """ - Post unit test stubs - """ - api_config = api_configuration.ApiConfiguration() - schema_config = schema_configuration.SchemaConfiguration() - used_api_client = api_client.ApiClient(configuration=api_config, schema_config=schema_config) - api = post.ApiForPost(api_client=used_api_client) # noqa: E501 - - response_status = 200 - response_body_schema = post.response_200.ResponseFor200.content["application/json"].schema - -if __name__ == '__main__': - unittest.main() diff --git a/samples/openapi3/client/petstore/python/test/test_paths/test_fake_refs_mammal/__init__.py b/samples/openapi3/client/petstore/python/test/test_paths/test_fake_refs_mammal/__init__.py index 5e5f22ebde5..e69de29bb2d 100644 --- a/samples/openapi3/client/petstore/python/test/test_paths/test_fake_refs_mammal/__init__.py +++ b/samples/openapi3/client/petstore/python/test/test_paths/test_fake_refs_mammal/__init__.py @@ -1,35 +0,0 @@ -# coding: utf-8 - -""" - - - Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator -""" - -import unittest -from unittest.mock import patch - -import urllib3 - -import petstore_api -from petstore_api.paths.fake_refs_mammal.post import operation as post # noqa: E501 -from petstore_api import schemas, api_client -from petstore_api.configurations import api_configuration, schema_configuration - -from .. import ApiTestMixin - - -class TestPost(ApiTestMixin, unittest.TestCase): - """ - Post unit test stubs - """ - api_config = api_configuration.ApiConfiguration() - schema_config = schema_configuration.SchemaConfiguration() - used_api_client = api_client.ApiClient(configuration=api_config, schema_config=schema_config) - api = post.ApiForPost(api_client=used_api_client) # noqa: E501 - - response_status = 200 - response_body_schema = post.response_200.ResponseFor200.content["application/json"].schema - -if __name__ == '__main__': - unittest.main() diff --git a/samples/openapi3/client/petstore/python/test/test_paths/test_fake_refs_number/__init__.py b/samples/openapi3/client/petstore/python/test/test_paths/test_fake_refs_number/__init__.py index 3c42de171a7..e69de29bb2d 100644 --- a/samples/openapi3/client/petstore/python/test/test_paths/test_fake_refs_number/__init__.py +++ b/samples/openapi3/client/petstore/python/test/test_paths/test_fake_refs_number/__init__.py @@ -1,35 +0,0 @@ -# coding: utf-8 - -""" - - - Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator -""" - -import unittest -from unittest.mock import patch - -import urllib3 - -import petstore_api -from petstore_api.paths.fake_refs_number.post import operation as post # noqa: E501 -from petstore_api import schemas, api_client -from petstore_api.configurations import api_configuration, schema_configuration - -from .. import ApiTestMixin - - -class TestPost(ApiTestMixin, unittest.TestCase): - """ - Post unit test stubs - """ - api_config = api_configuration.ApiConfiguration() - schema_config = schema_configuration.SchemaConfiguration() - used_api_client = api_client.ApiClient(configuration=api_config, schema_config=schema_config) - api = post.ApiForPost(api_client=used_api_client) # noqa: E501 - - response_status = 200 - response_body_schema = post.response_200.ResponseFor200.content["application/json"].schema - -if __name__ == '__main__': - unittest.main() diff --git a/samples/openapi3/client/petstore/python/test/test_paths/test_fake_refs_object_model_with_ref_props/__init__.py b/samples/openapi3/client/petstore/python/test/test_paths/test_fake_refs_object_model_with_ref_props/__init__.py index 0000cc2b2f2..e69de29bb2d 100644 --- a/samples/openapi3/client/petstore/python/test/test_paths/test_fake_refs_object_model_with_ref_props/__init__.py +++ b/samples/openapi3/client/petstore/python/test/test_paths/test_fake_refs_object_model_with_ref_props/__init__.py @@ -1,35 +0,0 @@ -# coding: utf-8 - -""" - - - Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator -""" - -import unittest -from unittest.mock import patch - -import urllib3 - -import petstore_api -from petstore_api.paths.fake_refs_object_model_with_ref_props.post import operation as post # noqa: E501 -from petstore_api import schemas, api_client -from petstore_api.configurations import api_configuration, schema_configuration - -from .. import ApiTestMixin - - -class TestPost(ApiTestMixin, unittest.TestCase): - """ - Post unit test stubs - """ - api_config = api_configuration.ApiConfiguration() - schema_config = schema_configuration.SchemaConfiguration() - used_api_client = api_client.ApiClient(configuration=api_config, schema_config=schema_config) - api = post.ApiForPost(api_client=used_api_client) # noqa: E501 - - response_status = 200 - response_body_schema = post.response_200.ResponseFor200.content["application/json"].schema - -if __name__ == '__main__': - unittest.main() diff --git a/samples/openapi3/client/petstore/python/test/test_paths/test_fake_refs_string/__init__.py b/samples/openapi3/client/petstore/python/test/test_paths/test_fake_refs_string/__init__.py index 5b2f2d5891f..e69de29bb2d 100644 --- a/samples/openapi3/client/petstore/python/test/test_paths/test_fake_refs_string/__init__.py +++ b/samples/openapi3/client/petstore/python/test/test_paths/test_fake_refs_string/__init__.py @@ -1,35 +0,0 @@ -# coding: utf-8 - -""" - - - Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator -""" - -import unittest -from unittest.mock import patch - -import urllib3 - -import petstore_api -from petstore_api.paths.fake_refs_string.post import operation as post # noqa: E501 -from petstore_api import schemas, api_client -from petstore_api.configurations import api_configuration, schema_configuration - -from .. import ApiTestMixin - - -class TestPost(ApiTestMixin, unittest.TestCase): - """ - Post unit test stubs - """ - api_config = api_configuration.ApiConfiguration() - schema_config = schema_configuration.SchemaConfiguration() - used_api_client = api_client.ApiClient(configuration=api_config, schema_config=schema_config) - api = post.ApiForPost(api_client=used_api_client) # noqa: E501 - - response_status = 200 - response_body_schema = post.response_200.ResponseFor200.content["application/json"].schema - -if __name__ == '__main__': - unittest.main() diff --git a/samples/openapi3/client/petstore/python/test/test_paths/test_fake_response_without_schema/__init__.py b/samples/openapi3/client/petstore/python/test/test_paths/test_fake_response_without_schema/__init__.py index 1e01e22d09f..e69de29bb2d 100644 --- a/samples/openapi3/client/petstore/python/test/test_paths/test_fake_response_without_schema/__init__.py +++ b/samples/openapi3/client/petstore/python/test/test_paths/test_fake_response_without_schema/__init__.py @@ -1,35 +0,0 @@ -# coding: utf-8 - -""" - - - Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator -""" - -import unittest -from unittest.mock import patch - -import urllib3 - -import petstore_api -from petstore_api.paths.fake_response_without_schema.get import operation as get # noqa: E501 -from petstore_api import schemas, api_client -from petstore_api.configurations import api_configuration, schema_configuration - -from .. import ApiTestMixin - - -class TestGet(ApiTestMixin, unittest.TestCase): - """ - Get unit test stubs - receives a response without schema # noqa: E501 - """ - api_config = api_configuration.ApiConfiguration() - schema_config = schema_configuration.SchemaConfiguration() - used_api_client = api_client.ApiClient(configuration=api_config, schema_config=schema_config) - api = get.ApiForGet(api_client=used_api_client) # noqa: E501 - - response_status = 200 - -if __name__ == '__main__': - unittest.main() diff --git a/samples/openapi3/client/petstore/python/test/test_paths/test_fake_test_query_paramters/__init__.py b/samples/openapi3/client/petstore/python/test/test_paths/test_fake_test_query_paramters/__init__.py index e98b08688b3..e69de29bb2d 100644 --- a/samples/openapi3/client/petstore/python/test/test_paths/test_fake_test_query_paramters/__init__.py +++ b/samples/openapi3/client/petstore/python/test/test_paths/test_fake_test_query_paramters/__init__.py @@ -1,35 +0,0 @@ -# coding: utf-8 - -""" - - - Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator -""" - -import unittest -from unittest.mock import patch - -import urllib3 - -import petstore_api -from petstore_api.paths.fake_test_query_paramters.put import operation as put # noqa: E501 -from petstore_api import schemas, api_client -from petstore_api.configurations import api_configuration, schema_configuration - -from .. import ApiTestMixin - - -class TestPut(ApiTestMixin, unittest.TestCase): - """ - Put unit test stubs - """ - api_config = api_configuration.ApiConfiguration() - schema_config = schema_configuration.SchemaConfiguration() - used_api_client = api_client.ApiClient(configuration=api_config, schema_config=schema_config) - api = put.ApiForPut(api_client=used_api_client) # noqa: E501 - - response_status = 200 - response_body = '' - -if __name__ == '__main__': - unittest.main() diff --git a/samples/openapi3/client/petstore/python/test/test_paths/test_fake_upload_download_file/__init__.py b/samples/openapi3/client/petstore/python/test/test_paths/test_fake_upload_download_file/__init__.py index 898198c6dc8..e69de29bb2d 100644 --- a/samples/openapi3/client/petstore/python/test/test_paths/test_fake_upload_download_file/__init__.py +++ b/samples/openapi3/client/petstore/python/test/test_paths/test_fake_upload_download_file/__init__.py @@ -1,36 +0,0 @@ -# coding: utf-8 - -""" - - - Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator -""" - -import unittest -from unittest.mock import patch - -import urllib3 - -import petstore_api -from petstore_api.paths.fake_upload_download_file.post import operation as post # noqa: E501 -from petstore_api import schemas, api_client -from petstore_api.configurations import api_configuration, schema_configuration - -from .. import ApiTestMixin - - -class TestPost(ApiTestMixin, unittest.TestCase): - """ - Post unit test stubs - uploads a file and downloads a file using application/octet-stream # noqa: E501 - """ - api_config = api_configuration.ApiConfiguration() - schema_config = schema_configuration.SchemaConfiguration() - used_api_client = api_client.ApiClient(configuration=api_config, schema_config=schema_config) - api = post.ApiForPost(api_client=used_api_client) # noqa: E501 - - response_status = 200 - response_body_schema = post.response_200.ResponseFor200.content["application/octet-stream"].schema - -if __name__ == '__main__': - unittest.main() diff --git a/samples/openapi3/client/petstore/python/test/test_paths/test_fake_upload_file/__init__.py b/samples/openapi3/client/petstore/python/test/test_paths/test_fake_upload_file/__init__.py index 8f5523053e6..e69de29bb2d 100644 --- a/samples/openapi3/client/petstore/python/test/test_paths/test_fake_upload_file/__init__.py +++ b/samples/openapi3/client/petstore/python/test/test_paths/test_fake_upload_file/__init__.py @@ -1,36 +0,0 @@ -# coding: utf-8 - -""" - - - Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator -""" - -import unittest -from unittest.mock import patch - -import urllib3 - -import petstore_api -from petstore_api.paths.fake_upload_file.post import operation as post # noqa: E501 -from petstore_api import schemas, api_client -from petstore_api.configurations import api_configuration, schema_configuration - -from .. import ApiTestMixin - - -class TestPost(ApiTestMixin, unittest.TestCase): - """ - Post unit test stubs - uploads a file using multipart/form-data # noqa: E501 - """ - api_config = api_configuration.ApiConfiguration() - schema_config = schema_configuration.SchemaConfiguration() - used_api_client = api_client.ApiClient(configuration=api_config, schema_config=schema_config) - api = post.ApiForPost(api_client=used_api_client) # noqa: E501 - - response_status = 200 - response_body_schema = post.response_200.ResponseFor200.content["application/json"].schema - -if __name__ == '__main__': - unittest.main() diff --git a/samples/openapi3/client/petstore/python/test/test_paths/test_fake_upload_files/__init__.py b/samples/openapi3/client/petstore/python/test/test_paths/test_fake_upload_files/__init__.py index 938d8cdbb5e..e69de29bb2d 100644 --- a/samples/openapi3/client/petstore/python/test/test_paths/test_fake_upload_files/__init__.py +++ b/samples/openapi3/client/petstore/python/test/test_paths/test_fake_upload_files/__init__.py @@ -1,36 +0,0 @@ -# coding: utf-8 - -""" - - - Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator -""" - -import unittest -from unittest.mock import patch - -import urllib3 - -import petstore_api -from petstore_api.paths.fake_upload_files.post import operation as post # noqa: E501 -from petstore_api import schemas, api_client -from petstore_api.configurations import api_configuration, schema_configuration - -from .. import ApiTestMixin - - -class TestPost(ApiTestMixin, unittest.TestCase): - """ - Post unit test stubs - uploads files using multipart/form-data # noqa: E501 - """ - api_config = api_configuration.ApiConfiguration() - schema_config = schema_configuration.SchemaConfiguration() - used_api_client = api_client.ApiClient(configuration=api_config, schema_config=schema_config) - api = post.ApiForPost(api_client=used_api_client) # noqa: E501 - - response_status = 200 - response_body_schema = post.response_200.ResponseFor200.content["application/json"].schema - -if __name__ == '__main__': - unittest.main() diff --git a/samples/openapi3/client/petstore/python/test/test_paths/test_fake_wild_card_responses/__init__.py b/samples/openapi3/client/petstore/python/test/test_paths/test_fake_wild_card_responses/__init__.py new file mode 100644 index 00000000000..e69de29bb2d diff --git a/samples/openapi3/client/petstore/python/test/test_paths/test_fake_wild_card_responses/test_get.py b/samples/openapi3/client/petstore/python/test/test_paths/test_fake_wild_card_responses/test_get.py new file mode 100644 index 00000000000..821a4484bc4 --- /dev/null +++ b/samples/openapi3/client/petstore/python/test/test_paths/test_fake_wild_card_responses/test_get.py @@ -0,0 +1,36 @@ +# coding: utf-8 + +""" + + + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator +""" + +import unittest +from unittest.mock import patch + +import urllib3 + +import petstore_api +from petstore_api.paths.fake_wild_card_responses.get import operation as get # noqa: E501 +from petstore_api import schemas, api_client +from petstore_api.configurations import api_configuration, schema_configuration + +from .. import ApiTestMixin + + +class TestGet(ApiTestMixin, unittest.TestCase): + """ + Get unit test stubs + operation with wildcard responses # noqa: E501 + """ + api_config = api_configuration.ApiConfiguration() + schema_config = schema_configuration.SchemaConfiguration() + used_api_client = api_client.ApiClient(configuration=api_config, schema_config=schema_config) + api = get.ApiForGet(api_client=used_api_client) # noqa: E501 + + response_status = 200 + response_body_schema = get.response_200.ResponseFor200.content["application/json"].schema + +if __name__ == '__main__': + unittest.main() diff --git a/samples/openapi3/client/petstore/python/test/test_paths/test_foo/__init__.py b/samples/openapi3/client/petstore/python/test/test_paths/test_foo/__init__.py index a5e79fc4f5c..e69de29bb2d 100644 --- a/samples/openapi3/client/petstore/python/test/test_paths/test_foo/__init__.py +++ b/samples/openapi3/client/petstore/python/test/test_paths/test_foo/__init__.py @@ -1,35 +0,0 @@ -# coding: utf-8 - -""" - - - Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator -""" - -import unittest -from unittest.mock import patch - -import urllib3 - -import petstore_api -from petstore_api.paths.foo.get import operation as get # noqa: E501 -from petstore_api import schemas, api_client -from petstore_api.configurations import api_configuration, schema_configuration - -from .. import ApiTestMixin - - -class TestGet(ApiTestMixin, unittest.TestCase): - """ - Get unit test stubs - """ - api_config = api_configuration.ApiConfiguration() - schema_config = schema_configuration.SchemaConfiguration() - used_api_client = api_client.ApiClient(configuration=api_config, schema_config=schema_config) - api = get.ApiForGet(api_client=used_api_client) # noqa: E501 - - response_status = 0 - response_body_schema = get.response_default.Default.content["application/json"].schema - -if __name__ == '__main__': - unittest.main() diff --git a/samples/openapi3/client/petstore/python/test/test_paths/test_foo/test_get.py b/samples/openapi3/client/petstore/python/test/test_paths/test_foo/test_get.py index a5e79fc4f5c..f3259ec55f9 100644 --- a/samples/openapi3/client/petstore/python/test/test_paths/test_foo/test_get.py +++ b/samples/openapi3/client/petstore/python/test/test_paths/test_foo/test_get.py @@ -28,7 +28,7 @@ class TestGet(ApiTestMixin, unittest.TestCase): used_api_client = api_client.ApiClient(configuration=api_config, schema_config=schema_config) api = get.ApiForGet(api_client=used_api_client) # noqa: E501 - response_status = 0 + response_status = 200 response_body_schema = get.response_default.Default.content["application/json"].schema if __name__ == '__main__': diff --git a/samples/openapi3/client/petstore/python/test/test_paths/test_pet/__init__.py b/samples/openapi3/client/petstore/python/test/test_paths/test_pet/__init__.py index da310fd6921..e69de29bb2d 100644 --- a/samples/openapi3/client/petstore/python/test/test_paths/test_pet/__init__.py +++ b/samples/openapi3/client/petstore/python/test/test_paths/test_pet/__init__.py @@ -1,36 +0,0 @@ -# coding: utf-8 - -""" - - - Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator -""" - -import unittest -from unittest.mock import patch - -import urllib3 - -import petstore_api -from petstore_api.paths.pet.put import operation as put # noqa: E501 -from petstore_api import schemas, api_client -from petstore_api.configurations import api_configuration, schema_configuration - -from .. import ApiTestMixin - - -class TestPut(ApiTestMixin, unittest.TestCase): - """ - Put unit test stubs - Update an existing pet # noqa: E501 - """ - api_config = api_configuration.ApiConfiguration() - schema_config = schema_configuration.SchemaConfiguration() - used_api_client = api_client.ApiClient(configuration=api_config, schema_config=schema_config) - api = put.ApiForPut(api_client=used_api_client) # noqa: E501 - - response_status = 400 - response_body = '' - -if __name__ == '__main__': - unittest.main() diff --git a/samples/openapi3/client/petstore/python/test/test_paths/test_pet_find_by_status/__init__.py b/samples/openapi3/client/petstore/python/test/test_paths/test_pet_find_by_status/__init__.py index 66c1de935af..e69de29bb2d 100644 --- a/samples/openapi3/client/petstore/python/test/test_paths/test_pet_find_by_status/__init__.py +++ b/samples/openapi3/client/petstore/python/test/test_paths/test_pet_find_by_status/__init__.py @@ -1,37 +0,0 @@ -# coding: utf-8 - -""" - - - Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator -""" - -import unittest -from unittest.mock import patch - -import urllib3 - -import petstore_api -from petstore_api.paths.pet_find_by_status.get import operation as get # noqa: E501 -from petstore_api import schemas, api_client -from petstore_api.configurations import api_configuration, schema_configuration - -from .. import ApiTestMixin - - -class TestGet(ApiTestMixin, unittest.TestCase): - """ - Get unit test stubs - Finds Pets by status # noqa: E501 - """ - api_config = api_configuration.ApiConfiguration() - schema_config = schema_configuration.SchemaConfiguration() - used_api_client = api_client.ApiClient(configuration=api_config, schema_config=schema_config) - api = get.ApiForGet(api_client=used_api_client) # noqa: E501 - - response_status = 200 - response_body_schema = get.response_200.ResponseFor200.content["application/xml"].schema - response_body_schema = get.response_200.ResponseFor200.content["application/json"].schema - -if __name__ == '__main__': - unittest.main() diff --git a/samples/openapi3/client/petstore/python/test/test_paths/test_pet_find_by_tags/__init__.py b/samples/openapi3/client/petstore/python/test/test_paths/test_pet_find_by_tags/__init__.py index c1972cf536b..e69de29bb2d 100644 --- a/samples/openapi3/client/petstore/python/test/test_paths/test_pet_find_by_tags/__init__.py +++ b/samples/openapi3/client/petstore/python/test/test_paths/test_pet_find_by_tags/__init__.py @@ -1,37 +0,0 @@ -# coding: utf-8 - -""" - - - Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator -""" - -import unittest -from unittest.mock import patch - -import urllib3 - -import petstore_api -from petstore_api.paths.pet_find_by_tags.get import operation as get # noqa: E501 -from petstore_api import schemas, api_client -from petstore_api.configurations import api_configuration, schema_configuration - -from .. import ApiTestMixin - - -class TestGet(ApiTestMixin, unittest.TestCase): - """ - Get unit test stubs - Finds Pets by tags # noqa: E501 - """ - api_config = api_configuration.ApiConfiguration() - schema_config = schema_configuration.SchemaConfiguration() - used_api_client = api_client.ApiClient(configuration=api_config, schema_config=schema_config) - api = get.ApiForGet(api_client=used_api_client) # noqa: E501 - - response_status = 200 - response_body_schema = get.response_200.ResponseFor200.content["application/xml"].schema - response_body_schema = get.response_200.ResponseFor200.content["application/json"].schema - -if __name__ == '__main__': - unittest.main() diff --git a/samples/openapi3/client/petstore/python/test/test_paths/test_pet_pet_id/__init__.py b/samples/openapi3/client/petstore/python/test/test_paths/test_pet_pet_id/__init__.py index f62d5e09d5f..e69de29bb2d 100644 --- a/samples/openapi3/client/petstore/python/test/test_paths/test_pet_pet_id/__init__.py +++ b/samples/openapi3/client/petstore/python/test/test_paths/test_pet_pet_id/__init__.py @@ -1,36 +0,0 @@ -# coding: utf-8 - -""" - - - Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator -""" - -import unittest -from unittest.mock import patch - -import urllib3 - -import petstore_api -from petstore_api.paths.pet_pet_id.post import operation as post # noqa: E501 -from petstore_api import schemas, api_client -from petstore_api.configurations import api_configuration, schema_configuration - -from .. import ApiTestMixin - - -class TestPost(ApiTestMixin, unittest.TestCase): - """ - Post unit test stubs - Updates a pet in the store with form data # noqa: E501 - """ - api_config = api_configuration.ApiConfiguration() - schema_config = schema_configuration.SchemaConfiguration() - used_api_client = api_client.ApiClient(configuration=api_config, schema_config=schema_config) - api = post.ApiForPost(api_client=used_api_client) # noqa: E501 - - response_status = 405 - response_body = '' - -if __name__ == '__main__': - unittest.main() diff --git a/samples/openapi3/client/petstore/python/test/test_paths/test_pet_pet_id_upload_image/__init__.py b/samples/openapi3/client/petstore/python/test/test_paths/test_pet_pet_id_upload_image/__init__.py index ff5d246e62e..e69de29bb2d 100644 --- a/samples/openapi3/client/petstore/python/test/test_paths/test_pet_pet_id_upload_image/__init__.py +++ b/samples/openapi3/client/petstore/python/test/test_paths/test_pet_pet_id_upload_image/__init__.py @@ -1,36 +0,0 @@ -# coding: utf-8 - -""" - - - Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator -""" - -import unittest -from unittest.mock import patch - -import urllib3 - -import petstore_api -from petstore_api.paths.pet_pet_id_upload_image.post import operation as post # noqa: E501 -from petstore_api import schemas, api_client -from petstore_api.configurations import api_configuration, schema_configuration - -from .. import ApiTestMixin - - -class TestPost(ApiTestMixin, unittest.TestCase): - """ - Post unit test stubs - uploads an image # noqa: E501 - """ - api_config = api_configuration.ApiConfiguration() - schema_config = schema_configuration.SchemaConfiguration() - used_api_client = api_client.ApiClient(configuration=api_config, schema_config=schema_config) - api = post.ApiForPost(api_client=used_api_client) # noqa: E501 - - response_status = 200 - response_body_schema = post.response_200.ResponseFor200.content["application/json"].schema - -if __name__ == '__main__': - unittest.main() diff --git a/samples/openapi3/client/petstore/python/test/test_paths/test_store_inventory/__init__.py b/samples/openapi3/client/petstore/python/test/test_paths/test_store_inventory/__init__.py index fd29357b0c6..e69de29bb2d 100644 --- a/samples/openapi3/client/petstore/python/test/test_paths/test_store_inventory/__init__.py +++ b/samples/openapi3/client/petstore/python/test/test_paths/test_store_inventory/__init__.py @@ -1,36 +0,0 @@ -# coding: utf-8 - -""" - - - Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator -""" - -import unittest -from unittest.mock import patch - -import urllib3 - -import petstore_api -from petstore_api.paths.store_inventory.get import operation as get # noqa: E501 -from petstore_api import schemas, api_client -from petstore_api.configurations import api_configuration, schema_configuration - -from .. import ApiTestMixin - - -class TestGet(ApiTestMixin, unittest.TestCase): - """ - Get unit test stubs - Returns pet inventories by status # noqa: E501 - """ - api_config = api_configuration.ApiConfiguration() - schema_config = schema_configuration.SchemaConfiguration() - used_api_client = api_client.ApiClient(configuration=api_config, schema_config=schema_config) - api = get.ApiForGet(api_client=used_api_client) # noqa: E501 - - response_status = 200 - response_body_schema = get.response_200.ResponseFor200.content["application/json"].schema - -if __name__ == '__main__': - unittest.main() diff --git a/samples/openapi3/client/petstore/python/test/test_paths/test_store_order/__init__.py b/samples/openapi3/client/petstore/python/test/test_paths/test_store_order/__init__.py index 1a80c00d068..e69de29bb2d 100644 --- a/samples/openapi3/client/petstore/python/test/test_paths/test_store_order/__init__.py +++ b/samples/openapi3/client/petstore/python/test/test_paths/test_store_order/__init__.py @@ -1,37 +0,0 @@ -# coding: utf-8 - -""" - - - Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator -""" - -import unittest -from unittest.mock import patch - -import urllib3 - -import petstore_api -from petstore_api.paths.store_order.post import operation as post # noqa: E501 -from petstore_api import schemas, api_client -from petstore_api.configurations import api_configuration, schema_configuration - -from .. import ApiTestMixin - - -class TestPost(ApiTestMixin, unittest.TestCase): - """ - Post unit test stubs - Place an order for a pet # noqa: E501 - """ - api_config = api_configuration.ApiConfiguration() - schema_config = schema_configuration.SchemaConfiguration() - used_api_client = api_client.ApiClient(configuration=api_config, schema_config=schema_config) - api = post.ApiForPost(api_client=used_api_client) # noqa: E501 - - response_status = 200 - response_body_schema = post.response_200.ResponseFor200.content["application/xml"].schema - response_body_schema = post.response_200.ResponseFor200.content["application/json"].schema - -if __name__ == '__main__': - unittest.main() diff --git a/samples/openapi3/client/petstore/python/test/test_paths/test_store_order_order_id/__init__.py b/samples/openapi3/client/petstore/python/test/test_paths/test_store_order_order_id/__init__.py index fe44b1c6a1d..e69de29bb2d 100644 --- a/samples/openapi3/client/petstore/python/test/test_paths/test_store_order_order_id/__init__.py +++ b/samples/openapi3/client/petstore/python/test/test_paths/test_store_order_order_id/__init__.py @@ -1,37 +0,0 @@ -# coding: utf-8 - -""" - - - Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator -""" - -import unittest -from unittest.mock import patch - -import urllib3 - -import petstore_api -from petstore_api.paths.store_order_order_id.get import operation as get # noqa: E501 -from petstore_api import schemas, api_client -from petstore_api.configurations import api_configuration, schema_configuration - -from .. import ApiTestMixin - - -class TestGet(ApiTestMixin, unittest.TestCase): - """ - Get unit test stubs - Find purchase order by ID # noqa: E501 - """ - api_config = api_configuration.ApiConfiguration() - schema_config = schema_configuration.SchemaConfiguration() - used_api_client = api_client.ApiClient(configuration=api_config, schema_config=schema_config) - api = get.ApiForGet(api_client=used_api_client) # noqa: E501 - - response_status = 200 - response_body_schema = get.response_200.ResponseFor200.content["application/xml"].schema - response_body_schema = get.response_200.ResponseFor200.content["application/json"].schema - -if __name__ == '__main__': - unittest.main() diff --git a/samples/openapi3/client/petstore/python/test/test_paths/test_user/__init__.py b/samples/openapi3/client/petstore/python/test/test_paths/test_user/__init__.py index ad7f2019087..e69de29bb2d 100644 --- a/samples/openapi3/client/petstore/python/test/test_paths/test_user/__init__.py +++ b/samples/openapi3/client/petstore/python/test/test_paths/test_user/__init__.py @@ -1,36 +0,0 @@ -# coding: utf-8 - -""" - - - Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator -""" - -import unittest -from unittest.mock import patch - -import urllib3 - -import petstore_api -from petstore_api.paths.user.post import operation as post # noqa: E501 -from petstore_api import schemas, api_client -from petstore_api.configurations import api_configuration, schema_configuration - -from .. import ApiTestMixin - - -class TestPost(ApiTestMixin, unittest.TestCase): - """ - Post unit test stubs - Create user # noqa: E501 - """ - api_config = api_configuration.ApiConfiguration() - schema_config = schema_configuration.SchemaConfiguration() - used_api_client = api_client.ApiClient(configuration=api_config, schema_config=schema_config) - api = post.ApiForPost(api_client=used_api_client) # noqa: E501 - - response_status = 0 - response_body = '' - -if __name__ == '__main__': - unittest.main() diff --git a/samples/openapi3/client/petstore/python/test/test_paths/test_user/test_post.py b/samples/openapi3/client/petstore/python/test/test_paths/test_user/test_post.py index ad7f2019087..05055f8e101 100644 --- a/samples/openapi3/client/petstore/python/test/test_paths/test_user/test_post.py +++ b/samples/openapi3/client/petstore/python/test/test_paths/test_user/test_post.py @@ -29,7 +29,7 @@ class TestPost(ApiTestMixin, unittest.TestCase): used_api_client = api_client.ApiClient(configuration=api_config, schema_config=schema_config) api = post.ApiForPost(api_client=used_api_client) # noqa: E501 - response_status = 0 + response_status = 200 response_body = '' if __name__ == '__main__': diff --git a/samples/openapi3/client/petstore/python/test/test_paths/test_user_create_with_array/__init__.py b/samples/openapi3/client/petstore/python/test/test_paths/test_user_create_with_array/__init__.py index 8833f20fee7..e69de29bb2d 100644 --- a/samples/openapi3/client/petstore/python/test/test_paths/test_user_create_with_array/__init__.py +++ b/samples/openapi3/client/petstore/python/test/test_paths/test_user_create_with_array/__init__.py @@ -1,36 +0,0 @@ -# coding: utf-8 - -""" - - - Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator -""" - -import unittest -from unittest.mock import patch - -import urllib3 - -import petstore_api -from petstore_api.paths.user_create_with_array.post import operation as post # noqa: E501 -from petstore_api import schemas, api_client -from petstore_api.configurations import api_configuration, schema_configuration - -from .. import ApiTestMixin - - -class TestPost(ApiTestMixin, unittest.TestCase): - """ - Post unit test stubs - Creates list of users with given input array # noqa: E501 - """ - api_config = api_configuration.ApiConfiguration() - schema_config = schema_configuration.SchemaConfiguration() - used_api_client = api_client.ApiClient(configuration=api_config, schema_config=schema_config) - api = post.ApiForPost(api_client=used_api_client) # noqa: E501 - - response_status = 0 - response_body = '' - -if __name__ == '__main__': - unittest.main() diff --git a/samples/openapi3/client/petstore/python/test/test_paths/test_user_create_with_array/test_post.py b/samples/openapi3/client/petstore/python/test/test_paths/test_user_create_with_array/test_post.py index 8833f20fee7..5149c430f59 100644 --- a/samples/openapi3/client/petstore/python/test/test_paths/test_user_create_with_array/test_post.py +++ b/samples/openapi3/client/petstore/python/test/test_paths/test_user_create_with_array/test_post.py @@ -29,7 +29,7 @@ class TestPost(ApiTestMixin, unittest.TestCase): used_api_client = api_client.ApiClient(configuration=api_config, schema_config=schema_config) api = post.ApiForPost(api_client=used_api_client) # noqa: E501 - response_status = 0 + response_status = 200 response_body = '' if __name__ == '__main__': diff --git a/samples/openapi3/client/petstore/python/test/test_paths/test_user_create_with_list/__init__.py b/samples/openapi3/client/petstore/python/test/test_paths/test_user_create_with_list/__init__.py index 1b433d59730..e69de29bb2d 100644 --- a/samples/openapi3/client/petstore/python/test/test_paths/test_user_create_with_list/__init__.py +++ b/samples/openapi3/client/petstore/python/test/test_paths/test_user_create_with_list/__init__.py @@ -1,36 +0,0 @@ -# coding: utf-8 - -""" - - - Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator -""" - -import unittest -from unittest.mock import patch - -import urllib3 - -import petstore_api -from petstore_api.paths.user_create_with_list.post import operation as post # noqa: E501 -from petstore_api import schemas, api_client -from petstore_api.configurations import api_configuration, schema_configuration - -from .. import ApiTestMixin - - -class TestPost(ApiTestMixin, unittest.TestCase): - """ - Post unit test stubs - Creates list of users with given input array # noqa: E501 - """ - api_config = api_configuration.ApiConfiguration() - schema_config = schema_configuration.SchemaConfiguration() - used_api_client = api_client.ApiClient(configuration=api_config, schema_config=schema_config) - api = post.ApiForPost(api_client=used_api_client) # noqa: E501 - - response_status = 0 - response_body = '' - -if __name__ == '__main__': - unittest.main() diff --git a/samples/openapi3/client/petstore/python/test/test_paths/test_user_create_with_list/test_post.py b/samples/openapi3/client/petstore/python/test/test_paths/test_user_create_with_list/test_post.py index 1b433d59730..8897b9787f6 100644 --- a/samples/openapi3/client/petstore/python/test/test_paths/test_user_create_with_list/test_post.py +++ b/samples/openapi3/client/petstore/python/test/test_paths/test_user_create_with_list/test_post.py @@ -29,7 +29,7 @@ class TestPost(ApiTestMixin, unittest.TestCase): used_api_client = api_client.ApiClient(configuration=api_config, schema_config=schema_config) api = post.ApiForPost(api_client=used_api_client) # noqa: E501 - response_status = 0 + response_status = 200 response_body = '' if __name__ == '__main__': diff --git a/samples/openapi3/client/petstore/python/test/test_paths/test_user_login/__init__.py b/samples/openapi3/client/petstore/python/test/test_paths/test_user_login/__init__.py index 2b18b615e41..e69de29bb2d 100644 --- a/samples/openapi3/client/petstore/python/test/test_paths/test_user_login/__init__.py +++ b/samples/openapi3/client/petstore/python/test/test_paths/test_user_login/__init__.py @@ -1,37 +0,0 @@ -# coding: utf-8 - -""" - - - Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator -""" - -import unittest -from unittest.mock import patch - -import urllib3 - -import petstore_api -from petstore_api.paths.user_login.get import operation as get # noqa: E501 -from petstore_api import schemas, api_client -from petstore_api.configurations import api_configuration, schema_configuration - -from .. import ApiTestMixin - - -class TestGet(ApiTestMixin, unittest.TestCase): - """ - Get unit test stubs - Logs user into the system # noqa: E501 - """ - api_config = api_configuration.ApiConfiguration() - schema_config = schema_configuration.SchemaConfiguration() - used_api_client = api_client.ApiClient(configuration=api_config, schema_config=schema_config) - api = get.ApiForGet(api_client=used_api_client) # noqa: E501 - - response_status = 200 - response_body_schema = get.response_200.ResponseFor200.content["application/xml"].schema - response_body_schema = get.response_200.ResponseFor200.content["application/json"].schema - -if __name__ == '__main__': - unittest.main() diff --git a/samples/openapi3/client/petstore/python/test/test_paths/test_user_logout/__init__.py b/samples/openapi3/client/petstore/python/test/test_paths/test_user_logout/__init__.py index f665aeb3689..e69de29bb2d 100644 --- a/samples/openapi3/client/petstore/python/test/test_paths/test_user_logout/__init__.py +++ b/samples/openapi3/client/petstore/python/test/test_paths/test_user_logout/__init__.py @@ -1,36 +0,0 @@ -# coding: utf-8 - -""" - - - Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator -""" - -import unittest -from unittest.mock import patch - -import urllib3 - -import petstore_api -from petstore_api.paths.user_logout.get import operation as get # noqa: E501 -from petstore_api import schemas, api_client -from petstore_api.configurations import api_configuration, schema_configuration - -from .. import ApiTestMixin - - -class TestGet(ApiTestMixin, unittest.TestCase): - """ - Get unit test stubs - Logs out current logged in user session # noqa: E501 - """ - api_config = api_configuration.ApiConfiguration() - schema_config = schema_configuration.SchemaConfiguration() - used_api_client = api_client.ApiClient(configuration=api_config, schema_config=schema_config) - api = get.ApiForGet(api_client=used_api_client) # noqa: E501 - - response_status = 0 - response_body = '' - -if __name__ == '__main__': - unittest.main() diff --git a/samples/openapi3/client/petstore/python/test/test_paths/test_user_logout/test_get.py b/samples/openapi3/client/petstore/python/test/test_paths/test_user_logout/test_get.py index f665aeb3689..69580efe302 100644 --- a/samples/openapi3/client/petstore/python/test/test_paths/test_user_logout/test_get.py +++ b/samples/openapi3/client/petstore/python/test/test_paths/test_user_logout/test_get.py @@ -29,7 +29,7 @@ class TestGet(ApiTestMixin, unittest.TestCase): used_api_client = api_client.ApiClient(configuration=api_config, schema_config=schema_config) api = get.ApiForGet(api_client=used_api_client) # noqa: E501 - response_status = 0 + response_status = 200 response_body = '' if __name__ == '__main__': diff --git a/samples/openapi3/client/petstore/python/test/test_paths/test_user_username/__init__.py b/samples/openapi3/client/petstore/python/test/test_paths/test_user_username/__init__.py index ab0df61b482..e69de29bb2d 100644 --- a/samples/openapi3/client/petstore/python/test/test_paths/test_user_username/__init__.py +++ b/samples/openapi3/client/petstore/python/test/test_paths/test_user_username/__init__.py @@ -1,36 +0,0 @@ -# coding: utf-8 - -""" - - - Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator -""" - -import unittest -from unittest.mock import patch - -import urllib3 - -import petstore_api -from petstore_api.paths.user_username.put import operation as put # noqa: E501 -from petstore_api import schemas, api_client -from petstore_api.configurations import api_configuration, schema_configuration - -from .. import ApiTestMixin - - -class TestPut(ApiTestMixin, unittest.TestCase): - """ - Put unit test stubs - Updated user # noqa: E501 - """ - api_config = api_configuration.ApiConfiguration() - schema_config = schema_configuration.SchemaConfiguration() - used_api_client = api_client.ApiClient(configuration=api_config, schema_config=schema_config) - api = put.ApiForPut(api_client=used_api_client) # noqa: E501 - - response_status = 400 - response_body = '' - -if __name__ == '__main__': - unittest.main() diff --git a/samples/openapi3/client/petstore/python/tests_manual/test_paths/test_fake_wild_card_responses/__init__.py b/samples/openapi3/client/petstore/python/tests_manual/test_paths/test_fake_wild_card_responses/__init__.py new file mode 100644 index 00000000000..e69de29bb2d diff --git a/samples/openapi3/client/petstore/python/tests_manual/test_paths/test_fake_wild_card_responses/test_get.py b/samples/openapi3/client/petstore/python/tests_manual/test_paths/test_fake_wild_card_responses/test_get.py new file mode 100644 index 00000000000..aacde704d87 --- /dev/null +++ b/samples/openapi3/client/petstore/python/tests_manual/test_paths/test_fake_wild_card_responses/test_get.py @@ -0,0 +1,81 @@ +# coding: utf-8 + +""" + + + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator +""" + +import unittest +from unittest.mock import patch + +import urllib3 + +import petstore_api +from petstore_api.paths.fake_wild_card_responses.get import operation as get # noqa: E501 +from petstore_api import schemas, api_client +from petstore_api.configurations import api_configuration, schema_configuration + +from ... import ApiTestMixin + + +class TestGet(ApiTestMixin, unittest.TestCase): + """ + Get unit test stubs + operation with wildcard responses # noqa: E501 + """ + api_config = api_configuration.ApiConfiguration() + schema_config = schema_configuration.SchemaConfiguration() + used_api_client = api_client.ApiClient(configuration=api_config, schema_config=schema_config) + api = get.ApiForGet(api_client=used_api_client) # noqa: E501 + + response_status = 200 + response_body_schema = get.response_200.ResponseFor200.content["application/json"].schema + + @patch.object(urllib3.PoolManager, 'request') + def test_non_wildcard_response(self, mock_request): + response_json = {} + body = self.json_bytes(response_json) + mock_request.return_value = self.response(body, status=200) + + api_response = self.api.get() + self.assert_pool_manager_request_called_with( + mock_request, + f'http://petstore.swagger.io:80/v2/fake/wildCardResponses', + body=None, + method='GET', + content_type=None, + accept_content_type='application/json', + ) + + assert isinstance(api_response, get.response_200.ResponseFor200.response_cls) + assert isinstance(api_response.response, urllib3.HTTPResponse) + assert isinstance(api_response.body, get.response_200.ResponseFor200.content['application/json'].schema) + assert isinstance(api_response.headers, schemas.Unset) + assert api_response.response.status == 200 + + @patch.object(urllib3.PoolManager, 'request') + def test_wildcard_response(self, mock_request): + response_json = {} + body = self.json_bytes(response_json) + mock_request.return_value = self.response(body, status=202) + + api_response = self.api.get() + self.assert_pool_manager_request_called_with( + mock_request, + f'http://petstore.swagger.io:80/v2/fake/wildCardResponses', + body=None, + method='GET', + content_type=None, + accept_content_type='application/json', + ) + + assert isinstance(api_response, get.response_2xx.ResponseFor2XX.response_cls) + assert isinstance(api_response.response, urllib3.HTTPResponse) + assert isinstance(api_response.body, get.response_2xx.ResponseFor2XX.content['application/json'].schema) + assert isinstance(api_response.headers, schemas.Unset) + assert api_response.response.status == 202 + + +if __name__ == '__main__': + unittest.main()