Skip to content

Commit 185d476

Browse files
committed
update python tests
1 parent 6a0a4cb commit 185d476

File tree

110 files changed

+1360
-1358
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

110 files changed

+1360
-1358
lines changed

samples/openapi3/client/petstore/python/test/test_additional_properties_any_type.py

Lines changed: 8 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -3,21 +3,18 @@
33
"""
44
OpenAPI Petstore
55
6-
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
6+
This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\
77
88
The version of the OpenAPI document: 1.0.0
99
Generated by OpenAPI Generator (https://openapi-generator.tech)
1010
1111
Do not edit the class manually.
12-
"""
12+
""" # noqa: E501
1313

1414

1515
import unittest
16-
import datetime
1716

18-
import petstore_api
19-
from petstore_api.models.additional_properties_any_type import AdditionalPropertiesAnyType # noqa: E501
20-
from petstore_api.rest import ApiException
17+
from petstore_api.models.additional_properties_any_type import AdditionalPropertiesAnyType
2118

2219
class TestAdditionalPropertiesAnyType(unittest.TestCase):
2320
"""AdditionalPropertiesAnyType unit test stubs"""
@@ -28,19 +25,19 @@ def setUp(self):
2825
def tearDown(self):
2926
pass
3027

31-
def make_instance(self, include_optional):
28+
def make_instance(self, include_optional) -> AdditionalPropertiesAnyType:
3229
"""Test AdditionalPropertiesAnyType
33-
include_option is a boolean, when False only required
30+
include_optional is a boolean, when False only required
3431
params are included, when True both required and
3532
optional params are included """
3633
# uncomment below to create an instance of `AdditionalPropertiesAnyType`
3734
"""
38-
model = petstore_api.models.additional_properties_any_type.AdditionalPropertiesAnyType() # noqa: E501
39-
if include_optional :
35+
model = AdditionalPropertiesAnyType()
36+
if include_optional:
4037
return AdditionalPropertiesAnyType(
4138
name = ''
4239
)
43-
else :
40+
else:
4441
return AdditionalPropertiesAnyType(
4542
)
4643
"""

samples/openapi3/client/petstore/python/test/test_additional_properties_class.py

Lines changed: 9 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -3,21 +3,18 @@
33
"""
44
OpenAPI Petstore
55
6-
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
6+
This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\
77
88
The version of the OpenAPI document: 1.0.0
99
Generated by OpenAPI Generator (https://openapi-generator.tech)
1010
1111
Do not edit the class manually.
12-
"""
12+
""" # noqa: E501
1313

1414

1515
import unittest
16-
import datetime
1716

18-
import petstore_api
19-
from petstore_api.models.additional_properties_class import AdditionalPropertiesClass # noqa: E501
20-
from petstore_api.rest import ApiException
17+
from petstore_api.models.additional_properties_class import AdditionalPropertiesClass
2118

2219
class TestAdditionalPropertiesClass(unittest.TestCase):
2320
"""AdditionalPropertiesClass unit test stubs"""
@@ -28,26 +25,26 @@ def setUp(self):
2825
def tearDown(self):
2926
pass
3027

31-
def make_instance(self, include_optional):
28+
def make_instance(self, include_optional) -> AdditionalPropertiesClass:
3229
"""Test AdditionalPropertiesClass
33-
include_option is a boolean, when False only required
30+
include_optional is a boolean, when False only required
3431
params are included, when True both required and
3532
optional params are included """
3633
# uncomment below to create an instance of `AdditionalPropertiesClass`
3734
"""
38-
model = petstore_api.models.additional_properties_class.AdditionalPropertiesClass() # noqa: E501
39-
if include_optional :
35+
model = AdditionalPropertiesClass()
36+
if include_optional:
4037
return AdditionalPropertiesClass(
4138
map_property = {
4239
'key' : ''
43-
},
40+
},
4441
map_of_map_property = {
4542
'key' : {
4643
'key' : ''
4744
}
4845
}
4946
)
50-
else :
47+
else:
5148
return AdditionalPropertiesClass(
5249
)
5350
"""

samples/openapi3/client/petstore/python/test/test_additional_properties_object.py

Lines changed: 8 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -3,21 +3,18 @@
33
"""
44
OpenAPI Petstore
55
6-
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
6+
This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\
77
88
The version of the OpenAPI document: 1.0.0
99
Generated by OpenAPI Generator (https://openapi-generator.tech)
1010
1111
Do not edit the class manually.
12-
"""
12+
""" # noqa: E501
1313

1414

1515
import unittest
16-
import datetime
1716

18-
import petstore_api
19-
from petstore_api.models.additional_properties_object import AdditionalPropertiesObject # noqa: E501
20-
from petstore_api.rest import ApiException
17+
from petstore_api.models.additional_properties_object import AdditionalPropertiesObject
2118

2219
class TestAdditionalPropertiesObject(unittest.TestCase):
2320
"""AdditionalPropertiesObject unit test stubs"""
@@ -28,19 +25,19 @@ def setUp(self):
2825
def tearDown(self):
2926
pass
3027

31-
def make_instance(self, include_optional):
28+
def make_instance(self, include_optional) -> AdditionalPropertiesObject:
3229
"""Test AdditionalPropertiesObject
33-
include_option is a boolean, when False only required
30+
include_optional is a boolean, when False only required
3431
params are included, when True both required and
3532
optional params are included """
3633
# uncomment below to create an instance of `AdditionalPropertiesObject`
3734
"""
38-
model = petstore_api.models.additional_properties_object.AdditionalPropertiesObject() # noqa: E501
39-
if include_optional :
35+
model = AdditionalPropertiesObject()
36+
if include_optional:
4037
return AdditionalPropertiesObject(
4138
name = ''
4239
)
43-
else :
40+
else:
4441
return AdditionalPropertiesObject(
4542
)
4643
"""

samples/openapi3/client/petstore/python/test/test_additional_properties_with_description_only.py

Lines changed: 8 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -3,21 +3,18 @@
33
"""
44
OpenAPI Petstore
55
6-
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
6+
This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\
77
88
The version of the OpenAPI document: 1.0.0
99
Generated by OpenAPI Generator (https://openapi-generator.tech)
1010
1111
Do not edit the class manually.
12-
"""
12+
""" # noqa: E501
1313

1414

1515
import unittest
16-
import datetime
1716

18-
import petstore_api
19-
from petstore_api.models.additional_properties_with_description_only import AdditionalPropertiesWithDescriptionOnly # noqa: E501
20-
from petstore_api.rest import ApiException
17+
from petstore_api.models.additional_properties_with_description_only import AdditionalPropertiesWithDescriptionOnly
2118

2219
class TestAdditionalPropertiesWithDescriptionOnly(unittest.TestCase):
2320
"""AdditionalPropertiesWithDescriptionOnly unit test stubs"""
@@ -28,19 +25,19 @@ def setUp(self):
2825
def tearDown(self):
2926
pass
3027

31-
def make_instance(self, include_optional):
28+
def make_instance(self, include_optional) -> AdditionalPropertiesWithDescriptionOnly:
3229
"""Test AdditionalPropertiesWithDescriptionOnly
33-
include_option is a boolean, when False only required
30+
include_optional is a boolean, when False only required
3431
params are included, when True both required and
3532
optional params are included """
3633
# uncomment below to create an instance of `AdditionalPropertiesWithDescriptionOnly`
3734
"""
38-
model = petstore_api.models.additional_properties_with_description_only.AdditionalPropertiesWithDescriptionOnly() # noqa: E501
39-
if include_optional :
35+
model = AdditionalPropertiesWithDescriptionOnly()
36+
if include_optional:
4037
return AdditionalPropertiesWithDescriptionOnly(
4138
name = ''
4239
)
43-
else :
40+
else:
4441
return AdditionalPropertiesWithDescriptionOnly(
4542
)
4643
"""

samples/openapi3/client/petstore/python/test/test_all_of_super_model.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ def tearDown(self):
2727

2828
def make_instance(self, include_optional) -> AllOfSuperModel:
2929
"""Test AllOfSuperModel
30-
include_option is a boolean, when False only required
30+
include_optional is a boolean, when False only required
3131
params are included, when True both required and
3232
optional params are included """
3333
# uncomment below to create an instance of `AllOfSuperModel`

samples/openapi3/client/petstore/python/test/test_all_of_with_single_ref.py

Lines changed: 17 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -3,21 +3,18 @@
33
"""
44
OpenAPI Petstore
55
6-
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
6+
This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\
77
88
The version of the OpenAPI document: 1.0.0
9-
Generated by: https://openapi-generator.tech
10-
"""
9+
Generated by OpenAPI Generator (https://openapi-generator.tech)
1110
11+
Do not edit the class manually.
12+
""" # noqa: E501
1213

13-
from __future__ import absolute_import
1414

1515
import unittest
16-
import datetime
1716

18-
import petstore_api
19-
from petstore_api.models.all_of_with_single_ref import AllOfWithSingleRef # noqa: E501
20-
from petstore_api.rest import ApiException
17+
from petstore_api.models.all_of_with_single_ref import AllOfWithSingleRef
2118

2219
class TestAllOfWithSingleRef(unittest.TestCase):
2320
"""AllOfWithSingleRef unit test stubs"""
@@ -28,25 +25,28 @@ def setUp(self):
2825
def tearDown(self):
2926
pass
3027

31-
def make_instance(self, include_optional):
28+
def make_instance(self, include_optional) -> AllOfWithSingleRef:
3229
"""Test AllOfWithSingleRef
33-
include_option is a boolean, when False only required
30+
include_optional is a boolean, when False only required
3431
params are included, when True both required and
3532
optional params are included """
36-
# model = petstore_api.models.all_of_with_single_ref.AllOfWithSingleRef() # noqa: E501
37-
if include_optional :
33+
# uncomment below to create an instance of `AllOfWithSingleRef`
34+
"""
35+
model = AllOfWithSingleRef()
36+
if include_optional:
3837
return AllOfWithSingleRef(
39-
username = '',
40-
single_ref_type = None
38+
username = '',
39+
single_ref_type = 'admin'
4140
)
42-
else :
41+
else:
4342
return AllOfWithSingleRef(
4443
)
44+
"""
4545

4646
def testAllOfWithSingleRef(self):
4747
"""Test AllOfWithSingleRef"""
48-
inst_req_only = self.make_instance(include_optional=False)
49-
inst_req_and_optional = self.make_instance(include_optional=True)
48+
# inst_req_only = self.make_instance(include_optional=False)
49+
# inst_req_and_optional = self.make_instance(include_optional=True)
5050

5151
if __name__ == '__main__':
5252
unittest.main()

samples/openapi3/client/petstore/python/test/test_animal.py

Lines changed: 17 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -3,21 +3,18 @@
33
"""
44
OpenAPI Petstore
55
6-
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
6+
This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\
77
88
The version of the OpenAPI document: 1.0.0
9-
Generated by: https://openapi-generator.tech
10-
"""
9+
Generated by OpenAPI Generator (https://openapi-generator.tech)
1110
11+
Do not edit the class manually.
12+
""" # noqa: E501
1213

13-
from __future__ import absolute_import
1414

1515
import unittest
16-
import datetime
1716

18-
import petstore_api
19-
from petstore_api.models.animal import Animal # noqa: E501
20-
from petstore_api.rest import ApiException
17+
from petstore_api.models.animal import Animal
2118

2219
class TestAnimal(unittest.TestCase):
2320
"""Animal unit test stubs"""
@@ -28,26 +25,29 @@ def setUp(self):
2825
def tearDown(self):
2926
pass
3027

31-
def make_instance(self, include_optional):
28+
def make_instance(self, include_optional) -> Animal:
3229
"""Test Animal
33-
include_option is a boolean, when False only required
30+
include_optional is a boolean, when False only required
3431
params are included, when True both required and
3532
optional params are included """
36-
# model = petstore_api.models.animal.Animal() # noqa: E501
37-
if include_optional :
33+
# uncomment below to create an instance of `Animal`
34+
"""
35+
model = Animal()
36+
if include_optional:
3837
return Animal(
39-
className = '',
38+
class_name = '',
4039
color = 'red'
4140
)
42-
else :
41+
else:
4342
return Animal(
44-
className = '',
43+
class_name = '',
4544
)
45+
"""
4646

4747
def testAnimal(self):
4848
"""Test Animal"""
49-
inst_req_only = self.make_instance(include_optional=False)
50-
inst_req_and_optional = self.make_instance(include_optional=True)
49+
# inst_req_only = self.make_instance(include_optional=False)
50+
# inst_req_and_optional = self.make_instance(include_optional=True)
5151

5252
if __name__ == '__main__':
5353
unittest.main()

samples/openapi3/client/petstore/python/test/test_another_fake_api.py

Lines changed: 11 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -3,35 +3,33 @@
33
"""
44
OpenAPI Petstore
55
6-
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
6+
This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\
77
88
The version of the OpenAPI document: 1.0.0
9-
Generated by: https://openapi-generator.tech
10-
"""
9+
Generated by OpenAPI Generator (https://openapi-generator.tech)
1110
11+
Do not edit the class manually.
12+
""" # noqa: E501
1213

13-
from __future__ import absolute_import
1414

1515
import unittest
1616

17-
import petstore_api
18-
from petstore_api.api.another_fake_api import AnotherFakeApi # noqa: E501
19-
from petstore_api.rest import ApiException
17+
from petstore_api.api.another_fake_api import AnotherFakeApi
2018

2119

2220
class TestAnotherFakeApi(unittest.TestCase):
2321
"""AnotherFakeApi unit test stubs"""
2422

25-
def setUp(self):
26-
self.api = petstore_api.api.another_fake_api.AnotherFakeApi() # noqa: E501
23+
def setUp(self) -> None:
24+
self.api = AnotherFakeApi()
2725

28-
def tearDown(self):
29-
pass
26+
def tearDown(self) -> None:
27+
self.api.api_client.close()
3028

31-
def test_call_123_test_special_tags(self):
29+
def test_call_123_test_special_tags(self) -> None:
3230
"""Test case for call_123_test_special_tags
3331
34-
To test special tags # noqa: E501
32+
To test special tags
3533
"""
3634
pass
3735

0 commit comments

Comments
 (0)