forked from loafle/openapi-generator-original
* 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
73 lines
1.8 KiB
Python
73 lines
1.8 KiB
Python
# coding: utf-8
|
|
|
|
"""
|
|
Echo Server API
|
|
|
|
Echo Server API # noqa: E501
|
|
|
|
The version of the OpenAPI document: 0.1.0
|
|
Contact: team@openapitools.org
|
|
Generated by: https://openapi-generator.tech
|
|
"""
|
|
|
|
|
|
from __future__ import absolute_import
|
|
|
|
import unittest
|
|
import datetime
|
|
|
|
import openapi_client
|
|
from openapi_client.models.pet import Pet # noqa: E501
|
|
from openapi_client.rest import ApiException
|
|
|
|
class TestPet(unittest.TestCase):
|
|
"""Pet unit test stubs"""
|
|
|
|
def setUp(self):
|
|
pass
|
|
|
|
def tearDown(self):
|
|
pass
|
|
|
|
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 = openapi_client.models.pet.Pet() # noqa: E501
|
|
if include_optional :
|
|
return Pet(
|
|
id = 10,
|
|
name = 'doggie',
|
|
category = openapi_client.models.category.Category(
|
|
id = 1,
|
|
name = 'Dogs', ),
|
|
photo_urls = [
|
|
''
|
|
],
|
|
tags = [
|
|
openapi_client.models.tag.Tag(
|
|
id = 56,
|
|
name = '', )
|
|
],
|
|
status = 'available'
|
|
)
|
|
else :
|
|
return Pet(
|
|
name = 'doggie',
|
|
photo_urls = [
|
|
''
|
|
],
|
|
)
|
|
"""
|
|
|
|
def testPet(self):
|
|
"""Test Pet"""
|
|
# inst_req_only = self.make_instance(include_optional=False)
|
|
# inst_req_and_optional = self.make_instance(include_optional=True)
|
|
|
|
if __name__ == '__main__':
|
|
unittest.main()
|