Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[python] Close test API clients #20400

Merged
merged 16 commits into from
Jan 4, 2025
Merged
Original file line number Diff line number Diff line change
Expand Up @@ -15,14 +15,14 @@ class {{#operations}}Test{{classname}}(unittest.{{#asyncio}}IsolatedAsyncio{{/as
self.api = {{classname}}()

async def asyncTearDown(self) -> None:
pass
await self.api.api_client.close()
{{/asyncio}}
{{^asyncio}}
def setUp(self) -> None:
self.api = {{classname}}()

def tearDown(self) -> None:
pass
self.api.api_client.close()
{{/asyncio}}

{{#operation}}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ class {{#operations}}Test{{classname}}(unittest.{{#asyncio}}IsolatedAsyncio{{/as
self.api = {{classname}}()

async def asyncTearDown(self) -> None:
pass
await self.api.api_client.close()
{{/asyncio}}
{{^asyncio}}
def setUp(self) -> None:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,22 +15,29 @@

import unittest

from openapi_client.api.auth_api import AuthApi # noqa: E501
from openapi_client.api.auth_api import AuthApi


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

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

def tearDown(self) -> None:
pass

def test_test_auth_http_basic(self) -> None:
"""Test case for test_auth_http_basic

To test HTTP basic authentication # noqa: E501
To test HTTP basic authentication
"""
pass

def test_test_auth_http_bearer(self) -> None:
"""Test case for test_auth_http_bearer

To test HTTP bearer authentication
"""
pass

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,22 +3,19 @@
"""
Echo Server API

Echo Server API # noqa: E501
Echo Server API

The version of the OpenAPI document: 0.1.0
Contact: [email protected]
Generated by: https://openapi-generator.tech
"""
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 openapi_client
from openapi_client.models.bird import Bird # noqa: E501
from openapi_client.rest import ApiException
from openapi_client.models.bird import Bird

class TestBird(unittest.TestCase):
"""Bird unit test stubs"""
Expand All @@ -29,20 +26,20 @@ def setUp(self):
def tearDown(self):
pass

def make_instance(self, include_optional):
def make_instance(self, include_optional) -> Bird:
"""Test Bird
include_option is a boolean, when False only required
include_optional 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 `Bird`
"""
model = openapi_client.models.bird.Bird() # noqa: E501
if include_optional :
model = Bird()
if include_optional:
return Bird(
size = '',
size = '',
color = ''
)
else :
else:
return Bird(
)
"""
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,36 +3,97 @@
"""
Echo Server API

Echo Server API # noqa: E501
Echo Server API

The version of the OpenAPI document: 0.1.0
Contact: [email protected]
Generated by: https://openapi-generator.tech
"""
Generated by OpenAPI Generator (https://openapi-generator.tech)

Do not edit the class manually.
""" # noqa: E501

from __future__ import absolute_import

import unittest

import openapi_client
from openapi_client.api.body_api import BodyApi # noqa: E501
from openapi_client.rest import ApiException
from openapi_client.api.body_api import BodyApi


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

def setUp(self):
self.api = openapi_client.api.body_api.BodyApi() # noqa: E501
def setUp(self) -> None:
self.api = BodyApi()

def tearDown(self) -> None:
pass

def test_test_binary_gif(self) -> None:
"""Test case for test_binary_gif

Test binary (gif) response body
"""
pass

def test_test_body_application_octetstream_binary(self) -> None:
"""Test case for test_body_application_octetstream_binary

Test body parameter(s)
"""
pass

def test_test_body_multipart_formdata_array_of_binary(self) -> None:
"""Test case for test_body_multipart_formdata_array_of_binary

Test array of binary in multipart mime
"""
pass

def test_test_body_multipart_formdata_single_binary(self) -> None:
"""Test case for test_body_multipart_formdata_single_binary

Test single binary in multipart mime
"""
pass

def test_test_echo_body_all_of_pet(self) -> None:
"""Test case for test_echo_body_all_of_pet

Test body parameter(s)
"""
pass

def test_test_echo_body_free_form_object_response_string(self) -> None:
"""Test case for test_echo_body_free_form_object_response_string

def tearDown(self):
Test free form object
"""
pass

def test_test_echo_body_pet(self):
def test_test_echo_body_pet(self) -> None:
"""Test case for test_echo_body_pet

Test body parameter(s) # noqa: E501
Test body parameter(s)
"""
pass

def test_test_echo_body_pet_response_string(self) -> None:
"""Test case for test_echo_body_pet_response_string

Test empty response body
"""
pass

def test_test_echo_body_string_enum(self) -> None:
"""Test case for test_echo_body_string_enum

Test string enum response body
"""
pass

def test_test_echo_body_tag_response_string(self) -> None:
"""Test case for test_echo_body_tag_response_string

Test empty json (request body)
"""
pass

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,22 +3,19 @@
"""
Echo Server API

Echo Server API # noqa: E501
Echo Server API

The version of the OpenAPI document: 0.1.0
Contact: [email protected]
Generated by: https://openapi-generator.tech
"""
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 openapi_client
from openapi_client.models.category import Category # noqa: E501
from openapi_client.rest import ApiException
from openapi_client.models.category import Category

class TestCategory(unittest.TestCase):
"""Category unit test stubs"""
Expand All @@ -29,20 +26,20 @@ def setUp(self):
def tearDown(self):
pass

def make_instance(self, include_optional):
def make_instance(self, include_optional) -> Category:
"""Test Category
include_option is a boolean, when False only required
include_optional 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 = openapi_client.models.category.Category() # noqa: E501
if include_optional :
model = Category()
if include_optional:
return Category(
id = 1,
id = 1,
name = 'Dogs'
)
else :
else:
return Category(
)
"""
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,22 +3,19 @@
"""
Echo Server API

Echo Server API # noqa: E501
Echo Server API

The version of the OpenAPI document: 0.1.0
Contact: [email protected]
Generated by: https://openapi-generator.tech
"""
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 openapi_client
from openapi_client.models.data_query import DataQuery # noqa: E501
from openapi_client.rest import ApiException
from openapi_client.models.data_query import DataQuery

class TestDataQuery(unittest.TestCase):
"""DataQuery unit test stubs"""
Expand All @@ -29,21 +26,21 @@ def setUp(self):
def tearDown(self):
pass

def make_instance(self, include_optional):
def make_instance(self, include_optional) -> DataQuery:
"""Test DataQuery
include_option is a boolean, when False only required
include_optional 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 `DataQuery`
"""
model = openapi_client.models.data_query.DataQuery() # noqa: E501
if include_optional :
model = DataQuery()
if include_optional:
return DataQuery(
suffix = '',
text = 'Some text',
suffix = '',
text = 'Some text',
var_date = datetime.datetime.strptime('2013-10-20 19:20:30.00', '%Y-%m-%d %H:%M:%S.%f')
)
else :
else:
return DataQuery(
)
"""
Expand Down
Loading
Loading