Python-exp clean up model classnames (#7054)

* Adds lazy_import, removes python-exp java class renaming code, partial removal of getPythonClassName call sites

Fixes PythonClientExperimentalTest.java

Python-exp smaples regeneration

Revers makefile

Reverst pom.xml

Fixes model imports in models.__init__

Updates docstring, omits lazy import in additional properties if we dont need it

Improves additional_properties_type assignment if None

Removes getPythonClassName

Fixes python-exp tests

* Removes unused makefiles
This commit is contained in:
Justin Black
2020-07-27 18:35:41 -07:00
committed by GitHub
parent 2743242ef4
commit ee0686e13f
419 changed files with 2491 additions and 2229 deletions

View File

@@ -119,7 +119,7 @@ class TestFakeApi(unittest.TestCase):
"""
from petstore_api.model import array_of_enums, string_enum
endpoint = self.api.array_of_enums
assert endpoint.openapi_types['array_of_enums_array_of_enums'] == (array_of_enums.ArrayOfEnums,)
assert endpoint.openapi_types['array_of_enums'] == (array_of_enums.ArrayOfEnums,)
assert endpoint.settings['response_type'] == (array_of_enums.ArrayOfEnums,)
# serialization + deserialization works
@@ -129,7 +129,7 @@ class TestFakeApi(unittest.TestCase):
value_simple = ["placed"]
mock_method.return_value = self.mock_response(value_simple)
response = endpoint(array_of_enums_array_of_enums=body)
response = endpoint(array_of_enums=body)
self.assert_request_called_with(mock_method, 'http://petstore.swagger.io:80/v2/fake/refs/array-of-enums', value_simple)
assert isinstance(response, array_of_enums.ArrayOfEnums)
@@ -171,7 +171,7 @@ class TestFakeApi(unittest.TestCase):
"""
from petstore_api.model import animal, composed_one_of_number_with_validations, number_with_validations
endpoint = self.api.composed_one_of_number_with_validations
assert endpoint.openapi_types['composed_one_of_number_with_validations_composed_one_of_number_with_validations'] == (
assert endpoint.openapi_types['composed_one_of_number_with_validations'] == (
composed_one_of_number_with_validations.ComposedOneOfNumberWithValidations,)
assert endpoint.settings['response_type'] == (
composed_one_of_number_with_validations.ComposedOneOfNumberWithValidations,)
@@ -193,7 +193,7 @@ class TestFakeApi(unittest.TestCase):
with patch.object(RESTClientObject, 'request') as mock_method:
mock_method.return_value = self.mock_response(value_simple)
response = endpoint(composed_one_of_number_with_validations_composed_one_of_number_with_validations=body)
response = endpoint(composed_one_of_number_with_validations=body)
self.assert_request_called_with(
mock_method,
'http://petstore.swagger.io:80/v2/fake/refs/composed_one_of_number_with_validations',

View File

@@ -33,11 +33,11 @@ class TestObjectModelWithRefProps(unittest.TestCase):
def testObjectModelWithRefProps(self):
"""Test ObjectModelWithRefProps"""
from petstore_api.model.object_model_with_ref_props import number_with_validations
from petstore_api.model.number_with_validations import NumberWithValidations
self.assertEqual(
ObjectModelWithRefProps.openapi_types,
{
'my_number': (number_with_validations.NumberWithValidations,),
'my_number': (NumberWithValidations,),
'my_string': (str,),
'my_boolean': (bool,),
}