forked from loafle/openapi-generator-original
[python] Fix Circular imports on inherited discriminators. (#17886)
* [python] add inheritance discriminators test #16808 * [python] update samples * [python] fix assert in test * [python] fix inheritance discriminators circular import * [python] update samples * [python] undo type changes related to discriminator * [python] remove extraneous processing * [python-pydantic-v1] fix inheritance discriminators circular import * [python] remove type ignore comment * [python] update samples * [python] fix avoid the empty line break * [python] update samples
This commit is contained in:
@@ -0,0 +1,51 @@
|
||||
# coding: utf-8
|
||||
|
||||
"""
|
||||
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: \" \\
|
||||
|
||||
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
|
||||
|
||||
from petstore_api.models.discriminator_all_of_sub import DiscriminatorAllOfSub # noqa: E501
|
||||
|
||||
class TestDiscriminatorAllOfSub(unittest.TestCase):
|
||||
"""DiscriminatorAllOfSub unit test stubs"""
|
||||
|
||||
def setUp(self):
|
||||
pass
|
||||
|
||||
def tearDown(self):
|
||||
pass
|
||||
|
||||
def make_instance(self, include_optional) -> DiscriminatorAllOfSub:
|
||||
"""Test DiscriminatorAllOfSub
|
||||
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 `DiscriminatorAllOfSub`
|
||||
"""
|
||||
model = DiscriminatorAllOfSub() # noqa: E501
|
||||
if include_optional:
|
||||
return DiscriminatorAllOfSub(
|
||||
)
|
||||
else:
|
||||
return DiscriminatorAllOfSub(
|
||||
)
|
||||
"""
|
||||
|
||||
def testDiscriminatorAllOfSub(self):
|
||||
"""Test DiscriminatorAllOfSub"""
|
||||
# inst_req_only = self.make_instance(include_optional=False)
|
||||
# inst_req_and_optional = self.make_instance(include_optional=True)
|
||||
|
||||
if __name__ == '__main__':
|
||||
unittest.main()
|
||||
@@ -0,0 +1,53 @@
|
||||
# coding: utf-8
|
||||
|
||||
"""
|
||||
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: \" \\
|
||||
|
||||
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
|
||||
|
||||
from petstore_api.models.discriminator_all_of_super import DiscriminatorAllOfSuper # noqa: E501
|
||||
|
||||
class TestDiscriminatorAllOfSuper(unittest.TestCase):
|
||||
"""DiscriminatorAllOfSuper unit test stubs"""
|
||||
|
||||
def setUp(self):
|
||||
pass
|
||||
|
||||
def tearDown(self):
|
||||
pass
|
||||
|
||||
def make_instance(self, include_optional) -> DiscriminatorAllOfSuper:
|
||||
"""Test DiscriminatorAllOfSuper
|
||||
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 `DiscriminatorAllOfSuper`
|
||||
"""
|
||||
model = DiscriminatorAllOfSuper() # noqa: E501
|
||||
if include_optional:
|
||||
return DiscriminatorAllOfSuper(
|
||||
element_type = ''
|
||||
)
|
||||
else:
|
||||
return DiscriminatorAllOfSuper(
|
||||
element_type = '',
|
||||
)
|
||||
"""
|
||||
|
||||
def testDiscriminatorAllOfSuper(self):
|
||||
"""Test DiscriminatorAllOfSuper"""
|
||||
# inst_req_only = self.make_instance(include_optional=False)
|
||||
# inst_req_and_optional = self.make_instance(include_optional=True)
|
||||
|
||||
if __name__ == '__main__':
|
||||
unittest.main()
|
||||
Reference in New Issue
Block a user