Skip to content

Commit 6a0a4cb

Browse files
committed
update python tests
1 parent c2fcefd commit 6a0a4cb

19 files changed

+328
-286
lines changed

samples/client/echo_api/python/test/test_auth_api.py

Lines changed: 11 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -15,22 +15,29 @@
1515

1616
import unittest
1717

18-
from openapi_client.api.auth_api import AuthApi # noqa: E501
18+
from openapi_client.api.auth_api import AuthApi
1919

2020

2121
class TestAuthApi(unittest.TestCase):
2222
"""AuthApi unit test stubs"""
2323

2424
def setUp(self) -> None:
25-
self.api = AuthApi() # noqa: E501
25+
self.api = AuthApi()
2626

2727
def tearDown(self) -> None:
28-
pass
28+
self.api.api_client.close()
2929

3030
def test_test_auth_http_basic(self) -> None:
3131
"""Test case for test_auth_http_basic
3232
33-
To test HTTP basic authentication # noqa: E501
33+
To test HTTP basic authentication
34+
"""
35+
pass
36+
37+
def test_test_auth_http_bearer(self) -> None:
38+
"""Test case for test_auth_http_bearer
39+
40+
To test HTTP bearer authentication
3441
"""
3542
pass
3643

samples/client/echo_api/python/test/test_bird.py

