[python-pydantic-v1] various improvements (#16658)

* rename, add tests

* remove library support in python pydantic v1 codegen

* copy tests

* copy echo api tests

* update samples

* update doc

* add back library support
This commit is contained in:
William Cheng
2023-09-25 15:59:06 +08:00
committed by GitHub
parent 3b95f701e5
commit 077744a7af
231 changed files with 8281 additions and 2684 deletions

View File

@@ -5,7 +5,7 @@ This Python package is automatically generated by the [OpenAPI Generator](https:
- API version: 1.0.0
- Package version: 1.0.0
- Build package: org.openapitools.codegen.languages.PythonClientPydanticV1Codegen
- Build package: org.openapitools.codegen.languages.PythonPydanticV1ClientCodegen
## Requirements.

View File

@@ -0,0 +1,2 @@
tox
flake8

View File

@@ -0,0 +1,46 @@
<project>
<modelVersion>4.0.0</modelVersion>
<groupId>org.openapitools</groupId>
<artifactId>PythonPydanaticV1ioHttpPetstoreTests</artifactId>
<packaging>pom</packaging>
<version>1.0-SNAPSHOT</version>
<name>Python OpenAPI3 Petstore Client</name>
<build>
<plugins>
<plugin>
<artifactId>maven-dependency-plugin</artifactId>
<executions>
<execution>
<phase>package</phase>
<goals>
<goal>copy-dependencies</goal>
</goals>
<configuration>
<outputDirectory>${project.build.directory}</outputDirectory>
</configuration>
</execution>
</executions>
</plugin>
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>exec-maven-plugin</artifactId>
<version>1.2.1</version>
<executions>
<execution>
<id>test</id>
<phase>integration-test</phase>
<goals>
<goal>exec</goal>
</goals>
<configuration>
<executable>bash</executable>
<arguments>
<argument>test_python3.sh</argument>
</arguments>
</configuration>
</execution>
</executions>
</plugin>
</plugins>
</build>
</project>

View File

@@ -3,19 +3,21 @@
"""
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: \" \\
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 OpenAPI Generator (https://openapi-generator.tech)
Do not edit the class manually.
""" # noqa: E501
"""
import unittest
import datetime
import petstore_api
from petstore_api.models.additional_properties_any_type import AdditionalPropertiesAnyType # noqa: E501
from petstore_api.rest import ApiException
class TestAdditionalPropertiesAnyType(unittest.TestCase):
"""AdditionalPropertiesAnyType unit test stubs"""
@@ -26,19 +28,19 @@ class TestAdditionalPropertiesAnyType(unittest.TestCase):
def tearDown(self):
pass
def make_instance(self, include_optional) -> AdditionalPropertiesAnyType:
def make_instance(self, include_optional):
"""Test AdditionalPropertiesAnyType
include_option is a boolean, when False only required
params are included, when True both required and
optional params are included """
# uncomment below to create an instance of `AdditionalPropertiesAnyType`
"""
model = AdditionalPropertiesAnyType() # noqa: E501
if include_optional:
model = petstore_api.models.additional_properties_any_type.AdditionalPropertiesAnyType() # noqa: E501
if include_optional :
return AdditionalPropertiesAnyType(
name = ''
)
else:
else :
return AdditionalPropertiesAnyType(
)
"""

View File

@@ -3,19 +3,21 @@
"""
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: \" \\
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 OpenAPI Generator (https://openapi-generator.tech)
Do not edit the class manually.
""" # noqa: E501
"""
import unittest
import datetime
import petstore_api
from petstore_api.models.additional_properties_class import AdditionalPropertiesClass # noqa: E501
from petstore_api.rest import ApiException
class TestAdditionalPropertiesClass(unittest.TestCase):
"""AdditionalPropertiesClass unit test stubs"""
@@ -26,26 +28,26 @@ class TestAdditionalPropertiesClass(unittest.TestCase):
def tearDown(self):
pass
def make_instance(self, include_optional) -> AdditionalPropertiesClass:
def make_instance(self, include_optional):
"""Test AdditionalPropertiesClass
include_option is a boolean, when False only required
params are included, when True both required and
optional params are included """
# uncomment below to create an instance of `AdditionalPropertiesClass`
"""
model = AdditionalPropertiesClass() # noqa: E501
if include_optional:
model = petstore_api.models.additional_properties_class.AdditionalPropertiesClass() # noqa: E501
if include_optional :
return AdditionalPropertiesClass(
map_property = {
'key' : ''
},
},
map_of_map_property = {
'key' : {
'key' : ''
}
}
)
else:
else :
return AdditionalPropertiesClass(
)
"""

View File

@@ -3,19 +3,21 @@
"""
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: \" \\
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 OpenAPI Generator (https://openapi-generator.tech)
Do not edit the class manually.
""" # noqa: E501
"""
import unittest
import datetime
import petstore_api
from petstore_api.models.additional_properties_object import AdditionalPropertiesObject # noqa: E501
from petstore_api.rest import ApiException
class TestAdditionalPropertiesObject(unittest.TestCase):
"""AdditionalPropertiesObject unit test stubs"""
@@ -26,19 +28,19 @@ class TestAdditionalPropertiesObject(unittest.TestCase):
def tearDown(self):
pass
def make_instance(self, include_optional) -> AdditionalPropertiesObject:
def make_instance(self, include_optional):
"""Test AdditionalPropertiesObject
include_option is a boolean, when False only required
params are included, when True both required and
optional params are included """
# uncomment below to create an instance of `AdditionalPropertiesObject`
"""
model = AdditionalPropertiesObject() # noqa: E501
if include_optional:
model = petstore_api.models.additional_properties_object.AdditionalPropertiesObject() # noqa: E501
if include_optional :
return AdditionalPropertiesObject(
name = ''
)
else:
else :
return AdditionalPropertiesObject(
)
"""

View File

@@ -3,19 +3,21 @@
"""
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: \" \\
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 OpenAPI Generator (https://openapi-generator.tech)
Do not edit the class manually.
""" # noqa: E501
"""
import unittest
import datetime
import petstore_api
from petstore_api.models.additional_properties_with_description_only import AdditionalPropertiesWithDescriptionOnly # noqa: E501
from petstore_api.rest import ApiException
class TestAdditionalPropertiesWithDescriptionOnly(unittest.TestCase):
"""AdditionalPropertiesWithDescriptionOnly unit test stubs"""
@@ -26,19 +28,19 @@ class TestAdditionalPropertiesWithDescriptionOnly(unittest.TestCase):
def tearDown(self):
pass
def make_instance(self, include_optional) -> AdditionalPropertiesWithDescriptionOnly:
def make_instance(self, include_optional):
"""Test AdditionalPropertiesWithDescriptionOnly
include_option is a boolean, when False only required
params are included, when True both required and
optional params are included """
# uncomment below to create an instance of `AdditionalPropertiesWithDescriptionOnly`
"""
model = AdditionalPropertiesWithDescriptionOnly() # noqa: E501
if include_optional:
model = petstore_api.models.additional_properties_with_description_only.AdditionalPropertiesWithDescriptionOnly() # noqa: E501
if include_optional :
return AdditionalPropertiesWithDescriptionOnly(
name = ''
)
else:
else :
return AdditionalPropertiesWithDescriptionOnly(
)
"""

View File

@@ -3,19 +3,21 @@
"""
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: \" \\
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 OpenAPI Generator (https://openapi-generator.tech)
Generated by: https://openapi-generator.tech
"""
Do not edit the class manually.
""" # noqa: E501
from __future__ import absolute_import
import unittest
import datetime
import petstore_api
from petstore_api.models.all_of_with_single_ref import AllOfWithSingleRef # noqa: E501
from petstore_api.rest import ApiException
class TestAllOfWithSingleRef(unittest.TestCase):
"""AllOfWithSingleRef unit test stubs"""
@@ -26,23 +28,20 @@ class TestAllOfWithSingleRef(unittest.TestCase):
def tearDown(self):
pass
def make_instance(self, include_optional) -> AllOfWithSingleRef:
def make_instance(self, include_optional):
"""Test AllOfWithSingleRef
include_option is a boolean, when False only required
params are included, when True both required and
optional params are included """
# uncomment below to create an instance of `AllOfWithSingleRef`
"""
model = AllOfWithSingleRef() # noqa: E501
if include_optional:
# model = petstore_api.models.all_of_with_single_ref.AllOfWithSingleRef() # noqa: E501
if include_optional :
return AllOfWithSingleRef(
username = '',
single_ref_type = 'admin'
username = '',
single_ref_type = None
)
else:
else :
return AllOfWithSingleRef(
)
"""
def testAllOfWithSingleRef(self):
"""Test AllOfWithSingleRef"""

View File

@@ -3,19 +3,21 @@
"""
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: \" \\
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 OpenAPI Generator (https://openapi-generator.tech)
Generated by: https://openapi-generator.tech
"""
Do not edit the class manually.
""" # noqa: E501
from __future__ import absolute_import
import unittest
import datetime
import petstore_api
from petstore_api.models.animal import Animal # noqa: E501
from petstore_api.rest import ApiException
class TestAnimal(unittest.TestCase):
"""Animal unit test stubs"""
@@ -26,24 +28,21 @@ class TestAnimal(unittest.TestCase):
def tearDown(self):
pass
def make_instance(self, include_optional) -> Animal:
def make_instance(self, include_optional):
"""Test Animal
include_option is a boolean, when False only required
params are included, when True both required and
optional params are included """
# uncomment below to create an instance of `Animal`
"""
model = Animal() # noqa: E501
if include_optional:
# model = petstore_api.models.animal.Animal() # noqa: E501
if include_optional :
return Animal(
class_name = '',
class_name = '',
color = 'red'
)
else:
else :
return Animal(
class_name = '',
)
"""
def testAnimal(self):
"""Test Animal"""

View File

@@ -3,30 +3,32 @@
"""
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: \" \\
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 OpenAPI Generator (https://openapi-generator.tech)
Generated by: https://openapi-generator.tech
"""
Do not edit the class manually.
""" # noqa: E501
from __future__ import absolute_import
import unittest
import petstore_api
from petstore_api.api.another_fake_api import AnotherFakeApi # noqa: E501
from petstore_api.rest import ApiException
class TestAnotherFakeApi(unittest.TestCase):
"""AnotherFakeApi unit test stubs"""
def setUp(self) -> None:
self.api = AnotherFakeApi() # noqa: E501
def setUp(self):
self.api = petstore_api.api.another_fake_api.AnotherFakeApi() # noqa: E501
def tearDown(self) -> None:
def tearDown(self):
pass
def test_call_123_test_special_tags(self) -> None:
def test_call_123_test_special_tags(self):
"""Test case for call_123_test_special_tags
To test special tags # noqa: E501

View File

@@ -3,19 +3,21 @@
"""
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: \" \\
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 OpenAPI Generator (https://openapi-generator.tech)
Generated by: https://openapi-generator.tech
"""
Do not edit the class manually.
""" # noqa: E501
from __future__ import absolute_import
import unittest
import datetime
import petstore_api
from petstore_api.models.any_of_color import AnyOfColor # noqa: E501
from petstore_api.rest import ApiException
class TestAnyOfColor(unittest.TestCase):
"""AnyOfColor unit test stubs"""
@@ -26,18 +28,18 @@ class TestAnyOfColor(unittest.TestCase):
def tearDown(self):
pass
def make_instance(self, include_optional) -> AnyOfColor:
def make_instance(self, include_optional):
"""Test AnyOfColor
include_option is a boolean, when False only required
params are included, when True both required and
optional params are included """
# uncomment below to create an instance of `AnyOfColor`
"""
model = AnyOfColor() # noqa: E501
if include_optional:
model = petstore_api.models.any_of_color.AnyOfColor() # noqa: E501
if include_optional :
return AnyOfColor(
)
else:
else :
return AnyOfColor(
)
"""

View File

@@ -3,19 +3,21 @@
"""
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: \" \\
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 OpenAPI Generator (https://openapi-generator.tech)
Generated by: https://openapi-generator.tech
"""
Do not edit the class manually.
""" # noqa: E501
from __future__ import absolute_import
import unittest
import datetime
import petstore_api
from petstore_api.models.any_of_pig import AnyOfPig # noqa: E501
from petstore_api.rest import ApiException
class TestAnyOfPig(unittest.TestCase):
"""AnyOfPig unit test stubs"""
@@ -26,27 +28,24 @@ class TestAnyOfPig(unittest.TestCase):
def tearDown(self):
pass
def make_instance(self, include_optional) -> AnyOfPig:
def make_instance(self, include_optional):
"""Test AnyOfPig
include_option is a boolean, when False only required
params are included, when True both required and
optional params are included """
# uncomment below to create an instance of `AnyOfPig`
"""
model = AnyOfPig() # noqa: E501
if include_optional:
# model = petstore_api.models.any_of_pig.AnyOfPig() # noqa: E501
if include_optional :
return AnyOfPig(
class_name = '',
color = '',
class_name = '',
color = '',
size = 56
)
else:
else :
return AnyOfPig(
class_name = '',
color = '',
size = 56,
)
"""
def testAnyOfPig(self):
"""Test AnyOfPig"""

View File

@@ -3,19 +3,21 @@
"""
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: \" \\
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 OpenAPI Generator (https://openapi-generator.tech)
Generated by: https://openapi-generator.tech
"""
Do not edit the class manually.
""" # noqa: E501
from __future__ import absolute_import
import unittest
import datetime
import petstore_api
from petstore_api.models.api_response import ApiResponse # noqa: E501
from petstore_api.rest import ApiException
class TestApiResponse(unittest.TestCase):
"""ApiResponse unit test stubs"""
@@ -26,24 +28,21 @@ class TestApiResponse(unittest.TestCase):
def tearDown(self):
pass
def make_instance(self, include_optional) -> ApiResponse:
def make_instance(self, include_optional):
"""Test ApiResponse
include_option is a boolean, when False only required
params are included, when True both required and
optional params are included """
# uncomment below to create an instance of `ApiResponse`
"""
model = ApiResponse() # noqa: E501
if include_optional:
# model = petstore_api.models.api_response.ApiResponse() # noqa: E501
if include_optional :
return ApiResponse(
code = 56,
type = '',
code = 56,
type = '',
message = ''
)
else:
else :
return ApiResponse(
)
"""
def testApiResponse(self):
"""Test ApiResponse"""

View File

@@ -3,19 +3,21 @@
"""
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: \" \\
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 OpenAPI Generator (https://openapi-generator.tech)
Do not edit the class manually.
""" # noqa: E501
"""
import unittest
import datetime
import petstore_api
from petstore_api.models.array_of_array_of_model import ArrayOfArrayOfModel # noqa: E501
from petstore_api.rest import ApiException
class TestArrayOfArrayOfModel(unittest.TestCase):
"""ArrayOfArrayOfModel unit test stubs"""
@@ -26,15 +28,15 @@ class TestArrayOfArrayOfModel(unittest.TestCase):
def tearDown(self):
pass
def make_instance(self, include_optional) -> ArrayOfArrayOfModel:
def make_instance(self, include_optional):
"""Test ArrayOfArrayOfModel
include_option is a boolean, when False only required
params are included, when True both required and
optional params are included """
# uncomment below to create an instance of `ArrayOfArrayOfModel`
"""
model = ArrayOfArrayOfModel() # noqa: E501
if include_optional:
model = petstore_api.models.array_of_array_of_model.ArrayOfArrayOfModel() # noqa: E501
if include_optional :
return ArrayOfArrayOfModel(
another_property = [
[
@@ -44,7 +46,7 @@ class TestArrayOfArrayOfModel(unittest.TestCase):
]
]
)
else:
else :
return ArrayOfArrayOfModel(
)
"""

View File

@@ -3,19 +3,21 @@
"""
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: \" \\
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 OpenAPI Generator (https://openapi-generator.tech)
Generated by: https://openapi-generator.tech
"""
Do not edit the class manually.
""" # noqa: E501
from __future__ import absolute_import
import unittest
import datetime
import petstore_api
from petstore_api.models.array_of_array_of_number_only import ArrayOfArrayOfNumberOnly # noqa: E501
from petstore_api.rest import ApiException
class TestArrayOfArrayOfNumberOnly(unittest.TestCase):
"""ArrayOfArrayOfNumberOnly unit test stubs"""
@@ -26,15 +28,13 @@ class TestArrayOfArrayOfNumberOnly(unittest.TestCase):
def tearDown(self):
pass
def make_instance(self, include_optional) -> ArrayOfArrayOfNumberOnly:
def make_instance(self, include_optional):
"""Test ArrayOfArrayOfNumberOnly
include_option is a boolean, when False only required
params are included, when True both required and
optional params are included """
# uncomment below to create an instance of `ArrayOfArrayOfNumberOnly`
"""
model = ArrayOfArrayOfNumberOnly() # noqa: E501
if include_optional:
# model = petstore_api.models.array_of_array_of_number_only.ArrayOfArrayOfNumberOnly() # noqa: E501
if include_optional :
return ArrayOfArrayOfNumberOnly(
array_array_number = [
[
@@ -42,10 +42,9 @@ class TestArrayOfArrayOfNumberOnly(unittest.TestCase):
]
]
)
else:
else :
return ArrayOfArrayOfNumberOnly(
)
"""
def testArrayOfArrayOfNumberOnly(self):
"""Test ArrayOfArrayOfNumberOnly"""

View File

@@ -3,19 +3,21 @@
"""
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: \" \\
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 OpenAPI Generator (https://openapi-generator.tech)
Generated by: https://openapi-generator.tech
"""
Do not edit the class manually.
""" # noqa: E501
from __future__ import absolute_import
import unittest
import datetime
import petstore_api
from petstore_api.models.array_of_number_only import ArrayOfNumberOnly # noqa: E501
from petstore_api.rest import ApiException
class TestArrayOfNumberOnly(unittest.TestCase):
"""ArrayOfNumberOnly unit test stubs"""
@@ -26,24 +28,21 @@ class TestArrayOfNumberOnly(unittest.TestCase):
def tearDown(self):
pass
def make_instance(self, include_optional) -> ArrayOfNumberOnly:
def make_instance(self, include_optional):
"""Test ArrayOfNumberOnly
include_option is a boolean, when False only required
params are included, when True both required and
optional params are included """
# uncomment below to create an instance of `ArrayOfNumberOnly`
"""
model = ArrayOfNumberOnly() # noqa: E501
if include_optional:
# model = petstore_api.models.array_of_number_only.ArrayOfNumberOnly() # noqa: E501
if include_optional :
return ArrayOfNumberOnly(
array_number = [
1.337
]
)
else:
else :
return ArrayOfNumberOnly(
)
"""
def testArrayOfNumberOnly(self):
"""Test ArrayOfNumberOnly"""

View File

@@ -3,19 +3,21 @@
"""
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: \" \\
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 OpenAPI Generator (https://openapi-generator.tech)
Generated by: https://openapi-generator.tech
"""
Do not edit the class manually.
""" # noqa: E501
from __future__ import absolute_import
import unittest
import datetime
import petstore_api
from petstore_api.models.array_test import ArrayTest # noqa: E501
from petstore_api.rest import ApiException
class TestArrayTest(unittest.TestCase):
"""ArrayTest unit test stubs"""
@@ -26,24 +28,22 @@ class TestArrayTest(unittest.TestCase):
def tearDown(self):
pass
def make_instance(self, include_optional) -> ArrayTest:
def make_instance(self, include_optional):
"""Test ArrayTest
include_option is a boolean, when False only required
params are included, when True both required and
optional params are included """
# uncomment below to create an instance of `ArrayTest`
"""
model = ArrayTest() # noqa: E501
if include_optional:
# model = petstore_api.models.array_test.ArrayTest() # noqa: E501
if include_optional :
return ArrayTest(
array_of_string = [
''
],
],
array_array_of_integer = [
[
56
]
],
],
array_array_of_model = [
[
petstore_api.models.read_only_first.ReadOnlyFirst(
@@ -52,10 +52,9 @@ class TestArrayTest(unittest.TestCase):
]
]
)
else:
else :
return ArrayTest(
)
"""
def testArrayTest(self):
"""Test ArrayTest"""

View File

@@ -3,19 +3,21 @@
"""
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: \" \\
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 OpenAPI Generator (https://openapi-generator.tech)
Generated by: https://openapi-generator.tech
"""
Do not edit the class manually.
""" # noqa: E501
from __future__ import absolute_import
import unittest
import datetime
import petstore_api
from petstore_api.models.basque_pig import BasquePig # noqa: E501
from petstore_api.rest import ApiException
class TestBasquePig(unittest.TestCase):
"""BasquePig unit test stubs"""
@@ -26,25 +28,22 @@ class TestBasquePig(unittest.TestCase):
def tearDown(self):
pass
def make_instance(self, include_optional) -> BasquePig:
def make_instance(self, include_optional):
"""Test BasquePig
include_option is a boolean, when False only required
params are included, when True both required and
optional params are included """
# uncomment below to create an instance of `BasquePig`
"""
model = BasquePig() # noqa: E501
if include_optional:
# model = petstore_api.models.basque_pig.BasquePig() # noqa: E501
if include_optional :
return BasquePig(
class_name = '',
class_name = '',
color = ''
)
else:
else :
return BasquePig(
class_name = '',
color = '',
)
"""
def testBasquePig(self):
"""Test BasquePig"""

View File

@@ -3,19 +3,21 @@
"""
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: \" \\
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 OpenAPI Generator (https://openapi-generator.tech)
Generated by: https://openapi-generator.tech
"""
Do not edit the class manually.
""" # noqa: E501
from __future__ import absolute_import
import unittest
import datetime
import petstore_api
from petstore_api.models.capitalization import Capitalization # noqa: E501
from petstore_api.rest import ApiException
class TestCapitalization(unittest.TestCase):
"""Capitalization unit test stubs"""
@@ -26,27 +28,24 @@ class TestCapitalization(unittest.TestCase):
def tearDown(self):
pass
def make_instance(self, include_optional) -> Capitalization:
def make_instance(self, include_optional):
"""Test Capitalization
include_option is a boolean, when False only required
params are included, when True both required and
optional params are included """
# uncomment below to create an instance of `Capitalization`
"""
model = Capitalization() # noqa: E501
if include_optional:
# model = petstore_api.models.capitalization.Capitalization() # noqa: E501
if include_optional :
return Capitalization(
small_camel = '',
capital_camel = '',
small_snake = '',
capital_snake = '',
sca_eth_flow_points = '',
small_camel = '',
capital_camel = '',
small_snake = '',
capital_snake = '',
sca_eth_flow_points = '',
att_name = ''
)
else:
else :
return Capitalization(
)
"""
def testCapitalization(self):
"""Test Capitalization"""

View File

@@ -3,19 +3,21 @@
"""
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: \" \\
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 OpenAPI Generator (https://openapi-generator.tech)
Generated by: https://openapi-generator.tech
"""
Do not edit the class manually.
""" # noqa: E501
from __future__ import absolute_import
import unittest
import datetime
import petstore_api
from petstore_api.models.cat import Cat # noqa: E501
from petstore_api.rest import ApiException
class TestCat(unittest.TestCase):
"""Cat unit test stubs"""
@@ -26,22 +28,19 @@ class TestCat(unittest.TestCase):
def tearDown(self):
pass
def make_instance(self, include_optional) -> Cat:
def make_instance(self, include_optional):
"""Test Cat
include_option is a boolean, when False only required
params are included, when True both required and
optional params are included """
# uncomment below to create an instance of `Cat`
"""
model = Cat() # noqa: E501
if include_optional:
# model = petstore_api.models.cat.Cat() # noqa: E501
if include_optional :
return Cat(
declawed = True
)
else:
else :
return Cat(
)
"""
def testCat(self):
"""Test Cat"""

View File

@@ -3,19 +3,21 @@
"""
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: \" \\
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 OpenAPI Generator (https://openapi-generator.tech)
Generated by: https://openapi-generator.tech
"""
Do not edit the class manually.
""" # noqa: E501
from __future__ import absolute_import
import unittest
import datetime
import petstore_api
from petstore_api.models.category import Category # noqa: E501
from petstore_api.rest import ApiException
class TestCategory(unittest.TestCase):
"""Category unit test stubs"""
@@ -26,24 +28,21 @@ class TestCategory(unittest.TestCase):
def tearDown(self):
pass
def make_instance(self, include_optional) -> Category:
def make_instance(self, include_optional):
"""Test Category
include_option is a boolean, when False only required
params are included, when True both required and
optional params are included """
# uncomment below to create an instance of `Category`
"""
model = Category() # noqa: E501
if include_optional:
# model = petstore_api.models.category.Category() # noqa: E501
if include_optional :
return Category(
id = 56,
id = 56,
name = 'default-name'
)
else:
else :
return Category(
name = 'default-name',
)
"""
def testCategory(self):
"""Test Category"""

View File

@@ -3,19 +3,23 @@
"""
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: \" \\
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 OpenAPI Generator (https://openapi-generator.tech)
Do not edit the class manually.
""" # noqa: E501
"""
from __future__ import absolute_import
import unittest
import datetime
import petstore_api
from petstore_api.models.circular_reference_model import CircularReferenceModel # noqa: E501
from petstore_api.rest import ApiException
class TestCircularReferenceModel(unittest.TestCase):
"""CircularReferenceModel unit test stubs"""
@@ -26,17 +30,17 @@ class TestCircularReferenceModel(unittest.TestCase):
def tearDown(self):
pass
def make_instance(self, include_optional) -> CircularReferenceModel:
def make_instance(self, include_optional):
"""Test CircularReferenceModel
include_option is a boolean, when False only required
params are included, when True both required and
optional params are included """
# uncomment below to create an instance of `CircularReferenceModel`
"""
model = CircularReferenceModel() # noqa: E501
if include_optional:
model = petstore_api.models.circular_reference_model.CircularReferenceModel() # noqa: E501
if include_optional :
return CircularReferenceModel(
size = 56,
size = 56,
nested = petstore_api.models.first_ref.FirstRef(
category = '',
self_ref = petstore_api.models.second_ref.SecondRef(
@@ -46,7 +50,7 @@ class TestCircularReferenceModel(unittest.TestCase):
nested = petstore_api.models.first_ref.FirstRef(
category = '', ), ), ), )
)
else:
else :
return CircularReferenceModel(
)
"""

View File

@@ -3,19 +3,21 @@
"""
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: \" \\
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 OpenAPI Generator (https://openapi-generator.tech)
Generated by: https://openapi-generator.tech
"""
Do not edit the class manually.
""" # noqa: E501
from __future__ import absolute_import
import unittest
import datetime
import petstore_api
from petstore_api.models.class_model import ClassModel # noqa: E501
from petstore_api.rest import ApiException
class TestClassModel(unittest.TestCase):
"""ClassModel unit test stubs"""
@@ -26,22 +28,19 @@ class TestClassModel(unittest.TestCase):
def tearDown(self):
pass
def make_instance(self, include_optional) -> ClassModel:
def make_instance(self, include_optional):
"""Test ClassModel
include_option is a boolean, when False only required
params are included, when True both required and
optional params are included """
# uncomment below to create an instance of `ClassModel`
"""
model = ClassModel() # noqa: E501
if include_optional:
# model = petstore_api.models.class_model.ClassModel() # noqa: E501
if include_optional :
return ClassModel(
var_class = ''
_class = ''
)
else:
else :
return ClassModel(
)
"""
def testClassModel(self):
"""Test ClassModel"""

View File

@@ -3,19 +3,21 @@
"""
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: \" \\
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 OpenAPI Generator (https://openapi-generator.tech)
Generated by: https://openapi-generator.tech
"""
Do not edit the class manually.
""" # noqa: E501
from __future__ import absolute_import
import unittest
import datetime
import petstore_api
from petstore_api.models.client import Client # noqa: E501
from petstore_api.rest import ApiException
class TestClient(unittest.TestCase):
"""Client unit test stubs"""
@@ -26,22 +28,19 @@ class TestClient(unittest.TestCase):
def tearDown(self):
pass
def make_instance(self, include_optional) -> Client:
def make_instance(self, include_optional):
"""Test Client
include_option is a boolean, when False only required
params are included, when True both required and
optional params are included """
# uncomment below to create an instance of `Client`
"""
model = Client() # noqa: E501
if include_optional:
# model = petstore_api.models.client.Client() # noqa: E501
if include_optional :
return Client(
client = ''
)
else:
else :
return Client(
)
"""
def testClient(self):
"""Test Client"""

View File

@@ -3,19 +3,21 @@
"""
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: \" \\
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 OpenAPI Generator (https://openapi-generator.tech)
Generated by: https://openapi-generator.tech
"""
Do not edit the class manually.
""" # noqa: E501
from __future__ import absolute_import
import unittest
import datetime
import petstore_api
from petstore_api.models.color import Color # noqa: E501
from petstore_api.rest import ApiException
class TestColor(unittest.TestCase):
"""Color unit test stubs"""
@@ -26,18 +28,18 @@ class TestColor(unittest.TestCase):
def tearDown(self):
pass
def make_instance(self, include_optional) -> Color:
def make_instance(self, include_optional):
"""Test Color
include_option is a boolean, when False only required
params are included, when True both required and
optional params are included """
# uncomment below to create an instance of `Color`
"""
model = Color() # noqa: E501
if include_optional:
model = petstore_api.models.color.Color() # noqa: E501
if include_optional :
return Color(
)
else:
else :
return Color(
)
"""

View File

@@ -3,19 +3,21 @@
"""
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: \" \\
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 OpenAPI Generator (https://openapi-generator.tech)
Do not edit the class manually.
""" # noqa: E501
"""
import unittest
import datetime
import petstore_api
from petstore_api.models.creature import Creature # noqa: E501
from petstore_api.rest import ApiException
class TestCreature(unittest.TestCase):
"""Creature unit test stubs"""
@@ -26,21 +28,21 @@ class TestCreature(unittest.TestCase):
def tearDown(self):
pass
def make_instance(self, include_optional) -> Creature:
def make_instance(self, include_optional):
"""Test Creature
include_option is a boolean, when False only required
params are included, when True both required and
optional params are included """
# uncomment below to create an instance of `Creature`
"""
model = Creature() # noqa: E501
if include_optional:
model = petstore_api.models.creature.Creature() # noqa: E501
if include_optional :
return Creature(
info = petstore_api.models.creature_info.CreatureInfo(
name = '', ),
name = '', ),
type = ''
)
else:
else :
return Creature(
info = petstore_api.models.creature_info.CreatureInfo(
name = '', ),

View File

@@ -3,19 +3,21 @@
"""
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: \" \\
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 OpenAPI Generator (https://openapi-generator.tech)
Do not edit the class manually.
""" # noqa: E501
"""
import unittest
import datetime
import petstore_api
from petstore_api.models.creature_info import CreatureInfo # noqa: E501
from petstore_api.rest import ApiException
class TestCreatureInfo(unittest.TestCase):
"""CreatureInfo unit test stubs"""
@@ -26,19 +28,19 @@ class TestCreatureInfo(unittest.TestCase):
def tearDown(self):
pass
def make_instance(self, include_optional) -> CreatureInfo:
def make_instance(self, include_optional):
"""Test CreatureInfo
include_option is a boolean, when False only required
params are included, when True both required and
optional params are included """
# uncomment below to create an instance of `CreatureInfo`
"""
model = CreatureInfo() # noqa: E501
if include_optional:
model = petstore_api.models.creature_info.CreatureInfo() # noqa: E501
if include_optional :
return CreatureInfo(
name = ''
)
else:
else :
return CreatureInfo(
name = '',
)

View File

@@ -3,19 +3,21 @@
"""
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: \" \\
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 OpenAPI Generator (https://openapi-generator.tech)
Generated by: https://openapi-generator.tech
"""
Do not edit the class manually.
""" # noqa: E501
from __future__ import absolute_import
import unittest
import datetime
import petstore_api
from petstore_api.models.danish_pig import DanishPig # noqa: E501
from petstore_api.rest import ApiException
class TestDanishPig(unittest.TestCase):
"""DanishPig unit test stubs"""
@@ -26,25 +28,22 @@ class TestDanishPig(unittest.TestCase):
def tearDown(self):
pass
def make_instance(self, include_optional) -> DanishPig:
def make_instance(self, include_optional):
"""Test DanishPig
include_option is a boolean, when False only required
params are included, when True both required and
optional params are included """
# uncomment below to create an instance of `DanishPig`
"""
model = DanishPig() # noqa: E501
if include_optional:
# model = petstore_api.models.danish_pig.DanishPig() # noqa: E501
if include_optional :
return DanishPig(
class_name = '',
class_name = '',
size = 56
)
else:
else :
return DanishPig(
class_name = '',
size = 56,
)
"""
def testDanishPig(self):
"""Test DanishPig"""

View File

@@ -3,30 +3,32 @@
"""
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: \" \\
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 OpenAPI Generator (https://openapi-generator.tech)
Generated by: https://openapi-generator.tech
"""
Do not edit the class manually.
""" # noqa: E501
from __future__ import absolute_import
import unittest
import petstore_api
from petstore_api.api.default_api import DefaultApi # noqa: E501
from petstore_api.rest import ApiException
class TestDefaultApi(unittest.TestCase):
"""DefaultApi unit test stubs"""
def setUp(self) -> None:
self.api = DefaultApi() # noqa: E501
def setUp(self):
self.api = petstore_api.api.default_api.DefaultApi() # noqa: E501
def tearDown(self) -> None:
def tearDown(self):
pass
def test_foo_get(self) -> None:
def test_foo_get(self):
"""Test case for foo_get
"""

View File

@@ -3,19 +3,21 @@
"""
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: \" \\
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 OpenAPI Generator (https://openapi-generator.tech)
Generated by: https://openapi-generator.tech
"""
Do not edit the class manually.
""" # noqa: E501
from __future__ import absolute_import
import unittest
import datetime
import petstore_api
from petstore_api.models.deprecated_object import DeprecatedObject # noqa: E501
from petstore_api.rest import ApiException
class TestDeprecatedObject(unittest.TestCase):
"""DeprecatedObject unit test stubs"""
@@ -26,22 +28,19 @@ class TestDeprecatedObject(unittest.TestCase):
def tearDown(self):
pass
def make_instance(self, include_optional) -> DeprecatedObject:
def make_instance(self, include_optional):
"""Test DeprecatedObject
include_option is a boolean, when False only required
params are included, when True both required and
optional params are included """
# uncomment below to create an instance of `DeprecatedObject`
"""
model = DeprecatedObject() # noqa: E501
if include_optional:
# model = petstore_api.models.deprecated_object.DeprecatedObject() # noqa: E501
if include_optional :
return DeprecatedObject(
name = ''
)
else:
else :
return DeprecatedObject(
)
"""
def testDeprecatedObject(self):
"""Test DeprecatedObject"""

View File

@@ -3,19 +3,21 @@
"""
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: \" \\
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 OpenAPI Generator (https://openapi-generator.tech)
Generated by: https://openapi-generator.tech
"""
Do not edit the class manually.
""" # noqa: E501
from __future__ import absolute_import
import unittest
import datetime
import petstore_api
from petstore_api.models.dog import Dog # noqa: E501
from petstore_api.rest import ApiException
class TestDog(unittest.TestCase):
"""Dog unit test stubs"""
@@ -26,22 +28,19 @@ class TestDog(unittest.TestCase):
def tearDown(self):
pass
def make_instance(self, include_optional) -> Dog:
def make_instance(self, include_optional):
"""Test Dog
include_option is a boolean, when False only required
params are included, when True both required and
optional params are included """
# uncomment below to create an instance of `Dog`
"""
model = Dog() # noqa: E501
if include_optional:
# model = petstore_api.models.dog.Dog() # noqa: E501
if include_optional :
return Dog(
breed = ''
)
else:
else :
return Dog(
)
"""
def testDog(self):
"""Test Dog"""

View File

@@ -3,19 +3,21 @@
"""
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: \" \\
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 OpenAPI Generator (https://openapi-generator.tech)
Generated by: https://openapi-generator.tech
"""
Do not edit the class manually.
""" # noqa: E501
from __future__ import absolute_import
import unittest
import datetime
import petstore_api
from petstore_api.models.dummy_model import DummyModel # noqa: E501
from petstore_api.rest import ApiException
class TestDummyModel(unittest.TestCase):
"""DummyModel unit test stubs"""
@@ -26,23 +28,23 @@ class TestDummyModel(unittest.TestCase):
def tearDown(self):
pass
def make_instance(self, include_optional) -> DummyModel:
def make_instance(self, include_optional):
"""Test DummyModel
include_option is a boolean, when False only required
params are included, when True both required and
optional params are included """
# uncomment below to create an instance of `DummyModel`
"""
model = DummyModel() # noqa: E501
if include_optional:
model = petstore_api.models.dummy_model.DummyModel() # noqa: E501
if include_optional :
return DummyModel(
category = '',
category = '',
self_ref = petstore_api.models.self_reference_model.Self-Reference-Model(
size = 56,
nested = petstore_api.models.dummy_model.Dummy-Model(
category = '', ), )
)
else:
else :
return DummyModel(
)
"""

View File

@@ -3,19 +3,21 @@
"""
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: \" \\
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 OpenAPI Generator (https://openapi-generator.tech)
Generated by: https://openapi-generator.tech
"""
Do not edit the class manually.
""" # noqa: E501
from __future__ import absolute_import
import unittest
import datetime
import petstore_api
from petstore_api.models.enum_arrays import EnumArrays # noqa: E501
from petstore_api.rest import ApiException
class TestEnumArrays(unittest.TestCase):
"""EnumArrays unit test stubs"""
@@ -26,25 +28,22 @@ class TestEnumArrays(unittest.TestCase):
def tearDown(self):
pass
def make_instance(self, include_optional) -> EnumArrays:
def make_instance(self, include_optional):
"""Test EnumArrays
include_option is a boolean, when False only required
params are included, when True both required and
optional params are included """
# uncomment below to create an instance of `EnumArrays`
"""
model = EnumArrays() # noqa: E501
if include_optional:
# model = petstore_api.models.enum_arrays.EnumArrays() # noqa: E501
if include_optional :
return EnumArrays(
just_symbol = '>=',
just_symbol = '>=',
array_enum = [
'fish'
]
)
else:
else :
return EnumArrays(
)
"""
def testEnumArrays(self):
"""Test EnumArrays"""

View File

@@ -3,19 +3,21 @@
"""
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: \" \\
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 OpenAPI Generator (https://openapi-generator.tech)
Generated by: https://openapi-generator.tech
"""
Do not edit the class manually.
""" # noqa: E501
from __future__ import absolute_import
import unittest
import datetime
import petstore_api
from petstore_api.models.enum_class import EnumClass # noqa: E501
from petstore_api.rest import ApiException
class TestEnumClass(unittest.TestCase):
"""EnumClass unit test stubs"""

View File

@@ -3,19 +3,21 @@
"""
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: \" \\
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 OpenAPI Generator (https://openapi-generator.tech)
Do not edit the class manually.
""" # noqa: E501
"""
import unittest
import datetime
import petstore_api
from petstore_api.models.enum_string1 import EnumString1 # noqa: E501
from petstore_api.rest import ApiException
class TestEnumString1(unittest.TestCase):
"""EnumString1 unit test stubs"""

View File

@@ -3,19 +3,21 @@
"""
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: \" \\
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 OpenAPI Generator (https://openapi-generator.tech)
Do not edit the class manually.
""" # noqa: E501
"""
import unittest
import datetime
import petstore_api
from petstore_api.models.enum_string2 import EnumString2 # noqa: E501
from petstore_api.rest import ApiException
class TestEnumString2(unittest.TestCase):
"""EnumString2 unit test stubs"""

View File

@@ -3,19 +3,21 @@
"""
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: \" \\
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 OpenAPI Generator (https://openapi-generator.tech)
Generated by: https://openapi-generator.tech
"""
Do not edit the class manually.
""" # noqa: E501
from __future__ import absolute_import
import unittest
import datetime
import petstore_api
from petstore_api.models.enum_test import EnumTest # noqa: E501
from petstore_api.rest import ApiException
class TestEnumTest(unittest.TestCase):
"""EnumTest unit test stubs"""
@@ -26,31 +28,23 @@ class TestEnumTest(unittest.TestCase):
def tearDown(self):
pass
def make_instance(self, include_optional) -> EnumTest:
def make_instance(self, include_optional):
"""Test EnumTest
include_option is a boolean, when False only required
params are included, when True both required and
optional params are included """
# uncomment below to create an instance of `EnumTest`
"""
model = EnumTest() # noqa: E501
if include_optional:
# model = petstore_api.models.enum_test.EnumTest() # noqa: E501
if include_optional :
return EnumTest(
enum_string = 'UPPER',
enum_string_required = 'UPPER',
enum_integer_default = 1,
enum_integer = 1,
enum_number = 1.1,
outer_enum = 'placed',
outer_enum_integer = 2,
outer_enum_default_value = 'placed',
outer_enum_integer_default_value = -1
enum_string = 'UPPER',
enum_string_required = 'UPPER',
enum_integer = 1,
enum_number = 1.1
)
else:
else :
return EnumTest(
enum_string_required = 'UPPER',
)
"""
def testEnumTest(self):
"""Test EnumTest"""

View File

@@ -3,168 +3,129 @@
"""
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: \" \\
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 OpenAPI Generator (https://openapi-generator.tech)
Generated by: https://openapi-generator.tech
"""
Do not edit the class manually.
""" # noqa: E501
from __future__ import absolute_import
import unittest
import petstore_api
from petstore_api.api.fake_api import FakeApi # noqa: E501
from petstore_api.rest import ApiException
class TestFakeApi(unittest.TestCase):
"""FakeApi unit test stubs"""
def setUp(self) -> None:
self.api = FakeApi() # noqa: E501
def setUp(self):
self.api = petstore_api.api.fake_api.FakeApi() # noqa: E501
def tearDown(self) -> None:
def tearDown(self):
pass
def test_fake_any_type_request_body(self) -> None:
"""Test case for fake_any_type_request_body
test any type request body # noqa: E501
"""
pass
def test_fake_enum_ref_query_parameter(self) -> None:
"""Test case for fake_enum_ref_query_parameter
test enum reference query parameter # noqa: E501
"""
pass
def test_fake_health_get(self) -> None:
def test_fake_health_get(self):
"""Test case for fake_health_get
Health check endpoint # noqa: E501
"""
pass
def test_fake_http_signature_test(self) -> None:
def test_fake_http_signature_test(self):
"""Test case for fake_http_signature_test
test http signature authentication # noqa: E501
"""
pass
def test_fake_outer_boolean_serialize(self) -> None:
def test_fake_outer_boolean_serialize(self):
"""Test case for fake_outer_boolean_serialize
"""
pass
def test_fake_outer_composite_serialize(self) -> None:
def test_fake_outer_composite_serialize(self):
"""Test case for fake_outer_composite_serialize
"""
pass
def test_fake_outer_number_serialize(self) -> None:
def test_fake_outer_number_serialize(self):
"""Test case for fake_outer_number_serialize
"""
pass
def test_fake_outer_string_serialize(self) -> None:
def test_fake_outer_string_serialize(self):
"""Test case for fake_outer_string_serialize
"""
pass
def test_fake_property_enum_integer_serialize(self) -> None:
def test_fake_property_enum_integer_serialize(self):
"""Test case for fake_property_enum_integer_serialize
"""
pass
def test_fake_return_list_of_objects(self) -> None:
"""Test case for fake_return_list_of_objects
test returning list of objects # noqa: E501
"""
pass
def test_fake_uuid_example(self) -> None:
"""Test case for fake_uuid_example
test uuid example # noqa: E501
"""
pass
def test_test_body_with_binary(self) -> None:
def test_test_body_with_binary(self):
"""Test case for test_body_with_binary
"""
pass
def test_test_body_with_file_schema(self) -> None:
def test_test_body_with_file_schema(self):
"""Test case for test_body_with_file_schema
"""
pass
def test_test_body_with_query_params(self) -> None:
def test_test_body_with_query_params(self):
"""Test case for test_body_with_query_params
"""
pass
def test_test_client_model(self) -> None:
def test_test_client_model(self):
"""Test case for test_client_model
To test \"client\" model # noqa: E501
"""
pass
def test_test_date_time_query_parameter(self) -> None:
"""Test case for test_date_time_query_parameter
"""
pass
def test_test_endpoint_parameters(self) -> None:
def test_test_endpoint_parameters(self):
"""Test case for test_endpoint_parameters
Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 # noqa: E501
"""
pass
def test_test_group_parameters(self) -> None:
def test_test_group_parameters(self):
"""Test case for test_group_parameters
Fake endpoint to test group parameters (optional) # noqa: E501
"""
pass
def test_test_inline_additional_properties(self) -> None:
def test_test_inline_additional_properties(self):
"""Test case for test_inline_additional_properties
test inline additionalProperties # noqa: E501
"""
pass
def test_test_inline_freeform_additional_properties(self) -> None:
"""Test case for test_inline_freeform_additional_properties
test inline free-form additionalProperties # noqa: E501
"""
pass
def test_test_json_form_data(self) -> None:
def test_test_json_form_data(self):
"""Test case for test_json_form_data
test json serialization of form data # noqa: E501
"""
pass
def test_test_query_parameter_collection_format(self) -> None:
def test_test_query_parameter_collection_format(self):
"""Test case for test_query_parameter_collection_format
"""

View File

@@ -3,30 +3,32 @@
"""
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: \" \\
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 OpenAPI Generator (https://openapi-generator.tech)
Generated by: https://openapi-generator.tech
"""
Do not edit the class manually.
""" # noqa: E501
from __future__ import absolute_import
import unittest
import petstore_api
from petstore_api.api.fake_classname_tags123_api import FakeClassnameTags123Api # noqa: E501
from petstore_api.rest import ApiException
class TestFakeClassnameTags123Api(unittest.TestCase):
"""FakeClassnameTags123Api unit test stubs"""
def setUp(self) -> None:
self.api = FakeClassnameTags123Api() # noqa: E501
def setUp(self):
self.api = petstore_api.api.fake_classname_tags123_api.FakeClassnameTags123Api() # noqa: E501
def tearDown(self) -> None:
def tearDown(self):
pass
def test_test_classname(self) -> None:
def test_test_classname(self):
"""Test case for test_classname
To test class name in snake case # noqa: E501

View File

@@ -3,19 +3,21 @@
"""
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: \" \\
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 OpenAPI Generator (https://openapi-generator.tech)
Generated by: https://openapi-generator.tech
"""
Do not edit the class manually.
""" # noqa: E501
from __future__ import absolute_import
import unittest
import datetime
import petstore_api
from petstore_api.models.file import File # noqa: E501
from petstore_api.rest import ApiException
class TestFile(unittest.TestCase):
"""File unit test stubs"""
@@ -26,22 +28,19 @@ class TestFile(unittest.TestCase):
def tearDown(self):
pass
def make_instance(self, include_optional) -> File:
def make_instance(self, include_optional):
"""Test File
include_option is a boolean, when False only required
params are included, when True both required and
optional params are included """
# uncomment below to create an instance of `File`
"""
model = File() # noqa: E501
if include_optional:
# model = petstore_api.models.file.File() # noqa: E501
if include_optional :
return File(
source_uri = ''
)
else:
else :
return File(
)
"""
def testFile(self):
"""Test File"""

View File

@@ -3,19 +3,21 @@
"""
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: \" \\
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 OpenAPI Generator (https://openapi-generator.tech)
Generated by: https://openapi-generator.tech
"""
Do not edit the class manually.
""" # noqa: E501
from __future__ import absolute_import
import unittest
import datetime
import petstore_api
from petstore_api.models.file_schema_test_class import FileSchemaTestClass # noqa: E501
from petstore_api.rest import ApiException
class TestFileSchemaTestClass(unittest.TestCase):
"""FileSchemaTestClass unit test stubs"""
@@ -26,27 +28,24 @@ class TestFileSchemaTestClass(unittest.TestCase):
def tearDown(self):
pass
def make_instance(self, include_optional) -> FileSchemaTestClass:
def make_instance(self, include_optional):
"""Test FileSchemaTestClass
include_option is a boolean, when False only required
params are included, when True both required and
optional params are included """
# uncomment below to create an instance of `FileSchemaTestClass`
"""
model = FileSchemaTestClass() # noqa: E501
if include_optional:
# model = petstore_api.models.file_schema_test_class.FileSchemaTestClass() # noqa: E501
if include_optional :
return FileSchemaTestClass(
file = petstore_api.models.file.File(
source_uri = '', ),
source_uri = '', ),
files = [
petstore_api.models.file.File(
source_uri = '', )
]
)
else:
else :
return FileSchemaTestClass(
)
"""
def testFileSchemaTestClass(self):
"""Test FileSchemaTestClass"""

View File

@@ -3,19 +3,23 @@
"""
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: \" \\
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 OpenAPI Generator (https://openapi-generator.tech)
Do not edit the class manually.
""" # noqa: E501
"""
from __future__ import absolute_import
import unittest
import datetime
import petstore_api
from petstore_api.models.first_ref import FirstRef # noqa: E501
from petstore_api.rest import ApiException
class TestFirstRef(unittest.TestCase):
"""FirstRef unit test stubs"""
@@ -26,17 +30,17 @@ class TestFirstRef(unittest.TestCase):
def tearDown(self):
pass
def make_instance(self, include_optional) -> FirstRef:
def make_instance(self, include_optional):
"""Test FirstRef
include_option is a boolean, when False only required
params are included, when True both required and
optional params are included """
# uncomment below to create an instance of `FirstRef`
"""
model = FirstRef() # noqa: E501
if include_optional:
model = petstore_api.models.first_ref.FirstRef() # noqa: E501
if include_optional :
return FirstRef(
category = '',
category = '',
self_ref = petstore_api.models.second_ref.SecondRef(
category = '',
circular_ref = petstore_api.models.circular_reference_model.Circular-Reference-Model(
@@ -44,7 +48,7 @@ class TestFirstRef(unittest.TestCase):
nested = petstore_api.models.first_ref.FirstRef(
category = '', ), ), )
)
else:
else :
return FirstRef(
)
"""

View File

@@ -3,19 +3,21 @@
"""
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: \" \\
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 OpenAPI Generator (https://openapi-generator.tech)
Generated by: https://openapi-generator.tech
"""
Do not edit the class manually.
""" # noqa: E501
from __future__ import absolute_import
import unittest
import datetime
import petstore_api
from petstore_api.models.foo import Foo # noqa: E501
from petstore_api.rest import ApiException
class TestFoo(unittest.TestCase):
"""Foo unit test stubs"""
@@ -26,22 +28,19 @@ class TestFoo(unittest.TestCase):
def tearDown(self):
pass
def make_instance(self, include_optional) -> Foo:
def make_instance(self, include_optional):
"""Test Foo
include_option is a boolean, when False only required
params are included, when True both required and
optional params are included """
# uncomment below to create an instance of `Foo`
"""
model = Foo() # noqa: E501
if include_optional:
# model = petstore_api.models.foo.Foo() # noqa: E501
if include_optional :
return Foo(
bar = 'bar'
)
else:
else :
return Foo(
)
"""
def testFoo(self):
"""Test Foo"""

View File

@@ -3,19 +3,21 @@
"""
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: \" \\
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 OpenAPI Generator (https://openapi-generator.tech)
Generated by: https://openapi-generator.tech
"""
Do not edit the class manually.
""" # noqa: E501
from __future__ import absolute_import
import unittest
import datetime
import petstore_api
from petstore_api.models.foo_get_default_response import FooGetDefaultResponse # noqa: E501
from petstore_api.rest import ApiException
class TestFooGetDefaultResponse(unittest.TestCase):
"""FooGetDefaultResponse unit test stubs"""
@@ -26,23 +28,20 @@ class TestFooGetDefaultResponse(unittest.TestCase):
def tearDown(self):
pass
def make_instance(self, include_optional) -> FooGetDefaultResponse:
def make_instance(self, include_optional):
"""Test FooGetDefaultResponse
include_option is a boolean, when False only required
params are included, when True both required and
optional params are included """
# uncomment below to create an instance of `FooGetDefaultResponse`
"""
model = FooGetDefaultResponse() # noqa: E501
if include_optional:
# model = petstore_api.models.foo_get_default_response.FooGetDefaultResponse() # noqa: E501
if include_optional :
return FooGetDefaultResponse(
string = petstore_api.models.foo.Foo(
bar = 'bar', )
)
else:
else :
return FooGetDefaultResponse(
)
"""
def testFooGetDefaultResponse(self):
"""Test FooGetDefaultResponse"""

View File

@@ -3,19 +3,21 @@
"""
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: \" \\
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 OpenAPI Generator (https://openapi-generator.tech)
Generated by: https://openapi-generator.tech
"""
Do not edit the class manually.
""" # noqa: E501
from __future__ import absolute_import
import unittest
import datetime
import petstore_api
from petstore_api.models.format_test import FormatTest # noqa: E501
from petstore_api.rest import ApiException
class TestFormatTest(unittest.TestCase):
"""FormatTest unit test stubs"""
@@ -26,41 +28,37 @@ class TestFormatTest(unittest.TestCase):
def tearDown(self):
pass
def make_instance(self, include_optional) -> FormatTest:
def make_instance(self, include_optional):
"""Test FormatTest
include_option is a boolean, when False only required
params are included, when True both required and
optional params are included """
# uncomment below to create an instance of `FormatTest`
"""
model = FormatTest() # noqa: E501
if include_optional:
# model = petstore_api.models.format_test.FormatTest() # noqa: E501
if include_optional :
return FormatTest(
integer = 10,
int32 = 20,
int64 = 56,
number = 32.1,
float = 54.3,
double = 67.8,
decimal = 1,
string = 'a',
string_with_double_quote_pattern = 'this is \"something\"',
byte = 'YQ==',
binary = bytes(b'blah'),
var_date = datetime.datetime.strptime('1975-12-30', '%Y-%m-%d').date(),
date_time = datetime.datetime.strptime('2013-10-20 19:20:30.00', '%Y-%m-%d %H:%M:%S.%f'),
uuid = '72f98069-206d-4f12-9f12-3d1e525a8e84',
password = '0123456789',
pattern_with_digits = '0480728880',
integer = 10,
int32 = 20,
int64 = 56,
number = 32.1,
float = 54.3,
double = 67.8,
string = 'a',
byte = 'YQ==',
binary = bytes(b'blah'),
_date = datetime.datetime.strptime('1975-12-30', '%Y-%m-%d').date(),
date_time = datetime.datetime.strptime('2013-10-20 19:20:30.00', '%Y-%m-%d %H:%M:%S.%f'),
uuid = '72f98069-206d-4f12-9f12-3d1e525a8e84',
password = '0123456789',
pattern_with_digits = '0480728880',
pattern_with_digits_and_delimiter = 'image_480'
)
else:
else :
return FormatTest(
number = 32.1,
var_date = datetime.datetime.strptime('1975-12-30', '%Y-%m-%d').date(),
byte = 'YQ==',
_date = datetime.datetime.strptime('1975-12-30', '%Y-%m-%d').date(),
password = '0123456789',
)
"""
def testFormatTest(self):
"""Test FormatTest"""

View File

@@ -3,19 +3,21 @@
"""
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: \" \\
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 OpenAPI Generator (https://openapi-generator.tech)
Generated by: https://openapi-generator.tech
"""
Do not edit the class manually.
""" # noqa: E501
from __future__ import absolute_import
import unittest
import datetime
import petstore_api
from petstore_api.models.has_only_read_only import HasOnlyReadOnly # noqa: E501
from petstore_api.rest import ApiException
class TestHasOnlyReadOnly(unittest.TestCase):
"""HasOnlyReadOnly unit test stubs"""
@@ -26,23 +28,20 @@ class TestHasOnlyReadOnly(unittest.TestCase):
def tearDown(self):
pass
def make_instance(self, include_optional) -> HasOnlyReadOnly:
def make_instance(self, include_optional):
"""Test HasOnlyReadOnly
include_option is a boolean, when False only required
params are included, when True both required and
optional params are included """
# uncomment below to create an instance of `HasOnlyReadOnly`
"""
model = HasOnlyReadOnly() # noqa: E501
if include_optional:
# model = petstore_api.models.has_only_read_only.HasOnlyReadOnly() # noqa: E501
if include_optional :
return HasOnlyReadOnly(
bar = '',
bar = '',
foo = ''
)
else:
else :
return HasOnlyReadOnly(
)
"""
def testHasOnlyReadOnly(self):
"""Test HasOnlyReadOnly"""

View File

@@ -3,19 +3,21 @@
"""
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: \" \\
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 OpenAPI Generator (https://openapi-generator.tech)
Generated by: https://openapi-generator.tech
"""
Do not edit the class manually.
""" # noqa: E501
from __future__ import absolute_import
import unittest
import datetime
import petstore_api
from petstore_api.models.health_check_result import HealthCheckResult # noqa: E501
from petstore_api.rest import ApiException
class TestHealthCheckResult(unittest.TestCase):
"""HealthCheckResult unit test stubs"""
@@ -26,22 +28,19 @@ class TestHealthCheckResult(unittest.TestCase):
def tearDown(self):
pass
def make_instance(self, include_optional) -> HealthCheckResult:
def make_instance(self, include_optional):
"""Test HealthCheckResult
include_option is a boolean, when False only required
params are included, when True both required and
optional params are included """
# uncomment below to create an instance of `HealthCheckResult`
"""
model = HealthCheckResult() # noqa: E501
if include_optional:
# model = petstore_api.models.health_check_result.HealthCheckResult() # noqa: E501
if include_optional :
return HealthCheckResult(
nullable_message = ''
)
else:
else :
return HealthCheckResult(
)
"""
def testHealthCheckResult(self):
"""Test HealthCheckResult"""

View File

@@ -3,19 +3,23 @@
"""
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: \" \\
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 OpenAPI Generator (https://openapi-generator.tech)
Do not edit the class manually.
""" # noqa: E501
"""
from __future__ import absolute_import
import unittest
import datetime
import petstore_api
from petstore_api.models.inner_dict_with_property import InnerDictWithProperty # noqa: E501
from petstore_api.rest import ApiException
class TestInnerDictWithProperty(unittest.TestCase):
"""InnerDictWithProperty unit test stubs"""
@@ -26,19 +30,19 @@ class TestInnerDictWithProperty(unittest.TestCase):
def tearDown(self):
pass
def make_instance(self, include_optional) -> InnerDictWithProperty:
def make_instance(self, include_optional):
"""Test InnerDictWithProperty
include_option is a boolean, when False only required
params are included, when True both required and
optional params are included """
# uncomment below to create an instance of `InnerDictWithProperty`
"""
model = InnerDictWithProperty() # noqa: E501
if include_optional:
model = petstore_api.models.inner_dict_with_property.InnerDictWithProperty() # noqa: E501
if include_optional :
return InnerDictWithProperty(
a_property = None
)
else:
else :
return InnerDictWithProperty(
)
"""

View File

@@ -3,19 +3,21 @@
"""
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: \" \\
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 OpenAPI Generator (https://openapi-generator.tech)
Do not edit the class manually.
""" # noqa: E501
"""
import unittest
import datetime
import petstore_api
from petstore_api.models.int_or_string import IntOrString # noqa: E501
from petstore_api.rest import ApiException
class TestIntOrString(unittest.TestCase):
"""IntOrString unit test stubs"""
@@ -26,18 +28,18 @@ class TestIntOrString(unittest.TestCase):
def tearDown(self):
pass
def make_instance(self, include_optional) -> IntOrString:
def make_instance(self, include_optional):
"""Test IntOrString
include_option is a boolean, when False only required
params are included, when True both required and
optional params are included """
# uncomment below to create an instance of `IntOrString`
"""
model = IntOrString() # noqa: E501
if include_optional:
model = petstore_api.models.int_or_string.IntOrString() # noqa: E501
if include_optional :
return IntOrString(
)
else:
else :
return IntOrString(
)
"""

View File

@@ -3,19 +3,21 @@
"""
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: \" \\
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 OpenAPI Generator (https://openapi-generator.tech)
Generated by: https://openapi-generator.tech
"""
Do not edit the class manually.
""" # noqa: E501
from __future__ import absolute_import
import unittest
import datetime
import petstore_api
from petstore_api.models.list import List # noqa: E501
from petstore_api.rest import ApiException
class TestList(unittest.TestCase):
"""List unit test stubs"""
@@ -26,22 +28,19 @@ class TestList(unittest.TestCase):
def tearDown(self):
pass
def make_instance(self, include_optional) -> List:
def make_instance(self, include_optional):
"""Test List
include_option is a boolean, when False only required
params are included, when True both required and
optional params are included """
# uncomment below to create an instance of `List`
"""
model = List() # noqa: E501
if include_optional:
# model = petstore_api.models.list.List() # noqa: E501
if include_optional :
return List(
var_123_list = ''
_123_list = ''
)
else:
else :
return List(
)
"""
def testList(self):
"""Test List"""

View File

@@ -3,19 +3,21 @@
"""
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: \" \\
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 OpenAPI Generator (https://openapi-generator.tech)
Do not edit the class manually.
""" # noqa: E501
"""
import unittest
import datetime
import petstore_api
from petstore_api.models.map_of_array_of_model import MapOfArrayOfModel # noqa: E501
from petstore_api.rest import ApiException
class TestMapOfArrayOfModel(unittest.TestCase):
"""MapOfArrayOfModel unit test stubs"""
@@ -26,15 +28,15 @@ class TestMapOfArrayOfModel(unittest.TestCase):
def tearDown(self):
pass
def make_instance(self, include_optional) -> MapOfArrayOfModel:
def make_instance(self, include_optional):
"""Test MapOfArrayOfModel
include_option is a boolean, when False only required
params are included, when True both required and
optional params are included """
# uncomment below to create an instance of `MapOfArrayOfModel`
"""
model = MapOfArrayOfModel() # noqa: E501
if include_optional:
model = petstore_api.models.map_of_array_of_model.MapOfArrayOfModel() # noqa: E501
if include_optional :
return MapOfArrayOfModel(
shop_id_to_org_online_lip_map = {
'key' : [
@@ -44,7 +46,7 @@ class TestMapOfArrayOfModel(unittest.TestCase):
]
}
)
else:
else :
return MapOfArrayOfModel(
)
"""

View File

@@ -3,19 +3,21 @@
"""
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: \" \\
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 OpenAPI Generator (https://openapi-generator.tech)
Generated by: https://openapi-generator.tech
"""
Do not edit the class manually.
""" # noqa: E501
from __future__ import absolute_import
import unittest
import datetime
import petstore_api
from petstore_api.models.map_test import MapTest # noqa: E501
from petstore_api.rest import ApiException
class TestMapTest(unittest.TestCase):
"""MapTest unit test stubs"""
@@ -26,35 +28,32 @@ class TestMapTest(unittest.TestCase):
def tearDown(self):
pass
def make_instance(self, include_optional) -> MapTest:
def make_instance(self, include_optional):
"""Test MapTest
include_option is a boolean, when False only required
params are included, when True both required and
optional params are included """
# uncomment below to create an instance of `MapTest`
"""
model = MapTest() # noqa: E501
if include_optional:
# model = petstore_api.models.map_test.MapTest() # noqa: E501
if include_optional :
return MapTest(
map_map_of_string = {
'key' : {
'key' : ''
}
},
},
map_of_enum_string = {
'UPPER' : 'UPPER'
},
},
direct_map = {
'key' : True
},
},
indirect_map = {
'key' : True
}
)
else:
else :
return MapTest(
)
"""
def testMapTest(self):
"""Test MapTest"""

View File

@@ -3,19 +3,21 @@
"""
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: \" \\
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 OpenAPI Generator (https://openapi-generator.tech)
Generated by: https://openapi-generator.tech
"""
Do not edit the class manually.
""" # noqa: E501
from __future__ import absolute_import
import unittest
import datetime
import petstore_api
from petstore_api.models.mixed_properties_and_additional_properties_class import MixedPropertiesAndAdditionalPropertiesClass # noqa: E501
from petstore_api.rest import ApiException
class TestMixedPropertiesAndAdditionalPropertiesClass(unittest.TestCase):
"""MixedPropertiesAndAdditionalPropertiesClass unit test stubs"""
@@ -26,28 +28,25 @@ class TestMixedPropertiesAndAdditionalPropertiesClass(unittest.TestCase):
def tearDown(self):
pass
def make_instance(self, include_optional) -> MixedPropertiesAndAdditionalPropertiesClass:
def make_instance(self, include_optional):
"""Test MixedPropertiesAndAdditionalPropertiesClass
include_option is a boolean, when False only required
params are included, when True both required and
optional params are included """
# uncomment below to create an instance of `MixedPropertiesAndAdditionalPropertiesClass`
"""
model = MixedPropertiesAndAdditionalPropertiesClass() # noqa: E501
if include_optional:
# model = petstore_api.models.mixed_properties_and_additional_properties_class.MixedPropertiesAndAdditionalPropertiesClass() # noqa: E501
if include_optional :
return MixedPropertiesAndAdditionalPropertiesClass(
uuid = '',
date_time = datetime.datetime.strptime('2013-10-20 19:20:30.00', '%Y-%m-%d %H:%M:%S.%f'),
uuid = '',
date_time = datetime.datetime.strptime('2013-10-20 19:20:30.00', '%Y-%m-%d %H:%M:%S.%f'),
map = {
'key' : petstore_api.models.animal.Animal(
class_name = '',
color = 'red', )
}
)
else:
else :
return MixedPropertiesAndAdditionalPropertiesClass(
)
"""
def testMixedPropertiesAndAdditionalPropertiesClass(self):
"""Test MixedPropertiesAndAdditionalPropertiesClass"""

View File

@@ -3,19 +3,21 @@
"""
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: \" \\
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 OpenAPI Generator (https://openapi-generator.tech)
Generated by: https://openapi-generator.tech
"""
Do not edit the class manually.
""" # noqa: E501
from __future__ import absolute_import
import unittest
import datetime
import petstore_api
from petstore_api.models.model200_response import Model200Response # noqa: E501
from petstore_api.rest import ApiException
class TestModel200Response(unittest.TestCase):
"""Model200Response unit test stubs"""
@@ -26,23 +28,20 @@ class TestModel200Response(unittest.TestCase):
def tearDown(self):
pass
def make_instance(self, include_optional) -> Model200Response:
def make_instance(self, include_optional):
"""Test Model200Response
include_option is a boolean, when False only required
params are included, when True both required and
optional params are included """
# uncomment below to create an instance of `Model200Response`
"""
model = Model200Response() # noqa: E501
if include_optional:
# model = petstore_api.models.model200_response.Model200Response() # noqa: E501
if include_optional :
return Model200Response(
name = 56,
var_class = ''
name = 56,
_class = ''
)
else:
else :
return Model200Response(
)
"""
def testModel200Response(self):
"""Test Model200Response"""

View File

@@ -3,19 +3,21 @@
"""
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: \" \\
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 OpenAPI Generator (https://openapi-generator.tech)
Generated by: https://openapi-generator.tech
"""
Do not edit the class manually.
""" # noqa: E501
from __future__ import absolute_import
import unittest
import datetime
import petstore_api
from petstore_api.models.model_return import ModelReturn # noqa: E501
from petstore_api.rest import ApiException
class TestModelReturn(unittest.TestCase):
"""ModelReturn unit test stubs"""
@@ -26,22 +28,19 @@ class TestModelReturn(unittest.TestCase):
def tearDown(self):
pass
def make_instance(self, include_optional) -> ModelReturn:
def make_instance(self, include_optional):
"""Test ModelReturn
include_option is a boolean, when False only required
params are included, when True both required and
optional params are included """
# uncomment below to create an instance of `ModelReturn`
"""
model = ModelReturn() # noqa: E501
if include_optional:
# model = petstore_api.models.model_return.ModelReturn() # noqa: E501
if include_optional :
return ModelReturn(
var_return = 56
_return = 56
)
else:
else :
return ModelReturn(
)
"""
def testModelReturn(self):
"""Test ModelReturn"""

View File

@@ -3,19 +3,21 @@
"""
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: \" \\
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 OpenAPI Generator (https://openapi-generator.tech)
Generated by: https://openapi-generator.tech
"""
Do not edit the class manually.
""" # noqa: E501
from __future__ import absolute_import
import unittest
import datetime
import petstore_api
from petstore_api.models.name import Name # noqa: E501
from petstore_api.rest import ApiException
class TestName(unittest.TestCase):
"""Name unit test stubs"""
@@ -26,26 +28,23 @@ class TestName(unittest.TestCase):
def tearDown(self):
pass
def make_instance(self, include_optional) -> Name:
def make_instance(self, include_optional):
"""Test Name
include_option is a boolean, when False only required
params are included, when True both required and
optional params are included """
# uncomment below to create an instance of `Name`
"""
model = Name() # noqa: E501
if include_optional:
# model = petstore_api.models.name.Name() # noqa: E501
if include_optional :
return Name(
name = 56,
snake_case = 56,
var_property = '',
var_123_number = 56
name = 56,
snake_case = 56,
_property = '',
_123_number = 56
)
else:
else :
return Name(
name = 56,
)
"""
def testName(self):
"""Test Name"""

View File

@@ -3,19 +3,21 @@
"""
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: \" \\
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 OpenAPI Generator (https://openapi-generator.tech)
Generated by: https://openapi-generator.tech
"""
Do not edit the class manually.
""" # noqa: E501
from __future__ import absolute_import
import unittest
import datetime
import petstore_api
from petstore_api.models.nullable_class import NullableClass # noqa: E501
from petstore_api.rest import ApiException
class TestNullableClass(unittest.TestCase):
"""NullableClass unit test stubs"""
@@ -26,47 +28,44 @@ class TestNullableClass(unittest.TestCase):
def tearDown(self):
pass
def make_instance(self, include_optional) -> NullableClass:
def make_instance(self, include_optional):
"""Test NullableClass
include_option is a boolean, when False only required
params are included, when True both required and
optional params are included """
# uncomment below to create an instance of `NullableClass`
"""
model = NullableClass() # noqa: E501
if include_optional:
# model = petstore_api.models.nullable_class.NullableClass() # noqa: E501
if include_optional :
return NullableClass(
required_integer_prop = 56,
integer_prop = 56,
number_prop = 1.337,
boolean_prop = True,
string_prop = '',
date_prop = datetime.datetime.strptime('1975-12-30', '%Y-%m-%d').date(),
datetime_prop = datetime.datetime.strptime('2013-10-20 19:20:30.00', '%Y-%m-%d %H:%M:%S.%f'),
required_integer_prop = 56,
integer_prop = 56,
number_prop = 1.337,
boolean_prop = True,
string_prop = '',
date_prop = datetime.datetime.strptime('1975-12-30', '%Y-%m-%d').date(),
datetime_prop = datetime.datetime.strptime('2013-10-20 19:20:30.00', '%Y-%m-%d %H:%M:%S.%f'),
array_nullable_prop = [
None
],
],
array_and_items_nullable_prop = [
None
],
],
array_items_nullable = [
None
],
],
object_nullable_prop = {
'key' : None
},
},
object_and_items_nullable_prop = {
'key' : None
},
},
object_items_nullable = {
'key' : None
}
)
else:
else :
return NullableClass(
required_integer_prop = 56,
)
"""
def testNullableClass(self):
"""Test NullableClass"""

View File

@@ -3,19 +3,21 @@
"""
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: \" \\
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 OpenAPI Generator (https://openapi-generator.tech)
Do not edit the class manually.
""" # noqa: E501
"""
import unittest
import datetime
import petstore_api
from petstore_api.models.nullable_property import NullableProperty # noqa: E501
from petstore_api.rest import ApiException
class TestNullableProperty(unittest.TestCase):
"""NullableProperty unit test stubs"""
@@ -26,20 +28,20 @@ class TestNullableProperty(unittest.TestCase):
def tearDown(self):
pass
def make_instance(self, include_optional) -> NullableProperty:
def make_instance(self, include_optional):
"""Test NullableProperty
include_option is a boolean, when False only required
params are included, when True both required and
optional params are included """
# uncomment below to create an instance of `NullableProperty`
"""
model = NullableProperty() # noqa: E501
if include_optional:
model = petstore_api.models.nullable_property.NullableProperty() # noqa: E501
if include_optional :
return NullableProperty(
id = 56,
id = 56,
name = 'AUR,rZ#UM/?R,Fp^l6$ARjbhJk C>'
)
else:
else :
return NullableProperty(
id = 56,
name = 'AUR,rZ#UM/?R,Fp^l6$ARjbhJk C>',

View File

@@ -3,19 +3,21 @@
"""
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: \" \\
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 OpenAPI Generator (https://openapi-generator.tech)
Generated by: https://openapi-generator.tech
"""
Do not edit the class manually.
""" # noqa: E501
from __future__ import absolute_import
import unittest
import datetime
import petstore_api
from petstore_api.models.number_only import NumberOnly # noqa: E501
from petstore_api.rest import ApiException
class TestNumberOnly(unittest.TestCase):
"""NumberOnly unit test stubs"""
@@ -26,22 +28,19 @@ class TestNumberOnly(unittest.TestCase):
def tearDown(self):
pass
def make_instance(self, include_optional) -> NumberOnly:
def make_instance(self, include_optional):
"""Test NumberOnly
include_option is a boolean, when False only required
params are included, when True both required and
optional params are included """
# uncomment below to create an instance of `NumberOnly`
"""
model = NumberOnly() # noqa: E501
if include_optional:
# model = petstore_api.models.number_only.NumberOnly() # noqa: E501
if include_optional :
return NumberOnly(
just_number = 1.337
)
else:
else :
return NumberOnly(
)
"""
def testNumberOnly(self):
"""Test NumberOnly"""

View File

@@ -3,19 +3,21 @@
"""
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: \" \\
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 OpenAPI Generator (https://openapi-generator.tech)
Do not edit the class manually.
""" # noqa: E501
"""
import unittest
import datetime
import petstore_api
from petstore_api.models.object_to_test_additional_properties import ObjectToTestAdditionalProperties # noqa: E501
from petstore_api.rest import ApiException
class TestObjectToTestAdditionalProperties(unittest.TestCase):
"""ObjectToTestAdditionalProperties unit test stubs"""
@@ -26,19 +28,19 @@ class TestObjectToTestAdditionalProperties(unittest.TestCase):
def tearDown(self):
pass
def make_instance(self, include_optional) -> ObjectToTestAdditionalProperties:
def make_instance(self, include_optional):
"""Test ObjectToTestAdditionalProperties
include_option is a boolean, when False only required
params are included, when True both required and
optional params are included """
# uncomment below to create an instance of `ObjectToTestAdditionalProperties`
"""
model = ObjectToTestAdditionalProperties() # noqa: E501
if include_optional:
model = petstore_api.models.object_to_test_additional_properties.ObjectToTestAdditionalProperties() # noqa: E501
if include_optional :
return ObjectToTestAdditionalProperties(
var_property = True
)
else:
else :
return ObjectToTestAdditionalProperties(
)
"""

View File

@@ -3,19 +3,21 @@
"""
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: \" \\
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 OpenAPI Generator (https://openapi-generator.tech)
Generated by: https://openapi-generator.tech
"""
Do not edit the class manually.
""" # noqa: E501
from __future__ import absolute_import
import unittest
import datetime
import petstore_api
from petstore_api.models.object_with_deprecated_fields import ObjectWithDeprecatedFields # noqa: E501
from petstore_api.rest import ApiException
class TestObjectWithDeprecatedFields(unittest.TestCase):
"""ObjectWithDeprecatedFields unit test stubs"""
@@ -26,28 +28,25 @@ class TestObjectWithDeprecatedFields(unittest.TestCase):
def tearDown(self):
pass
def make_instance(self, include_optional) -> ObjectWithDeprecatedFields:
def make_instance(self, include_optional):
"""Test ObjectWithDeprecatedFields
include_option is a boolean, when False only required
params are included, when True both required and
optional params are included """
# uncomment below to create an instance of `ObjectWithDeprecatedFields`
"""
model = ObjectWithDeprecatedFields() # noqa: E501
if include_optional:
# model = petstore_api.models.object_with_deprecated_fields.ObjectWithDeprecatedFields() # noqa: E501
if include_optional :
return ObjectWithDeprecatedFields(
uuid = '',
id = 1.337,
uuid = '',
id = 1.337,
deprecated_ref = petstore_api.models.deprecated_object.DeprecatedObject(
name = '', ),
name = '', ),
bars = [
'bar'
]
)
else:
else :
return ObjectWithDeprecatedFields(
)
"""
def testObjectWithDeprecatedFields(self):
"""Test ObjectWithDeprecatedFields"""

View File

@@ -3,19 +3,21 @@
"""
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: \" \\
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 OpenAPI Generator (https://openapi-generator.tech)
Do not edit the class manually.
""" # noqa: E501
"""
import unittest
import datetime
import petstore_api
from petstore_api.models.one_of_enum_string import OneOfEnumString # noqa: E501
from petstore_api.rest import ApiException
class TestOneOfEnumString(unittest.TestCase):
"""OneOfEnumString unit test stubs"""
@@ -26,18 +28,18 @@ class TestOneOfEnumString(unittest.TestCase):
def tearDown(self):
pass
def make_instance(self, include_optional) -> OneOfEnumString:
def make_instance(self, include_optional):
"""Test OneOfEnumString
include_option is a boolean, when False only required
params are included, when True both required and
optional params are included """
# uncomment below to create an instance of `OneOfEnumString`
"""
model = OneOfEnumString() # noqa: E501
if include_optional:
model = petstore_api.models.one_of_enum_string.OneOfEnumString() # noqa: E501
if include_optional :
return OneOfEnumString(
)
else:
else :
return OneOfEnumString(
)
"""

View File

@@ -3,19 +3,21 @@
"""
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: \" \\
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 OpenAPI Generator (https://openapi-generator.tech)
Generated by: https://openapi-generator.tech
"""
Do not edit the class manually.
""" # noqa: E501
from __future__ import absolute_import
import unittest
import datetime
import petstore_api
from petstore_api.models.order import Order # noqa: E501
from petstore_api.rest import ApiException
class TestOrder(unittest.TestCase):
"""Order unit test stubs"""
@@ -26,27 +28,24 @@ class TestOrder(unittest.TestCase):
def tearDown(self):
pass
def make_instance(self, include_optional) -> Order:
def make_instance(self, include_optional):
"""Test Order
include_option is a boolean, when False only required
params are included, when True both required and
optional params are included """
# uncomment below to create an instance of `Order`
"""
model = Order() # noqa: E501
if include_optional:
# model = petstore_api.models.order.Order() # noqa: E501
if include_optional :
return Order(
id = 56,
pet_id = 56,
quantity = 56,
ship_date = datetime.datetime.strptime('2013-10-20 19:20:30.00', '%Y-%m-%d %H:%M:%S.%f'),
status = 'placed',
id = 56,
pet_id = 56,
quantity = 56,
ship_date = datetime.datetime.strptime('2013-10-20 19:20:30.00', '%Y-%m-%d %H:%M:%S.%f'),
status = 'placed',
complete = True
)
else:
else :
return Order(
)
"""
def testOrder(self):
"""Test Order"""

View File

@@ -3,19 +3,21 @@
"""
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: \" \\
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 OpenAPI Generator (https://openapi-generator.tech)
Generated by: https://openapi-generator.tech
"""
Do not edit the class manually.
""" # noqa: E501
from __future__ import absolute_import
import unittest
import datetime
import petstore_api
from petstore_api.models.outer_composite import OuterComposite # noqa: E501
from petstore_api.rest import ApiException
class TestOuterComposite(unittest.TestCase):
"""OuterComposite unit test stubs"""
@@ -26,24 +28,21 @@ class TestOuterComposite(unittest.TestCase):
def tearDown(self):
pass
def make_instance(self, include_optional) -> OuterComposite:
def make_instance(self, include_optional):
"""Test OuterComposite
include_option is a boolean, when False only required
params are included, when True both required and
optional params are included """
# uncomment below to create an instance of `OuterComposite`
"""
model = OuterComposite() # noqa: E501
if include_optional:
# model = petstore_api.models.outer_composite.OuterComposite() # noqa: E501
if include_optional :
return OuterComposite(
my_number = 1.337,
my_string = '',
my_number = 1.337,
my_string = '',
my_boolean = True
)
else:
else :
return OuterComposite(
)
"""
def testOuterComposite(self):
"""Test OuterComposite"""

View File

@@ -3,19 +3,21 @@
"""
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: \" \\
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 OpenAPI Generator (https://openapi-generator.tech)
Generated by: https://openapi-generator.tech
"""
Do not edit the class manually.
""" # noqa: E501
from __future__ import absolute_import
import unittest
import datetime
import petstore_api
from petstore_api.models.outer_enum import OuterEnum # noqa: E501
from petstore_api.rest import ApiException
class TestOuterEnum(unittest.TestCase):
"""OuterEnum unit test stubs"""

View File

@@ -3,19 +3,21 @@
"""
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: \" \\
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 OpenAPI Generator (https://openapi-generator.tech)
Generated by: https://openapi-generator.tech
"""
Do not edit the class manually.
""" # noqa: E501
from __future__ import absolute_import
import unittest
import datetime
import petstore_api
from petstore_api.models.outer_enum_default_value import OuterEnumDefaultValue # noqa: E501
from petstore_api.rest import ApiException
class TestOuterEnumDefaultValue(unittest.TestCase):
"""OuterEnumDefaultValue unit test stubs"""

View File

@@ -3,19 +3,21 @@
"""
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: \" \\
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 OpenAPI Generator (https://openapi-generator.tech)
Generated by: https://openapi-generator.tech
"""
Do not edit the class manually.
""" # noqa: E501
from __future__ import absolute_import
import unittest
import datetime
import petstore_api
from petstore_api.models.outer_enum_integer import OuterEnumInteger # noqa: E501
from petstore_api.rest import ApiException
class TestOuterEnumInteger(unittest.TestCase):
"""OuterEnumInteger unit test stubs"""

View File

@@ -3,19 +3,21 @@
"""
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: \" \\
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 OpenAPI Generator (https://openapi-generator.tech)
Generated by: https://openapi-generator.tech
"""
Do not edit the class manually.
""" # noqa: E501
from __future__ import absolute_import
import unittest
import datetime
import petstore_api
from petstore_api.models.outer_enum_integer_default_value import OuterEnumIntegerDefaultValue # noqa: E501
from petstore_api.rest import ApiException
class TestOuterEnumIntegerDefaultValue(unittest.TestCase):
"""OuterEnumIntegerDefaultValue unit test stubs"""

View File

@@ -3,19 +3,21 @@
"""
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: \" \\
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 OpenAPI Generator (https://openapi-generator.tech)
Generated by: https://openapi-generator.tech
"""
Do not edit the class manually.
""" # noqa: E501
from __future__ import absolute_import
import unittest
import datetime
import petstore_api
from petstore_api.models.outer_object_with_enum_property import OuterObjectWithEnumProperty # noqa: E501
from petstore_api.rest import ApiException
class TestOuterObjectWithEnumProperty(unittest.TestCase):
"""OuterObjectWithEnumProperty unit test stubs"""
@@ -26,24 +28,20 @@ class TestOuterObjectWithEnumProperty(unittest.TestCase):
def tearDown(self):
pass
def make_instance(self, include_optional) -> OuterObjectWithEnumProperty:
def make_instance(self, include_optional):
"""Test OuterObjectWithEnumProperty
include_option is a boolean, when False only required
params are included, when True both required and
optional params are included """
# uncomment below to create an instance of `OuterObjectWithEnumProperty`
"""
model = OuterObjectWithEnumProperty() # noqa: E501
if include_optional:
# model = petstore_api.models.outer_object_with_enum_property.OuterObjectWithEnumProperty() # noqa: E501
if include_optional :
return OuterObjectWithEnumProperty(
str_value = 'placed',
value = 2
)
else:
else :
return OuterObjectWithEnumProperty(
value = 2,
)
"""
def testOuterObjectWithEnumProperty(self):
"""Test OuterObjectWithEnumProperty"""

View File

@@ -3,19 +3,21 @@
"""
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: \" \\
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 OpenAPI Generator (https://openapi-generator.tech)
Do not edit the class manually.
""" # noqa: E501
"""
import unittest
import datetime
import petstore_api
from petstore_api.models.parent import Parent # noqa: E501
from petstore_api.rest import ApiException
class TestParent(unittest.TestCase):
"""Parent unit test stubs"""
@@ -26,22 +28,22 @@ class TestParent(unittest.TestCase):
def tearDown(self):
pass
def make_instance(self, include_optional) -> Parent:
def make_instance(self, include_optional):
"""Test Parent
include_option is a boolean, when False only required
params are included, when True both required and
optional params are included """
# uncomment below to create an instance of `Parent`
"""
model = Parent() # noqa: E501
if include_optional:
model = petstore_api.models.parent.Parent() # noqa: E501
if include_optional :
return Parent(
optional_dict = {
'key' : petstore_api.models.inner_dict_with_property.InnerDictWithProperty(
a_property = petstore_api.models.a_property.aProperty(), )
}
)
else:
else :
return Parent(
)
"""

View File

@@ -3,19 +3,23 @@
"""
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: \" \\
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 OpenAPI Generator (https://openapi-generator.tech)
Do not edit the class manually.
""" # noqa: E501
"""
from __future__ import absolute_import
import unittest
import datetime
import petstore_api
from petstore_api.models.parent_with_optional_dict import ParentWithOptionalDict # noqa: E501
from petstore_api.rest import ApiException
class TestParentWithOptionalDict(unittest.TestCase):
"""ParentWithOptionalDict unit test stubs"""
@@ -26,22 +30,22 @@ class TestParentWithOptionalDict(unittest.TestCase):
def tearDown(self):
pass
def make_instance(self, include_optional) -> ParentWithOptionalDict:
def make_instance(self, include_optional):
"""Test ParentWithOptionalDict
include_option is a boolean, when False only required
params are included, when True both required and
optional params are included """
# uncomment below to create an instance of `ParentWithOptionalDict`
"""
model = ParentWithOptionalDict() # noqa: E501
if include_optional:
model = petstore_api.models.parent_with_optional_dict.ParentWithOptionalDict() # noqa: E501
if include_optional :
return ParentWithOptionalDict(
optional_dict = {
'key' : petstore_api.models.inner_dict_with_property.InnerDictWithProperty(
a_property = petstore_api.models.a_property.aProperty(), )
}
)
else:
else :
return ParentWithOptionalDict(
)
"""

View File

@@ -3,19 +3,21 @@
"""
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: \" \\
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 OpenAPI Generator (https://openapi-generator.tech)
Generated by: https://openapi-generator.tech
"""
Do not edit the class manually.
""" # noqa: E501
from __future__ import absolute_import
import unittest
import datetime
import petstore_api
from petstore_api.models.pet import Pet # noqa: E501
from petstore_api.rest import ApiException
class TestPet(unittest.TestCase):
"""Pet unit test stubs"""
@@ -26,39 +28,36 @@ class TestPet(unittest.TestCase):
def tearDown(self):
pass
def make_instance(self, include_optional) -> Pet:
def make_instance(self, include_optional):
"""Test Pet
include_option is a boolean, when False only required
params are included, when True both required and
optional params are included """
# uncomment below to create an instance of `Pet`
"""
model = Pet() # noqa: E501
if include_optional:
# model = petstore_api.models.pet.Pet() # noqa: E501
if include_optional :
return Pet(
id = 56,
id = 56,
category = petstore_api.models.category.Category(
id = 56,
name = 'default-name', ),
name = 'doggie',
name = 'default-name', ),
name = 'doggie',
photo_urls = [
''
],
],
tags = [
petstore_api.models.tag.Tag(
id = 56,
name = '', )
],
],
status = 'available'
)
else:
else :
return Pet(
name = 'doggie',
photo_urls = [
''
],
)
"""
def testPet(self):
"""Test Pet"""

View File

@@ -3,86 +3,88 @@
"""
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: \" \\
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 OpenAPI Generator (https://openapi-generator.tech)
Generated by: https://openapi-generator.tech
"""
Do not edit the class manually.
""" # noqa: E501
from __future__ import absolute_import
import unittest
import petstore_api
from petstore_api.api.pet_api import PetApi # noqa: E501
from petstore_api.rest import ApiException
class TestPetApi(unittest.TestCase):
"""PetApi unit test stubs"""
def setUp(self) -> None:
self.api = PetApi() # noqa: E501
def setUp(self):
self.api = petstore_api.api.pet_api.PetApi() # noqa: E501
def tearDown(self) -> None:
def tearDown(self):
pass
def test_add_pet(self) -> None:
def test_add_pet(self):
"""Test case for add_pet
Add a new pet to the store # noqa: E501
"""
pass
def test_delete_pet(self) -> None:
def test_delete_pet(self):
"""Test case for delete_pet
Deletes a pet # noqa: E501
"""
pass
def test_find_pets_by_status(self) -> None:
def test_find_pets_by_status(self):
"""Test case for find_pets_by_status
Finds Pets by status # noqa: E501
"""
pass
def test_find_pets_by_tags(self) -> None:
def test_find_pets_by_tags(self):
"""Test case for find_pets_by_tags
Finds Pets by tags # noqa: E501
"""
pass
def test_get_pet_by_id(self) -> None:
def test_get_pet_by_id(self):
"""Test case for get_pet_by_id
Find pet by ID # noqa: E501
"""
pass
def test_update_pet(self) -> None:
def test_update_pet(self):
"""Test case for update_pet
Update an existing pet # noqa: E501
"""
pass
def test_update_pet_with_form(self) -> None:
def test_update_pet_with_form(self):
"""Test case for update_pet_with_form
Updates a pet in the store with form data # noqa: E501
"""
pass
def test_upload_file(self) -> None:
def test_upload_file(self):
"""Test case for upload_file
uploads an image # noqa: E501
"""
pass
def test_upload_file_with_required_file(self) -> None:
def test_upload_file_with_required_file(self):
"""Test case for upload_file_with_required_file
uploads an image (required) # noqa: E501

View File

@@ -3,19 +3,21 @@
"""
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: \" \\
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 OpenAPI Generator (https://openapi-generator.tech)
Generated by: https://openapi-generator.tech
"""
Do not edit the class manually.
""" # noqa: E501
from __future__ import absolute_import
import unittest
import datetime
import petstore_api
from petstore_api.models.pig import Pig # noqa: E501
from petstore_api.rest import ApiException
class TestPig(unittest.TestCase):
"""Pig unit test stubs"""
@@ -26,27 +28,24 @@ class TestPig(unittest.TestCase):
def tearDown(self):
pass
def make_instance(self, include_optional) -> Pig:
def make_instance(self, include_optional):
"""Test Pig
include_option is a boolean, when False only required
params are included, when True both required and
optional params are included """
# uncomment below to create an instance of `Pig`
"""
model = Pig() # noqa: E501
if include_optional:
# model = petstore_api.models.pig.Pig() # noqa: E501
if include_optional :
return Pig(
class_name = '',
color = '',
class_name = '',
color = '',
size = 56
)
else:
else :
return Pig(
class_name = '',
color = '',
size = 56,
)
"""
def testPig(self):
"""Test Pig"""

View File

@@ -3,19 +3,21 @@
"""
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: \" \\
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 OpenAPI Generator (https://openapi-generator.tech)
Do not edit the class manually.
""" # noqa: E501
"""
import unittest
import datetime
import petstore_api
from petstore_api.models.property_name_collision import PropertyNameCollision # noqa: E501
from petstore_api.rest import ApiException
class TestPropertyNameCollision(unittest.TestCase):
"""PropertyNameCollision unit test stubs"""
@@ -26,21 +28,21 @@ class TestPropertyNameCollision(unittest.TestCase):
def tearDown(self):
pass
def make_instance(self, include_optional) -> PropertyNameCollision:
def make_instance(self, include_optional):
"""Test PropertyNameCollision
include_option is a boolean, when False only required
params are included, when True both required and
optional params are included """
# uncomment below to create an instance of `PropertyNameCollision`
"""
model = PropertyNameCollision() # noqa: E501
if include_optional:
model = petstore_api.models.property_name_collision.PropertyNameCollision() # noqa: E501
if include_optional :
return PropertyNameCollision(
type = '',
type = '',
type = '',
type = '',
type_ = ''
)
else:
else :
return PropertyNameCollision(
)
"""

View File

@@ -3,19 +3,21 @@
"""
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: \" \\
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 OpenAPI Generator (https://openapi-generator.tech)
Generated by: https://openapi-generator.tech
"""
Do not edit the class manually.
""" # noqa: E501
from __future__ import absolute_import
import unittest
import datetime
import petstore_api
from petstore_api.models.read_only_first import ReadOnlyFirst # noqa: E501
from petstore_api.rest import ApiException
class TestReadOnlyFirst(unittest.TestCase):
"""ReadOnlyFirst unit test stubs"""
@@ -26,23 +28,20 @@ class TestReadOnlyFirst(unittest.TestCase):
def tearDown(self):
pass
def make_instance(self, include_optional) -> ReadOnlyFirst:
def make_instance(self, include_optional):
"""Test ReadOnlyFirst
include_option is a boolean, when False only required
params are included, when True both required and
optional params are included """
# uncomment below to create an instance of `ReadOnlyFirst`
"""
model = ReadOnlyFirst() # noqa: E501
if include_optional:
# model = petstore_api.models.read_only_first.ReadOnlyFirst() # noqa: E501
if include_optional :
return ReadOnlyFirst(
bar = '',
bar = '',
baz = ''
)
else:
else :
return ReadOnlyFirst(
)
"""
def testReadOnlyFirst(self):
"""Test ReadOnlyFirst"""

View File

@@ -3,19 +3,23 @@
"""
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: \" \\
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 OpenAPI Generator (https://openapi-generator.tech)
Do not edit the class manually.
""" # noqa: E501
"""
from __future__ import absolute_import
import unittest
import datetime
import petstore_api
from petstore_api.models.second_ref import SecondRef # noqa: E501
from petstore_api.rest import ApiException
class TestSecondRef(unittest.TestCase):
"""SecondRef unit test stubs"""
@@ -26,17 +30,17 @@ class TestSecondRef(unittest.TestCase):
def tearDown(self):
pass
def make_instance(self, include_optional) -> SecondRef:
def make_instance(self, include_optional):
"""Test SecondRef
include_option is a boolean, when False only required
params are included, when True both required and
optional params are included """
# uncomment below to create an instance of `SecondRef`
"""
model = SecondRef() # noqa: E501
if include_optional:
model = petstore_api.models.second_ref.SecondRef() # noqa: E501
if include_optional :
return SecondRef(
category = '',
category = '',
circular_ref = petstore_api.models.circular_reference_model.Circular-Reference-Model(
size = 56,
nested = petstore_api.models.first_ref.FirstRef(
@@ -44,7 +48,7 @@ class TestSecondRef(unittest.TestCase):
self_ref = petstore_api.models.second_ref.SecondRef(
category = '', ), ), )
)
else:
else :
return SecondRef(
)
"""

View File

@@ -3,19 +3,21 @@
"""
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: \" \\
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 OpenAPI Generator (https://openapi-generator.tech)
Generated by: https://openapi-generator.tech
"""
Do not edit the class manually.
""" # noqa: E501
from __future__ import absolute_import
import unittest
import datetime
import petstore_api
from petstore_api.models.self_reference_model import SelfReferenceModel # noqa: E501
from petstore_api.rest import ApiException
class TestSelfReferenceModel(unittest.TestCase):
"""SelfReferenceModel unit test stubs"""
@@ -26,17 +28,17 @@ class TestSelfReferenceModel(unittest.TestCase):
def tearDown(self):
pass
def make_instance(self, include_optional) -> SelfReferenceModel:
def make_instance(self, include_optional):
"""Test SelfReferenceModel
include_option is a boolean, when False only required
params are included, when True both required and
optional params are included """
# uncomment below to create an instance of `SelfReferenceModel`
"""
model = SelfReferenceModel() # noqa: E501
if include_optional:
model = petstore_api.models.self_reference_model.SelfReferenceModel() # noqa: E501
if include_optional :
return SelfReferenceModel(
size = 56,
size = 56,
nested = petstore_api.models.dummy_model.Dummy-Model(
category = '',
self_ref = petstore_api.models.self_reference_model.Self-Reference-Model(
@@ -44,7 +46,7 @@ class TestSelfReferenceModel(unittest.TestCase):
nested = petstore_api.models.dummy_model.Dummy-Model(
category = '', ), ), )
)
else:
else :
return SelfReferenceModel(
)
"""

View File

@@ -3,19 +3,21 @@
"""
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: \" \\
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 OpenAPI Generator (https://openapi-generator.tech)
Generated by: https://openapi-generator.tech
"""
Do not edit the class manually.
""" # noqa: E501
from __future__ import absolute_import
import unittest
import datetime
import petstore_api
from petstore_api.models.single_ref_type import SingleRefType # noqa: E501
from petstore_api.rest import ApiException
class TestSingleRefType(unittest.TestCase):
"""SingleRefType unit test stubs"""

View File

@@ -3,19 +3,21 @@
"""
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: \" \\
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 OpenAPI Generator (https://openapi-generator.tech)
Generated by: https://openapi-generator.tech
"""
Do not edit the class manually.
""" # noqa: E501
from __future__ import absolute_import
import unittest
import datetime
import petstore_api
from petstore_api.models.special_character_enum import SpecialCharacterEnum # noqa: E501
from petstore_api.rest import ApiException
class TestSpecialCharacterEnum(unittest.TestCase):
"""SpecialCharacterEnum unit test stubs"""

View File

@@ -3,19 +3,21 @@
"""
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: \" \\
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 OpenAPI Generator (https://openapi-generator.tech)
Generated by: https://openapi-generator.tech
"""
Do not edit the class manually.
""" # noqa: E501
from __future__ import absolute_import
import unittest
import datetime
import petstore_api
from petstore_api.models.special_model_name import SpecialModelName # noqa: E501
from petstore_api.rest import ApiException
class TestSpecialModelName(unittest.TestCase):
"""SpecialModelName unit test stubs"""
@@ -26,22 +28,19 @@ class TestSpecialModelName(unittest.TestCase):
def tearDown(self):
pass
def make_instance(self, include_optional) -> SpecialModelName:
def make_instance(self, include_optional):
"""Test SpecialModelName
include_option is a boolean, when False only required
params are included, when True both required and
optional params are included """
# uncomment below to create an instance of `SpecialModelName`
"""
model = SpecialModelName() # noqa: E501
if include_optional:
# model = petstore_api.models.special_model_name.SpecialModelName() # noqa: E501
if include_optional :
return SpecialModelName(
special_property_name = 56
)
else:
else :
return SpecialModelName(
)
"""
def testSpecialModelName(self):
"""Test SpecialModelName"""

View File

@@ -3,19 +3,21 @@
"""
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: \" \\
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 OpenAPI Generator (https://openapi-generator.tech)
Generated by: https://openapi-generator.tech
"""
Do not edit the class manually.
""" # noqa: E501
from __future__ import absolute_import
import unittest
import datetime
import petstore_api
from petstore_api.models.special_name import SpecialName # noqa: E501
from petstore_api.rest import ApiException
class TestSpecialName(unittest.TestCase):
"""SpecialName unit test stubs"""
@@ -26,23 +28,23 @@ class TestSpecialName(unittest.TestCase):
def tearDown(self):
pass
def make_instance(self, include_optional) -> SpecialName:
def make_instance(self, include_optional):
"""Test SpecialName
include_option is a boolean, when False only required
params are included, when True both required and
optional params are included """
# uncomment below to create an instance of `SpecialName`
"""
model = SpecialName() # noqa: E501
if include_optional:
model = petstore_api.models.special_name.SpecialName() # noqa: E501
if include_optional :
return SpecialName(
var_property = 56,
var_property = 56,
var_async = petstore_api.models.category.Category(
id = 56,
name = 'default-name', ),
name = 'default-name', ),
var_schema = 'available'
)
else:
else :
return SpecialName(
)
"""

View File

@@ -3,51 +3,53 @@
"""
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: \" \\
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 OpenAPI Generator (https://openapi-generator.tech)
Generated by: https://openapi-generator.tech
"""
Do not edit the class manually.
""" # noqa: E501
from __future__ import absolute_import
import unittest
import petstore_api
from petstore_api.api.store_api import StoreApi # noqa: E501
from petstore_api.rest import ApiException
class TestStoreApi(unittest.TestCase):
"""StoreApi unit test stubs"""
def setUp(self) -> None:
self.api = StoreApi() # noqa: E501
def setUp(self):
self.api = petstore_api.api.store_api.StoreApi() # noqa: E501
def tearDown(self) -> None:
def tearDown(self):
pass
def test_delete_order(self) -> None:
def test_delete_order(self):
"""Test case for delete_order
Delete purchase order by ID # noqa: E501
"""
pass
def test_get_inventory(self) -> None:
def test_get_inventory(self):
"""Test case for get_inventory
Returns pet inventories by status # noqa: E501
"""
pass
def test_get_order_by_id(self) -> None:
def test_get_order_by_id(self):
"""Test case for get_order_by_id
Find purchase order by ID # noqa: E501
"""
pass
def test_place_order(self) -> None:
def test_place_order(self):
"""Test case for place_order
Place an order for a pet # noqa: E501

View File

@@ -3,19 +3,21 @@
"""
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: \" \\
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 OpenAPI Generator (https://openapi-generator.tech)
Generated by: https://openapi-generator.tech
"""
Do not edit the class manually.
""" # noqa: E501
from __future__ import absolute_import
import unittest
import datetime
import petstore_api
from petstore_api.models.tag import Tag # noqa: E501
from petstore_api.rest import ApiException
class TestTag(unittest.TestCase):
"""Tag unit test stubs"""
@@ -26,23 +28,20 @@ class TestTag(unittest.TestCase):
def tearDown(self):
pass
def make_instance(self, include_optional) -> Tag:
def make_instance(self, include_optional):
"""Test Tag
include_option is a boolean, when False only required
params are included, when True both required and
optional params are included """
# uncomment below to create an instance of `Tag`
"""
model = Tag() # noqa: E501
if include_optional:
# model = petstore_api.models.tag.Tag() # noqa: E501
if include_optional :
return Tag(
id = 56,
id = 56,
name = ''
)
else:
else :
return Tag(
)
"""
def testTag(self):
"""Test Tag"""

View File

@@ -3,19 +3,21 @@
"""
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: \" \\
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 OpenAPI Generator (https://openapi-generator.tech)
Do not edit the class manually.
""" # noqa: E501
"""
import unittest
import datetime
import petstore_api
from petstore_api.models.tiger import Tiger # noqa: E501
from petstore_api.rest import ApiException
class TestTiger(unittest.TestCase):
"""Tiger unit test stubs"""
@@ -26,19 +28,19 @@ class TestTiger(unittest.TestCase):
def tearDown(self):
pass
def make_instance(self, include_optional) -> Tiger:
def make_instance(self, include_optional):
"""Test Tiger
include_option is a boolean, when False only required
params are included, when True both required and
optional params are included """
# uncomment below to create an instance of `Tiger`
"""
model = Tiger() # noqa: E501
if include_optional:
model = petstore_api.models.tiger.Tiger() # noqa: E501
if include_optional :
return Tiger(
skill = ''
)
else:
else :
return Tiger(
)
"""

View File

@@ -3,19 +3,21 @@
"""
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: \" \\
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 OpenAPI Generator (https://openapi-generator.tech)
Generated by: https://openapi-generator.tech
"""
Do not edit the class manually.
""" # noqa: E501
from __future__ import absolute_import
import unittest
import datetime
import petstore_api
from petstore_api.models.user import User # noqa: E501
from petstore_api.rest import ApiException
class TestUser(unittest.TestCase):
"""User unit test stubs"""
@@ -26,29 +28,26 @@ class TestUser(unittest.TestCase):
def tearDown(self):
pass
def make_instance(self, include_optional) -> User:
def make_instance(self, include_optional):
"""Test User
include_option is a boolean, when False only required
params are included, when True both required and
optional params are included """
# uncomment below to create an instance of `User`
"""
model = User() # noqa: E501
if include_optional:
# model = petstore_api.models.user.User() # noqa: E501
if include_optional :
return User(
id = 56,
username = '',
first_name = '',
last_name = '',
email = '',
password = '',
phone = '',
id = 56,
username = '',
first_name = '',
last_name = '',
email = '',
password = '',
phone = '',
user_status = 56
)
else:
else :
return User(
)
"""
def testUser(self):
"""Test User"""

View File

@@ -3,79 +3,81 @@
"""
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: \" \\
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 OpenAPI Generator (https://openapi-generator.tech)
Generated by: https://openapi-generator.tech
"""
Do not edit the class manually.
""" # noqa: E501
from __future__ import absolute_import
import unittest
import petstore_api
from petstore_api.api.user_api import UserApi # noqa: E501
from petstore_api.rest import ApiException
class TestUserApi(unittest.TestCase):
"""UserApi unit test stubs"""
def setUp(self) -> None:
self.api = UserApi() # noqa: E501
def setUp(self):
self.api = petstore_api.api.user_api.UserApi() # noqa: E501
def tearDown(self) -> None:
def tearDown(self):
pass
def test_create_user(self) -> None:
def test_create_user(self):
"""Test case for create_user
Create user # noqa: E501
"""
pass
def test_create_users_with_array_input(self) -> None:
def test_create_users_with_array_input(self):
"""Test case for create_users_with_array_input
Creates list of users with given input array # noqa: E501
"""
pass
def test_create_users_with_list_input(self) -> None:
def test_create_users_with_list_input(self):
"""Test case for create_users_with_list_input
Creates list of users with given input array # noqa: E501
"""
pass
def test_delete_user(self) -> None:
def test_delete_user(self):
"""Test case for delete_user
Delete user # noqa: E501
"""
pass
def test_get_user_by_name(self) -> None:
def test_get_user_by_name(self):
"""Test case for get_user_by_name
Get user by user name # noqa: E501
"""
pass
def test_login_user(self) -> None:
def test_login_user(self):
"""Test case for login_user
Logs user into the system # noqa: E501
"""
pass
def test_logout_user(self) -> None:
def test_logout_user(self):
"""Test case for logout_user
Logs out current logged in user session # noqa: E501
"""
pass
def test_update_user(self) -> None:
def test_update_user(self):
"""Test case for update_user
Updated user # noqa: E501

View File

@@ -3,19 +3,21 @@
"""
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: \" \\
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 OpenAPI Generator (https://openapi-generator.tech)
Generated by: https://openapi-generator.tech
"""
Do not edit the class manually.
""" # noqa: E501
from __future__ import absolute_import
import unittest
import datetime
import petstore_api
from petstore_api.models.with_nested_one_of import WithNestedOneOf # noqa: E501
from petstore_api.rest import ApiException
class TestWithNestedOneOf(unittest.TestCase):
"""WithNestedOneOf unit test stubs"""
@@ -26,24 +28,20 @@ class TestWithNestedOneOf(unittest.TestCase):
def tearDown(self):
pass
def make_instance(self, include_optional) -> WithNestedOneOf:
def make_instance(self, include_optional):
"""Test WithNestedOneOf
include_option is a boolean, when False only required
params are included, when True both required and
optional params are included """
# uncomment below to create an instance of `WithNestedOneOf`
"""
model = WithNestedOneOf() # noqa: E501
if include_optional:
# model = petstore_api.models.with_nested_one_of.WithNestedOneOf() # noqa: E501
if include_optional :
return WithNestedOneOf(
size = 56,
nested_pig = None,
nested_oneof_enum_string = None
size = 56,
nested_pig = None
)
else:
else :
return WithNestedOneOf(
)
"""
def testWithNestedOneOf(self):
"""Test WithNestedOneOf"""

View File

@@ -0,0 +1,31 @@
#!/bin/bash
REQUIREMENTS_FILE=dev-requirements.txt
REQUIREMENTS_OUT=dev-requirements.txt.log
SETUP_OUT=*.egg-info
VENV=.venv
DEACTIVE=false
export LC_ALL=en_US.UTF-8
export LANG=en_US.UTF-8
### set virtualenv
if [ -z "$VIRTUAL_ENV" ]; then
virtualenv $VENV --always-copy
source $VENV/bin/activate
DEACTIVE=true
fi
### install dependencies
pip install -r $REQUIREMENTS_FILE | tee -a $REQUIREMENTS_OUT
### run tests
tox || exit 1
### static analysis of code
#flake8 --show-source petstore_api/
### deactivate virtualenv
#if [ $DEACTIVE == true ]; then
# deactivate
#fi

Binary file not shown.

After

Width:  |  Height:  |  Size: 42 KiB

View File

@@ -0,0 +1,22 @@
# coding: utf-8
# flake8: noqa
import unittest
import weakref
from tests.util import async_test
import petstore_api
class TestApiClient(unittest.TestCase):
@async_test
async def test_context_manager_closes_client(self):
async with petstore_api.ApiClient() as client:
# pool_manager
self.assertFalse(client.rest_client.pool_manager.closed)
rest_pool_ref = client.rest_client.pool_manager
self.assertTrue(rest_pool_ref.closed)

View File

@@ -0,0 +1,237 @@
# coding: utf-8
# flake8: noqa
import os
import time
import unittest
import petstore_api
class ModelTests(unittest.TestCase):
def setUp(self):
self.pet = petstore_api.Pet(name="test name", photo_urls=["string"])
self.pet.id = 1
self.pet.status = "available"
cate = petstore_api.Category(name="dog")
cate.id = 1
cate.name = "dog"
self.pet.category = cate
tag = petstore_api.Tag()
tag.id = 1
self.pet.tags = [tag]
def test_cat(self):
self.cat = petstore_api.Cat(class_name="cat")
self.assertEqual("cat", self.cat.class_name)
self.assertEqual("red", self.cat.color)
cat_str = "{'className': 'cat', 'color': 'red', 'declawed': None}"
self.assertEqual(cat_str, self.cat.to_str())
def test_to_str(self):
data = ("{'category': {'id': 1, 'name': 'dog'},\n"
" 'id': 1,\n"
" 'name': 'test name',\n"
" 'photoUrls': ['string'],\n"
" 'status': 'available',\n"
" 'tags': [{'id': 1, 'name': None}]}")
self.assertEqual(data, self.pet.to_str())
def test_equal(self):
self.pet1 = petstore_api.Pet(name="test name", photo_urls=["string"])
self.pet1.id = 1
self.pet1.status = "available"
cate1 = petstore_api.Category(name="dog")
cate1.id = 1
# cate1.name = "dog"
self.pet.category = cate1
tag1 = petstore_api.Tag()
tag1.id = 1
self.pet1.tags = [tag1]
self.pet2 = petstore_api.Pet(name="test name", photo_urls=["string"])
self.pet2.id = 1
self.pet2.status = "available"
cate2 = petstore_api.Category(name="dog")
cate2.id = 1
cate2.name = "dog"
self.pet.category = cate2
tag2 = petstore_api.Tag()
tag2.id = 1
self.pet2.tags = [tag2]
self.assertTrue(self.pet1 == self.pet2)
# reset pet1 tags to empty array so that object comparison returns false
self.pet1.tags = []
self.assertFalse(self.pet1 == self.pet2)
def test_oneOf(self):
# test new Pig
new_pig = petstore_api.Pig()
self.assertEqual("null", new_pig.to_json())
self.assertEqual(None, new_pig.actual_instance)
# test from_json
json_str = '{"className": "BasquePig", "color": "red"}'
p = petstore_api.Pig.from_json(json_str)
self.assertIsInstance(p.actual_instance, petstore_api.BasquePig)
# test init
basque_pig = p.actual_instance
pig2 = petstore_api.Pig(actual_instance=basque_pig)
self.assertIsInstance(pig2.actual_instance, petstore_api.BasquePig)
# test failed init
try:
pig3 = petstore_api.Pig(actual_instance="123")
self.assertTrue(False) # this line shouldn't execute
except ValueError as e:
self.assertTrue(
"No match found when setting `actual_instance` in Pig with oneOf schemas: BasquePig, DanishPig" in str(e))
# failure
try:
p2 = petstore_api.Pig.from_json("1")
self.assertTrue(False) # this line shouldn't execute
except ValueError as e:
error_message = (
"No match found when deserializing the JSON string into Pig with oneOf schemas: BasquePig, DanishPig. "
"Details: 1 validation error for BasquePig\n"
"__root__\n"
" BasquePig expected dict not int (type=type_error), 1 validation error for DanishPig\n"
"__root__\n"
" DanishPig expected dict not int (type=type_error)")
self.assertEqual(str(e), error_message)
# test to_json
self.assertEqual(p.to_json(), '{"className": "BasquePig", "color": "red"}')
# test nested property
nested = petstore_api.WithNestedOneOf(size = 1, nested_pig = p)
self.assertEqual(nested.to_json(), '{"size": 1, "nested_pig": {"className": "BasquePig", "color": "red"}}')
nested_json = nested.to_json()
nested2 = petstore_api.WithNestedOneOf.from_json(nested_json)
self.assertEqual(nested2.to_json(), nested_json)
def test_anyOf(self):
# test new AnyOfPig
new_anypig = petstore_api.AnyOfPig()
self.assertEqual("null", new_anypig.to_json())
self.assertEqual(None, new_anypig.actual_instance)
# test from_json
json_str = '{"className": "BasquePig", "color": "red"}'
p = petstore_api.AnyOfPig.from_json(json_str)
self.assertIsInstance(p.actual_instance, petstore_api.BasquePig)
# test init
basque_pig = p.actual_instance
pig2 = petstore_api.Pig(actual_instance=basque_pig)
self.assertIsInstance(pig2.actual_instance, petstore_api.BasquePig)
# test failed init
try:
pig3 = petstore_api.AnyOfPig(actual_instance="123")
self.assertTrue(False) # this line shouldn't execute
except ValueError as e:
self.assertTrue(
"No match found when setting the actual_instance in AnyOfPig with anyOf schemas: BasquePig, "
"DanishPig" in str(e))
# failure
try:
p2 = petstore_api.AnyOfPig.from_json("1")
self.assertTrue(False) # this line shouldn't execute
except ValueError as e:
error_message = (
"No match found when deserializing the JSON string into AnyOfPig with anyOf schemas: BasquePig, "
"DanishPig. Details: 1 validation error for BasquePig\n"
"__root__\n"
" BasquePig expected dict not int (type=type_error), 1 validation error for DanishPig\n"
"__root__\n"
" DanishPig expected dict not int (type=type_error)")
self.assertEqual(str(e), error_message)
# test to_json
self.assertEqual(p.to_json(), '{"className": "BasquePig", "color": "red"}')
def test_inheritance(self):
dog = petstore_api.Dog(breed="bulldog", className="dog", color="white")
self.assertEqual(dog.to_json(), '{"className": "dog", "color": "white", "breed": "bulldog"}')
self.assertEqual(dog.to_dict(), {'breed': 'bulldog', 'className':
'dog', 'color': 'white'})
dog2 = petstore_api.Dog.from_json(dog.to_json())
self.assertEqual(dog2.breed, 'bulldog')
self.assertEqual(dog2.class_name, "dog")
self.assertEqual(dog2.color, 'white')
def test_list(self):
# should throw exception as var_123_list should be string
try:
l3 = petstore_api.List(var_123_list=123)
self.assertTrue(False) # this line shouldn't execute
except ValueError as e:
#error_message = (
# "1 validation error for List\n"
# "123-list\n"
# " str type expected (type=type_error.str)\n")
self.assertTrue("str type expected" in str(e))
l = petstore_api.List(var_123_list="bulldog")
self.assertEqual(l.to_json(), '{"123-list": "bulldog"}')
self.assertEqual(l.to_dict(), {'123-list': 'bulldog'})
l2 = petstore_api.List.from_json(l.to_json())
self.assertEqual(l2.var_123_list, 'bulldog')
self.assertTrue(isinstance(l2, petstore_api.List))
def test_enum_ref_property(self):
# test enum ref property
# test to_json
d = petstore_api.OuterObjectWithEnumProperty(value=petstore_api.OuterEnumInteger.NUMBER_1)
self.assertEqual(d.to_json(), '{"value": 1}')
d2 = petstore_api.OuterObjectWithEnumProperty(value=petstore_api.OuterEnumInteger.NUMBER_1, str_value=petstore_api.OuterEnum.DELIVERED)
self.assertEqual(d2.to_json(), '{"str_value": "delivered", "value": 1}')
# test from_json (round trip)
d3 = petstore_api.OuterObjectWithEnumProperty.from_json(d2.to_json())
self.assertEqual(d3.str_value, petstore_api.OuterEnum.DELIVERED)
self.assertEqual(d3.value, petstore_api.OuterEnumInteger.NUMBER_1)
self.assertEqual(d3.to_json(), '{"str_value": "delivered", "value": 1}')
def test_float_strict_type(self):
# assigning 123 to float shouldn't throw an exception
a = petstore_api.FormatTest(number=39.8, float=123, byte=bytes("string", 'utf-8'), date="2013-09-17", password="testing09876")
self.assertEqual(a.float, 123.0)
json_str = "{\"number\": 34.5, \"float\": \"456\", \"date\": \"2013-12-08\", \"password\": \"empty1234567\", \"pattern_with_digits\": \"1234567890\", \"pattern_with_digits_and_delimiter\": \"image_123\", \"string_with_double_quote_pattern\": \"this is \\\"something\\\"\", \"string\": \"string\"}"
# no exception thrown when assigning 456 (integer) to float type since strict is set to false
f = petstore_api.FormatTest.from_json(json_str)
self.assertEqual(f.float, 456.0)
def test_valdiator(self):
# test regular expression
a = petstore_api.FormatTest(number=123.45, byte=bytes("string", 'utf-8'), date="2013-09-17", password="testing09876")
try:
a.pattern_with_digits_and_delimiter = "123"
self.assertTrue(False) # this line shouldn't execute
except ValueError as e:
self.assertTrue(r"must validate the regular expression /^image_\d{1,3}$/i" in str(e))
a.pattern_with_digits_and_delimiter = "IMAGE_123"
self.assertEqual(a.pattern_with_digits_and_delimiter, "IMAGE_123")
a.pattern_with_digits_and_delimiter = "image_123"
self.assertEqual(a.pattern_with_digits_and_delimiter, "image_123")
def test_inline_enum_validator(self):
self.pet = petstore_api.Pet(name="test name", photo_urls=["string"])
self.pet.id = 1
try:
self.pet.status = "error"
self.assertTrue(False) # this line shouldn't execute
except ValueError as e:
self.assertTrue("must be one of enum values ('available', 'pending', 'sold')" in str(e))

View File

@@ -0,0 +1,208 @@
# coding: utf-8
# flake8: noqa
"""
Run the tests.
$ docker pull swaggerapi/petstore
$ docker run -d -e SWAGGER_HOST=http://petstore.swagger.io -e SWAGGER_BASE_PATH=/v2 -p 80:8080 swaggerapi/petstore
$ pytest -vv
"""
import os
import unittest
import asyncio
import pytest
import petstore_api
from petstore_api import Configuration
from petstore_api.rest import ApiException
from .util import id_gen, async_test
import json
import urllib3
HOST = 'http://localhost:80/v2'
class TestPetApiTests(unittest.TestCase):
def setUp(self):
config = Configuration()
config.host = HOST
self.api_client = petstore_api.ApiClient(config)
self.pet_api = petstore_api.PetApi(self.api_client)
self.setUpModels()
self.setUpFiles()
def setUpModels(self):
self.category = petstore_api.Category(id=id_gen(), name="dog")
#self.category.id = id_gen()
#self.category.name = "dog"
self.tag = petstore_api.Tag()
self.tag.id = id_gen()
self.tag.name = "openapi-generator-python-pet-tag"
self.pet = petstore_api.Pet(name="hello kity", photo_urls=["http://foo.bar.com/1", "http://foo.bar.com/2"])
self.pet.id = id_gen()
self.pet.status = "sold"
self.pet.category = self.category
self.pet.tags = [self.tag]
def setUpFiles(self):
self.test_file_dir = os.path.join(os.path.dirname(__file__), "..", "testfiles")
self.test_file_dir = os.path.realpath(self.test_file_dir)
self.foo = os.path.join(self.test_file_dir, "foo.png")
def test_separate_default_client_instances(self):
pet_api = petstore_api.PetApi()
pet_api2 = petstore_api.PetApi()
self.assertEqual(id(pet_api.api_client), id(pet_api2.api_client))
def test_separate_default_config_instances(self):
pet_api = petstore_api.PetApi()
pet_api2 = petstore_api.PetApi()
self.assertEqual(id(pet_api.api_client.configuration), id(pet_api2.api_client.configuration))
@async_test
async def test_async_with_result(self):
await self.pet_api.add_pet(self.pet)
tasks = [
asyncio.create_task(coro)
for coro in [
self.pet_api.get_pet_by_id(self.pet.id),
self.pet_api.get_pet_by_id(self.pet.id),
]
]
responses = await asyncio.gather(*tasks)
for response in responses:
self.assertEqual(response.id, self.pet.id)
self.assertEqual(len(responses), 2)
@async_test
async def test_exception(self):
await self.pet_api.add_pet(self.pet)
try:
await self.pet_api.get_pet_by_id(9999999999999)
except ApiException as e:
exception = e
self.assertIsInstance(exception, ApiException)
self.assertEqual(exception.status, 404)
@async_test
async def test_add_pet_and_get_pet_by_id(self):
await self.pet_api.add_pet(self.pet)
fetched = await self.pet_api.get_pet_by_id(pet_id=self.pet.id)
self.assertIsNotNone(fetched)
self.assertEqual(self.pet.id, fetched.id)
self.assertIsNotNone(fetched.category)
self.assertEqual(self.pet.category.name, fetched.category.name)
@async_test
async def test_add_pet_and_get_pet_by_id_with_http_info(self):
await self.pet_api.add_pet(self.pet)
fetched = await self.pet_api.get_pet_by_id_with_http_info(pet_id=self.pet.id)
self.assertIsNotNone(fetched)
self.assertEqual(self.pet.id, fetched.data.id)
self.assertIsNotNone(fetched.data.category)
self.assertEqual(self.pet.category.name, fetched.data.category.name)
@async_test
async def test_update_pet(self):
self.pet.name = "hello kity with updated"
await self.pet_api.update_pet(self.pet)
fetched = await self.pet_api.get_pet_by_id(pet_id=self.pet.id)
self.assertIsNotNone(fetched)
self.assertEqual(self.pet.id, fetched.id)
self.assertEqual(self.pet.name, fetched.name)
self.assertIsNotNone(fetched.category)
self.assertEqual(fetched.category.name, self.pet.category.name)
@async_test
async def test_find_pets_by_status(self):
await self.pet_api.add_pet(self.pet)
pets = await self.pet_api.find_pets_by_status(status=[self.pet.status])
self.assertIn(
self.pet.id,
list(map(lambda x: getattr(x, 'id'), pets))
)
@async_test
async def test_find_pets_by_tags(self):
await self.pet_api.add_pet(self.pet)
pets = await self.pet_api.find_pets_by_tags(tags=[self.tag.name])
self.assertIn(
self.pet.id,
list(map(lambda x: getattr(x, 'id'), pets))
)
@async_test
async def test_update_pet_with_form(self):
await self.pet_api.add_pet(self.pet)
name = "hello kity with form updated"
status = "pending"
await self.pet_api.update_pet_with_form(pet_id=self.pet.id, name=name, status=status)
fetched = await self.pet_api.get_pet_by_id(pet_id=self.pet.id)
self.assertEqual(self.pet.id, fetched.id)
self.assertEqual(name, fetched.name)
self.assertEqual(status, fetched.status)
@async_test
async def test_upload_file(self):
# upload file with form parameter
try:
additional_metadata = "special"
await self.pet_api.upload_file(
pet_id=self.pet.id,
additional_metadata=additional_metadata,
file=self.foo
)
except ApiException as e:
self.fail("upload_file() raised {0} unexpectedly".format(type(e)))
# upload only file
try:
await self.pet_api.upload_file(pet_id=self.pet.id, file=self.foo)
except ApiException as e:
self.fail("upload_file() raised {0} unexpectedly".format(type(e)))
@async_test
async def test_delete_pet(self):
await self.pet_api.add_pet(self.pet)
await self.pet_api.delete_pet(pet_id=self.pet.id, api_key="special-key")
try:
await self.pet_api.get_pet_by_id(pet_id=self.pet.id)
raise Exception("expected an error")
except ApiException as e:
self.assertEqual(404, e.status)
@async_test
async def test_proxy(self):
config = Configuration()
# set not-existent proxy and catch an error to verify that
# the client library (aiohttp) tried to use it.
config.proxy = 'http://localhost:8080/proxy'
async with petstore_api.ApiClient(config) as client:
pet_api = petstore_api.PetApi(client)
with self.assertRaisesRegex(petstore_api.rest.aiohttp.client_exceptions.ClientProxyConnectionError,
'Cannot connect to host localhost:8080'):
await pet_api.get_pet_by_id(self.pet.id)
if __name__ == '__main__':
import logging
logging.basicConfig(level=logging.DEBUG)
unittest.main()

View File

@@ -0,0 +1,114 @@
# coding: utf-8
# flake8: noqa
import os
import time
import unittest
import petstore_api
import json
from pydantic import ValidationError
class PetModelTests(unittest.TestCase):
def setUp(self):
self.pet = petstore_api.Pet(name="test name", photo_urls=["string"])
self.pet.id = 1
self.pet.status = "available"
cate = petstore_api.Category(name="dog")
cate.id = 1
# cate.name = "dog"
self.pet.category = cate
tag = petstore_api.Tag()
tag.id = 1
self.pet.tags = [tag]
def test_to_str(self):
data = ("{'category': {'id': 1, 'name': 'dog'},\n"
" 'id': 1,\n"
" 'name': 'test name',\n"
" 'photoUrls': ['string'],\n"
" 'status': 'available',\n"
" 'tags': [{'id': 1, 'name': None}]}")
self.assertEqual(data, self.pet.to_str())
def test_equal(self):
self.pet1 = petstore_api.Pet(name="test name", photo_urls=["string"])
self.pet1.id = 1
self.pet1.status = "available"
cate1 = petstore_api.Category(name="dog")
cate1.id = 1
# cate1.name = "dog"
self.pet.category = cate1
tag1 = petstore_api.Tag()
tag1.id = 1
self.pet1.tags = [tag1]
self.pet2 = petstore_api.Pet(name="test name", photo_urls=["string"])
self.pet2.id = 1
self.pet2.status = "available"
cate2 = petstore_api.Category(name="dog")
cate2.id = 1
# cate2.name = "dog"
self.pet.category = cate2
tag2 = petstore_api.Tag()
tag2.id = 1
self.pet2.tags = [tag2]
self.assertTrue(self.pet1 == self.pet2)
# reset pet1 tags to empty array so that object comparison returns false
self.pet1.tags = []
self.assertFalse(self.pet1 == self.pet2)
# test from_json, to_json, to_dict, from_dict
def test_from_to_methods(self):
json_str = ("{\"category\": {\"id\": 1, \"name\": \"dog\"},\n"
" \"id\": 1,\n"
" \"name\": \"test name\",\n"
" \"photoUrls\": [\"string\"],\n"
" \"status\": \"available\",\n"
" \"tags\": [{\"id\": 1, \"name\": \"None\"}]}")
pet = petstore_api.Pet.from_json(json_str)
self.assertEqual(pet.id, 1)
self.assertEqual(pet.status, "available")
self.assertEqual(pet.photo_urls, ["string"])
self.assertEqual(pet.tags[0].id, 1)
self.assertEqual(pet.tags[0].name, "None")
self.assertEqual(pet.category.id, 1)
# test to_json
self.assertEqual(pet.to_json(),
'{"id": 1, "category": {"id": 1, "name": "dog"}, "name": "test name", "photoUrls": ['
'"string"], "tags": [{"id": 1, "name": "None"}], "status": "available"}')
# test to_dict
self.assertEqual(pet.to_dict(),
{"id": 1, "category": {"id": 1, "name": "dog"}, "name": "test name", "photoUrls": ["string"],
"tags": [{"id": 1, "name": "None"}], "status": "available"})
# test from_dict
pet2 = petstore_api.Pet.from_dict(pet.to_dict())
self.assertEqual(pet2.id, 1)
self.assertEqual(pet2.status, "available")
self.assertEqual(pet2.photo_urls, ["string"])
self.assertEqual(pet2.tags[0].id, 1)
self.assertEqual(pet2.tags[0].name, "None")
self.assertEqual(pet2.category.id, 1)
def test_unpack_operator(self):
d = {"name": "required name", "id": 123, "photoUrls": ["https://a.com", "https://b.com"]}
pet = petstore_api.Pet(**d)
self.assertEqual(pet.to_json(), '{"id": 123, "name": "required name", "photoUrls": ["https://a.com", "https://b.com"]}')
self.assertEqual(pet.to_dict(), {"id": 123, "name": "required name", "photoUrls": ["https://a.com", "https://b.com"]})
def test_optional_fields(self):
pet = petstore_api.Pet(name="required name",
photoUrls=["https://a.com",
"https://b.com"])
self.assertEqual(pet.to_json(), '{"name": "required name", "photoUrls": ["https://a.com", "https://b.com"]}')
self.assertEqual(pet.to_dict(), {"name": "required name", "photoUrls": ["https://a.com", "https://b.com"]})

View File

@@ -0,0 +1,19 @@
# flake8: noqa
import asyncio
import random
def id_gen(bits=32):
""" Returns a n-bit randomly generated int """
return int(random.getrandbits(bits))
def async_test(f):
def wrapper(*args, **kwargs):
# coro = asyncio.coroutine(f)
coro = f
future = coro(*args, **kwargs)
loop = asyncio.get_event_loop()
loop.run_until_complete(future)
return wrapper