Lines changed: 11 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -3,22 +3,19 @@
33
"""
44
Echo Server API
55
6-
Echo Server API # noqa: E501
6+
Echo Server API
77
88
The version of the OpenAPI document: 0.1.0
99
10-
Generated by: https://openapi-generator.tech
11-
"""
10+
Generated by OpenAPI Generator (https://openapi-generator.tech)
1211
12+
Do not edit the class manually.
13+
""" # noqa: E501
1314

14-
from __future__ import absolute_import
1515

1616
import unittest
17-
import datetime
1817

19-
import openapi_client
20-
from openapi_client.models.bird import Bird # noqa: E501
21-
from openapi_client.rest import ApiException
18+
from openapi_client.models.bird import Bird
2219

2320
class TestBird(unittest.TestCase):
2421
"""Bird unit test stubs"""
@@ -29,20 +26,20 @@ def setUp(self):
2926
def tearDown(self):
3027
pass
3128

32-
def make_instance(self, include_optional):
29+
def make_instance(self, include_optional) -> Bird:
3330
"""Test Bird
34-
include_option is a boolean, when False only required
31+
include_optional is a boolean, when False only required
3532
params are included, when True both required and
3633
optional params are included """
3734
# uncomment below to create an instance of `Bird`
3835
"""
39-
model = openapi_client.models.bird.Bird() # noqa: E501
40-
if include_optional :
36+
model = Bird()
37+
if include_optional:
4138
return Bird(
42-
size = '',
39+
size = '',
4340
color = ''
4441
)
45-
else :
42+
else:
4643
return Bird(
4744
)
4845
"""

samples/client/echo_api/python/test/test_body_api.py

Lines changed: 73 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -3,36 +3,97 @@
33
"""
44
Echo Server API
55
6-
Echo Server API # noqa: E501
6+
Echo Server API
77
88
The version of the OpenAPI document: 0.1.0
99
10-
Generated by: https://openapi-generator.tech
11-
"""
10+
Generated by OpenAPI Generator (https://openapi-generator.tech)
1211
12+
Do not edit the class manually.
13+
""" # noqa: E501
1314

14-
from __future__ import absolute_import
1515

1616
import unittest
1717

18-
import openapi_client
19-
from openapi_client.api.body_api import BodyApi # noqa: E501
20-
from openapi_client.rest import ApiException
18+
from openapi_client.api.body_api import BodyApi
2119

2220

2321
class TestBodyApi(unittest.TestCase):
2422
"""BodyApi unit test stubs"""
2523

26-
def setUp(self):
27-
self.api = openapi_client.api.body_api.BodyApi() # noqa: E501
24+
def setUp(self) -> None:
25+
self.api = BodyApi()
26+
27+
def tearDown(self) -> None:
28+
self.api.api_client.close()
29+
30+
def test_test_binary_gif(self) -> None:
31+
"""Test case for test_binary_gif
32+
33+
Test binary (gif) response body
34+
"""
35+
pass
36+
37+
def test_test_body_application_octetstream_binary(self) -> None:
38+
"""Test case for test_body_application_octetstream_binary
2839
29-
def tearDown(self):
40+
Test body parameter(s)
41+
"""
3042
pass
3143

32-
def test_test_echo_body_pet(self):
44+
def test_test_body_multipart_formdata_array_of_binary(self) -> None:
45+
"""Test case for test_body_multipart_formdata_array_of_binary
46+
47+
Test array of binary in multipart mime
48+
"""
49+
pass
50+
51+
def test_test_body_multipart_formdata_single_binary(self) -> None:
52+
"""Test case for test_body_multipart_formdata_single_binary
53+
54+
Test single binary in multipart mime
55+
"""
56+
pass
57+
58+
def test_test_echo_body_all_of_pet(self) -> None:
59+
"""Test case for test_echo_body_all_of_pet
60+
61+
Test body parameter(s)
62+
"""
63+
pass
64+
65+
def test_test_echo_body_free_form_object_response_string(self) -> None:
66+
"""Test case for test_echo_body_free_form_object_response_string
67+
68+
Test free form object
69+
"""
70+
pass
71+
72+
def test_test_echo_body_pet(self) -> None:
3373
"""Test case for test_echo_body_pet
3474
35-
Test body parameter(s) # noqa: E501
75+
Test body parameter(s)
76+
"""
77+
pass
78+
79+
def test_test_echo_body_pet_response_string(self) -> None:
80+
"""Test case for test_echo_body_pet_response_string
81+
82+
Test empty response body
83+
"""
84+
pass
85+
86+
def test_test_echo_body_string_enum(self) -> None:
87+
"""Test case for test_echo_body_string_enum
88+
89+
Test string enum response body
90+
"""
91+
pass
92+
93+
def test_test_echo_body_tag_response_string(self) -> None:
94+
"""Test case for test_echo_body_tag_response_string
95+
96+
Test empty json (request body)
3697
"""
3798
pass
3899

samples/client/echo_api/python/test/test_category.py

Lines changed: 11 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -3,22 +3,19 @@
33
"""
44
Echo Server API
55
6-
Echo Server API # noqa: E501
6+
Echo Server API
77
88
The version of the OpenAPI document: 0.1.0
99
10-
Generated by: https://openapi-generator.tech
11-
"""
10+
Generated by OpenAPI Generator (https://openapi-generator.tech)
1211
12+
Do not edit the class manually.
13+
""" # noqa: E501
1314

14-
from __future__ import absolute_import
1515

1616
import unittest
17-
import datetime
1817

19-
import openapi_client
20-
from openapi_client.models.category import Category # noqa: E501
21-
from openapi_client.rest import ApiException
18+
from openapi_client.models.category import Category
2219

2320
class TestCategory(unittest.TestCase):
2421
"""Category unit test stubs"""
@@ -29,20 +26,20 @@ def setUp(self):
2926
def tearDown(self):
3027
pass
3128

32-
def make_instance(self, include_optional):
29+
def make_instance(self, include_optional) -> Category:
3330
"""Test Category
34-
include_option is a boolean, when False only required
31+
include_optional is a boolean, when False only required
3532
params are included, when True both required and
3633
optional params are included """
3734
# uncomment below to create an instance of `Category`
3835
"""
39-
model = openapi_client.models.category.Category() # noqa: E501
40-
if include_optional :
36+
model = Category()
37+
if include_optional:
4138
return Category(
42-
id = 1,
39+
id = 1,
4340
name = 'Dogs'
4441
)
45-
else :
42+
else:
4643
return Category(
4744
)
4845
"""

samples/client/echo_api/python/test/test_data_query.py

Lines changed: 12 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -3,22 +3,19 @@
33
"""
44
Echo Server API
55
6-
Echo Server API # noqa: E501
6+
Echo Server API
77
88
The version of the OpenAPI document: 0.1.0
99
10-
Generated by: https://openapi-generator.tech
11-
"""
10+
Generated by OpenAPI Generator (https://openapi-generator.tech)
1211
12+
Do not edit the class manually.
13+
""" # noqa: E501
1314

14-
from __future__ import absolute_import
1515

1616
import unittest
17-
import datetime
1817

19-
import openapi_client
20-
from openapi_client.models.data_query import DataQuery # noqa: E501
21-
from openapi_client.rest import ApiException
18+
from openapi_client.models.data_query import DataQuery
2219

2320
class TestDataQuery(unittest.TestCase):
2421
"""DataQuery unit test stubs"""
@@ -29,21 +26,21 @@ def setUp(self):
2926
def tearDown(self):
3027
pass
3128

32-
def make_instance(self, include_optional):
29+
def make_instance(self, include_optional) -> DataQuery:
3330
"""Test DataQuery
34-
include_option is a boolean, when False only required
31+
include_optional is a boolean, when False only required
3532
params are included, when True both required and
3633
optional params are included """
3734
# uncomment below to create an instance of `DataQuery`
3835
"""
39-
model = openapi_client.models.data_query.DataQuery() # noqa: E501
40-
if include_optional :
36+
model = DataQuery()
37+
if include_optional:
4138
return DataQuery(
42-
suffix = '',
43-
text = 'Some text',
39+
suffix = '',
40+
text = 'Some text',
4441
var_date = datetime.datetime.strptime('2013-10-20 19:20:30.00', '%Y-%m-%d %H:%M:%S.%f')
4542
)
46-
else :
43+
else:
4744
return DataQuery(
4845
)
4946
"""

samples/client/echo_api/python/test/test_default_value.py

Lines changed: 21 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -3,22 +3,19 @@
33
"""
44
Echo Server API
55
6-
Echo Server API # noqa: E501
6+
Echo Server API
77
88
The version of the OpenAPI document: 0.1.0
99
10-
Generated by: https://openapi-generator.tech
11-
"""
10+
Generated by OpenAPI Generator (https://openapi-generator.tech)
1211
12+
Do not edit the class manually.
13+
""" # noqa: E501
1314

14-
from __future__ import absolute_import
1515

1616
import unittest
17-
import datetime
1817

19-
import openapi_client
20-
from openapi_client.models.default_value import DefaultValue # noqa: E501
21-
from openapi_client.rest import ApiException
18+
from openapi_client.models.default_value import DefaultValue
2219

2320
class TestDefaultValue(unittest.TestCase):
2421
"""DefaultValue unit test stubs"""
@@ -29,34 +26,40 @@ def setUp(self):
2926
def tearDown(self):
3027
pass
3128

32-
def make_instance(self, include_optional):
29+
def make_instance(self, include_optional) -> DefaultValue:
3330
"""Test DefaultValue
34-
include_option is a boolean, when False only required
31+
include_optional is a boolean, when False only required
3532
params are included, when True both required and
3633
optional params are included """
3734
# uncomment below to create an instance of `DefaultValue`
3835
"""
39-
model = openapi_client.models.default_value.DefaultValue() # noqa: E501
40-
if include_optional :
36+
model = DefaultValue()
37+
if include_optional:
4138
return DefaultValue(
39+
array_string_enum_ref_default = [
40+
'success'
41+
],
4242
array_string_enum_default = [
4343
'success'
44-
],
44+
],
4545
array_string_default = [
4646
''
47-
],
47+
],
4848
array_integer_default = [
4949
56
50-
],
50+
],
5151
array_string = [
5252
''
53-
],
53+
],
5454
array_string_nullable = [
5555
''
56-
],
56+
],
57+
array_string_extension_nullable = [
58+
''
59+
],
5760
string_nullable = ''
5861
)
59-
else :
62+
else:
6063
return DefaultValue(
6164
)
6265
"""

0 commit comments

Comments
 (0)