diff --git a/bin/python-petstore.sh b/bin/python-petstore.sh index ef120089f45..0fe89ea39ed 100755 --- a/bin/python-petstore.sh +++ b/bin/python-petstore.sh @@ -26,6 +26,6 @@ fi # if you've executed sbt assembly previously it will use that instead. export JAVA_OPTS="${JAVA_OPTS} -XX:MaxPermSize=256M -Xmx1024M -DloggerPath=conf/log4j.properties" -ags="$@ generate -t modules/swagger-codegen/src/main/resources/python -i modules/swagger-codegen/src/test/resources/2_0/petstore-with-fake-endpoints-models-for-testing.yaml -l python -o samples/client/petstore/python" +ags="$@ generate -t modules/swagger-codegen/src/main/resources/python -i modules/swagger-codegen/src/test/resources/2_0/petstore-with-fake-endpoints-models-for-testing.yaml -l python -o samples/client/petstore/python -DpackageName=petstore_api" java $JAVA_OPTS -jar $executable $ags diff --git a/modules/swagger-codegen/src/main/resources/python/api_test.mustache b/modules/swagger-codegen/src/main/resources/python/api_test.mustache index a301d64722a..f0f07f7189e 100644 --- a/modules/swagger-codegen/src/main/resources/python/api_test.mustache +++ b/modules/swagger-codegen/src/main/resources/python/api_test.mustache @@ -8,16 +8,16 @@ import os import sys import unittest -import swagger_client -from swagger_client.rest import ApiException -from swagger_client.apis.{{classVarName}} import {{classname}} +import {{packageName}} +from {{packageName}}.rest import ApiException +from {{packageName}}.apis.{{classVarName}} import {{classname}} class {{#operations}}Test{{classname}}(unittest.TestCase): """ {{classname}} unit test stubs """ def setUp(self): - self.api = swagger_client.apis.{{classVarName}}.{{classname}}() + self.api = {{packageName}}.apis.{{classVarName}}.{{classname}}() def tearDown(self): pass diff --git a/modules/swagger-codegen/src/main/resources/python/model_test.mustache b/modules/swagger-codegen/src/main/resources/python/model_test.mustache index 3533fa11063..9e1b72b14a0 100644 --- a/modules/swagger-codegen/src/main/resources/python/model_test.mustache +++ b/modules/swagger-codegen/src/main/resources/python/model_test.mustache @@ -10,9 +10,9 @@ import unittest {{#models}} {{#model}} -import swagger_client -from swagger_client.rest import ApiException -from swagger_client.models.{{classFilename}} import {{classname}} +import {{packageName}} +from {{packageName}}.rest import ApiException +from {{packageName}}.models.{{classFilename}} import {{classname}} class Test{{classname}}(unittest.TestCase): @@ -28,7 +28,7 @@ class Test{{classname}}(unittest.TestCase): """ Test {{classname}} """ - model = swagger_client.models.{{classFilename}}.{{classname}}() + model = {{packageName}}.models.{{classFilename}}.{{classname}}() {{/model}} {{/models}} diff --git a/samples/client/petstore/python/README.md b/samples/client/petstore/python/README.md index 891785820de..7bf57caa2b8 100644 --- a/samples/client/petstore/python/README.md +++ b/samples/client/petstore/python/README.md @@ -5,7 +5,7 @@ This Python package is automatically generated by the [Swagger Codegen](https:// - API version: 1.0.0 - Package version: 1.0.0 -- Build date: 2016-06-07T08:27:42.099+09:00 +- Build date: 2016-06-07T00:29:52.148+09:00 - Build package: class io.swagger.codegen.languages.PythonClientCodegen ## Requirements. diff --git a/samples/client/petstore/python/docs/FakeApi.md b/samples/client/petstore/python/docs/FakeApi.md index 6853fa0bee9..16656613075 100644 --- a/samples/client/petstore/python/docs/FakeApi.md +++ b/samples/client/petstore/python/docs/FakeApi.md @@ -1,4 +1,4 @@ -# swagger_client.FakeApi +# petstore_api.FakeApi All URIs are relative to *http://petstore.swagger.io/v2* @@ -17,12 +17,12 @@ Fake endpoint for testing various parameters 假端點 偽のエンドポイン ### Example ```python import time -import swagger_client -from swagger_client.rest import ApiException +import petstore_api +from petstore_api.rest import ApiException from pprint import pprint # create an instance of the API class -api_instance = swagger_client.FakeApi() +api_instance = petstore_api.FakeApi() number = 3.4 # float | None double = 1.2 # float | None string = 'string_example' # str | None diff --git a/samples/client/petstore/python/docs/PetApi.md b/samples/client/petstore/python/docs/PetApi.md index fb69778f611..109b264942f 100644 --- a/samples/client/petstore/python/docs/PetApi.md +++ b/samples/client/petstore/python/docs/PetApi.md @@ -1,4 +1,4 @@ -# swagger_client.PetApi +# petstore_api.PetApi All URIs are relative to *http://petstore.swagger.io/v2* @@ -24,16 +24,16 @@ Add a new pet to the store ### Example ```python import time -import swagger_client -from swagger_client.rest import ApiException +import petstore_api +from petstore_api.rest import ApiException from pprint import pprint # Configure OAuth2 access token for authorization: petstore_auth -swagger_client.configuration.access_token = 'YOUR_ACCESS_TOKEN' +petstore_api.configuration.access_token = 'YOUR_ACCESS_TOKEN' # create an instance of the API class -api_instance = swagger_client.PetApi() -body = swagger_client.Pet() # Pet | Pet object that needs to be added to the store +api_instance = petstore_api.PetApi() +body = petstore_api.Pet() # Pet | Pet object that needs to be added to the store try: # Add a new pet to the store @@ -73,15 +73,15 @@ Deletes a pet ### Example ```python import time -import swagger_client -from swagger_client.rest import ApiException +import petstore_api +from petstore_api.rest import ApiException from pprint import pprint # Configure OAuth2 access token for authorization: petstore_auth -swagger_client.configuration.access_token = 'YOUR_ACCESS_TOKEN' +petstore_api.configuration.access_token = 'YOUR_ACCESS_TOKEN' # create an instance of the API class -api_instance = swagger_client.PetApi() +api_instance = petstore_api.PetApi() pet_id = 789 # int | Pet id to delete api_key = 'api_key_example' # str | (optional) @@ -124,15 +124,15 @@ Multiple status values can be provided with comma separated strings ### Example ```python import time -import swagger_client -from swagger_client.rest import ApiException +import petstore_api +from petstore_api.rest import ApiException from pprint import pprint # Configure OAuth2 access token for authorization: petstore_auth -swagger_client.configuration.access_token = 'YOUR_ACCESS_TOKEN' +petstore_api.configuration.access_token = 'YOUR_ACCESS_TOKEN' # create an instance of the API class -api_instance = swagger_client.PetApi() +api_instance = petstore_api.PetApi() status = ['status_example'] # list[str] | Status values that need to be considered for filter try: @@ -174,15 +174,15 @@ Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 ### Example ```python import time -import swagger_client -from swagger_client.rest import ApiException +import petstore_api +from petstore_api.rest import ApiException from pprint import pprint # Configure OAuth2 access token for authorization: petstore_auth -swagger_client.configuration.access_token = 'YOUR_ACCESS_TOKEN' +petstore_api.configuration.access_token = 'YOUR_ACCESS_TOKEN' # create an instance of the API class -api_instance = swagger_client.PetApi() +api_instance = petstore_api.PetApi() tags = ['tags_example'] # list[str] | Tags to filter by try: @@ -224,17 +224,17 @@ Returns a single pet ### Example ```python import time -import swagger_client -from swagger_client.rest import ApiException +import petstore_api +from petstore_api.rest import ApiException from pprint import pprint # Configure API key authorization: api_key -swagger_client.configuration.api_key['api_key'] = 'YOUR_API_KEY' +petstore_api.configuration.api_key['api_key'] = 'YOUR_API_KEY' # Uncomment below to setup prefix (e.g. Bearer) for API key, if needed -# swagger_client.configuration.api_key_prefix['api_key'] = 'Bearer' +# petstore_api.configuration.api_key_prefix['api_key'] = 'Bearer' # create an instance of the API class -api_instance = swagger_client.PetApi() +api_instance = petstore_api.PetApi() pet_id = 789 # int | ID of pet to return try: @@ -276,16 +276,16 @@ Update an existing pet ### Example ```python import time -import swagger_client -from swagger_client.rest import ApiException +import petstore_api +from petstore_api.rest import ApiException from pprint import pprint # Configure OAuth2 access token for authorization: petstore_auth -swagger_client.configuration.access_token = 'YOUR_ACCESS_TOKEN' +petstore_api.configuration.access_token = 'YOUR_ACCESS_TOKEN' # create an instance of the API class -api_instance = swagger_client.PetApi() -body = swagger_client.Pet() # Pet | Pet object that needs to be added to the store +api_instance = petstore_api.PetApi() +body = petstore_api.Pet() # Pet | Pet object that needs to be added to the store try: # Update an existing pet @@ -325,15 +325,15 @@ Updates a pet in the store with form data ### Example ```python import time -import swagger_client -from swagger_client.rest import ApiException +import petstore_api +from petstore_api.rest import ApiException from pprint import pprint # Configure OAuth2 access token for authorization: petstore_auth -swagger_client.configuration.access_token = 'YOUR_ACCESS_TOKEN' +petstore_api.configuration.access_token = 'YOUR_ACCESS_TOKEN' # create an instance of the API class -api_instance = swagger_client.PetApi() +api_instance = petstore_api.PetApi() pet_id = 789 # int | ID of pet that needs to be updated name = 'name_example' # str | Updated name of the pet (optional) status = 'status_example' # str | Updated status of the pet (optional) @@ -378,15 +378,15 @@ uploads an image ### Example ```python import time -import swagger_client -from swagger_client.rest import ApiException +import petstore_api +from petstore_api.rest import ApiException from pprint import pprint # Configure OAuth2 access token for authorization: petstore_auth -swagger_client.configuration.access_token = 'YOUR_ACCESS_TOKEN' +petstore_api.configuration.access_token = 'YOUR_ACCESS_TOKEN' # create an instance of the API class -api_instance = swagger_client.PetApi() +api_instance = petstore_api.PetApi() pet_id = 789 # int | ID of pet to update additional_metadata = 'additional_metadata_example' # str | Additional data to pass to server (optional) file = '/path/to/file.txt' # file | file to upload (optional) diff --git a/samples/client/petstore/python/docs/StoreApi.md b/samples/client/petstore/python/docs/StoreApi.md index 537009bde52..6b71a78659d 100644 --- a/samples/client/petstore/python/docs/StoreApi.md +++ b/samples/client/petstore/python/docs/StoreApi.md @@ -1,4 +1,4 @@ -# swagger_client.StoreApi +# petstore_api.StoreApi All URIs are relative to *http://petstore.swagger.io/v2* @@ -20,12 +20,12 @@ For valid response try integer IDs with value < 1000. Anything above 1000 or non ### Example ```python import time -import swagger_client -from swagger_client.rest import ApiException +import petstore_api +from petstore_api.rest import ApiException from pprint import pprint # create an instance of the API class -api_instance = swagger_client.StoreApi() +api_instance = petstore_api.StoreApi() order_id = 'order_id_example' # str | ID of the order that needs to be deleted try: @@ -66,17 +66,17 @@ Returns a map of status codes to quantities ### Example ```python import time -import swagger_client -from swagger_client.rest import ApiException +import petstore_api +from petstore_api.rest import ApiException from pprint import pprint # Configure API key authorization: api_key -swagger_client.configuration.api_key['api_key'] = 'YOUR_API_KEY' +petstore_api.configuration.api_key['api_key'] = 'YOUR_API_KEY' # Uncomment below to setup prefix (e.g. Bearer) for API key, if needed -# swagger_client.configuration.api_key_prefix['api_key'] = 'Bearer' +# petstore_api.configuration.api_key_prefix['api_key'] = 'Bearer' # create an instance of the API class -api_instance = swagger_client.StoreApi() +api_instance = petstore_api.StoreApi() try: # Returns pet inventories by status @@ -114,12 +114,12 @@ For valid response try integer IDs with value <= 5 or > 10. Other values will ge ### Example ```python import time -import swagger_client -from swagger_client.rest import ApiException +import petstore_api +from petstore_api.rest import ApiException from pprint import pprint # create an instance of the API class -api_instance = swagger_client.StoreApi() +api_instance = petstore_api.StoreApi() order_id = 789 # int | ID of pet that needs to be fetched try: @@ -161,13 +161,13 @@ Place an order for a pet ### Example ```python import time -import swagger_client -from swagger_client.rest import ApiException +import petstore_api +from petstore_api.rest import ApiException from pprint import pprint # create an instance of the API class -api_instance = swagger_client.StoreApi() -body = swagger_client.Order() # Order | order placed for purchasing the pet +api_instance = petstore_api.StoreApi() +body = petstore_api.Order() # Order | order placed for purchasing the pet try: # Place an order for a pet diff --git a/samples/client/petstore/python/docs/UserApi.md b/samples/client/petstore/python/docs/UserApi.md index 1975c1fe7f3..4009418b13c 100644 --- a/samples/client/petstore/python/docs/UserApi.md +++ b/samples/client/petstore/python/docs/UserApi.md @@ -1,4 +1,4 @@ -# swagger_client.UserApi +# petstore_api.UserApi All URIs are relative to *http://petstore.swagger.io/v2* @@ -24,13 +24,13 @@ This can only be done by the logged in user. ### Example ```python import time -import swagger_client -from swagger_client.rest import ApiException +import petstore_api +from petstore_api.rest import ApiException from pprint import pprint # create an instance of the API class -api_instance = swagger_client.UserApi() -body = swagger_client.User() # User | Created user object +api_instance = petstore_api.UserApi() +body = petstore_api.User() # User | Created user object try: # Create user @@ -70,13 +70,13 @@ Creates list of users with given input array ### Example ```python import time -import swagger_client -from swagger_client.rest import ApiException +import petstore_api +from petstore_api.rest import ApiException from pprint import pprint # create an instance of the API class -api_instance = swagger_client.UserApi() -body = [swagger_client.User()] # list[User] | List of user object +api_instance = petstore_api.UserApi() +body = [petstore_api.User()] # list[User] | List of user object try: # Creates list of users with given input array @@ -116,13 +116,13 @@ Creates list of users with given input array ### Example ```python import time -import swagger_client -from swagger_client.rest import ApiException +import petstore_api +from petstore_api.rest import ApiException from pprint import pprint # create an instance of the API class -api_instance = swagger_client.UserApi() -body = [swagger_client.User()] # list[User] | List of user object +api_instance = petstore_api.UserApi() +body = [petstore_api.User()] # list[User] | List of user object try: # Creates list of users with given input array @@ -162,12 +162,12 @@ This can only be done by the logged in user. ### Example ```python import time -import swagger_client -from swagger_client.rest import ApiException +import petstore_api +from petstore_api.rest import ApiException from pprint import pprint # create an instance of the API class -api_instance = swagger_client.UserApi() +api_instance = petstore_api.UserApi() username = 'username_example' # str | The name that needs to be deleted try: @@ -208,12 +208,12 @@ Get user by user name ### Example ```python import time -import swagger_client -from swagger_client.rest import ApiException +import petstore_api +from petstore_api.rest import ApiException from pprint import pprint # create an instance of the API class -api_instance = swagger_client.UserApi() +api_instance = petstore_api.UserApi() username = 'username_example' # str | The name that needs to be fetched. Use user1 for testing. try: @@ -255,12 +255,12 @@ Logs user into the system ### Example ```python import time -import swagger_client -from swagger_client.rest import ApiException +import petstore_api +from petstore_api.rest import ApiException from pprint import pprint # create an instance of the API class -api_instance = swagger_client.UserApi() +api_instance = petstore_api.UserApi() username = 'username_example' # str | The user name for login password = 'password_example' # str | The password for login in clear text @@ -304,12 +304,12 @@ Logs out current logged in user session ### Example ```python import time -import swagger_client -from swagger_client.rest import ApiException +import petstore_api +from petstore_api.rest import ApiException from pprint import pprint # create an instance of the API class -api_instance = swagger_client.UserApi() +api_instance = petstore_api.UserApi() try: # Logs out current logged in user session @@ -346,14 +346,14 @@ This can only be done by the logged in user. ### Example ```python import time -import swagger_client -from swagger_client.rest import ApiException +import petstore_api +from petstore_api.rest import ApiException from pprint import pprint # create an instance of the API class -api_instance = swagger_client.UserApi() +api_instance = petstore_api.UserApi() username = 'username_example' # str | name that need to be deleted -body = swagger_client.User() # User | Updated user object +body = petstore_api.User() # User | Updated user object try: # Updated user diff --git a/samples/client/petstore/python/swagger_client/__init__.py b/samples/client/petstore/python/petstore_api/__init__.py similarity index 100% rename from samples/client/petstore/python/swagger_client/__init__.py rename to samples/client/petstore/python/petstore_api/__init__.py diff --git a/samples/client/petstore/python/swagger_client/api_client.py b/samples/client/petstore/python/petstore_api/api_client.py similarity index 100% rename from samples/client/petstore/python/swagger_client/api_client.py rename to samples/client/petstore/python/petstore_api/api_client.py diff --git a/samples/client/petstore/python/swagger_client/apis/__init__.py b/samples/client/petstore/python/petstore_api/apis/__init__.py similarity index 100% rename from samples/client/petstore/python/swagger_client/apis/__init__.py rename to samples/client/petstore/python/petstore_api/apis/__init__.py diff --git a/samples/client/petstore/python/swagger_client/apis/fake_api.py b/samples/client/petstore/python/petstore_api/apis/fake_api.py similarity index 100% rename from samples/client/petstore/python/swagger_client/apis/fake_api.py rename to samples/client/petstore/python/petstore_api/apis/fake_api.py diff --git a/samples/client/petstore/python/swagger_client/apis/pet_api.py b/samples/client/petstore/python/petstore_api/apis/pet_api.py similarity index 100% rename from samples/client/petstore/python/swagger_client/apis/pet_api.py rename to samples/client/petstore/python/petstore_api/apis/pet_api.py diff --git a/samples/client/petstore/python/swagger_client/apis/store_api.py b/samples/client/petstore/python/petstore_api/apis/store_api.py similarity index 100% rename from samples/client/petstore/python/swagger_client/apis/store_api.py rename to samples/client/petstore/python/petstore_api/apis/store_api.py diff --git a/samples/client/petstore/python/swagger_client/apis/user_api.py b/samples/client/petstore/python/petstore_api/apis/user_api.py similarity index 100% rename from samples/client/petstore/python/swagger_client/apis/user_api.py rename to samples/client/petstore/python/petstore_api/apis/user_api.py diff --git a/samples/client/petstore/python/swagger_client/configuration.py b/samples/client/petstore/python/petstore_api/configuration.py similarity index 99% rename from samples/client/petstore/python/swagger_client/configuration.py rename to samples/client/petstore/python/petstore_api/configuration.py index 5fbb46a607f..76f1f57c784 100644 --- a/samples/client/petstore/python/swagger_client/configuration.py +++ b/samples/client/petstore/python/petstore_api/configuration.py @@ -82,7 +82,7 @@ class Configuration(object): # Logging Settings self.logger = {} - self.logger["package_logger"] = logging.getLogger("swagger_client") + self.logger["package_logger"] = logging.getLogger("petstore_api") self.logger["urllib3_logger"] = logging.getLogger("urllib3") # Log format self.logger_format = '%(asctime)s %(levelname)s %(message)s' diff --git a/samples/client/petstore/python/swagger_client/models/__init__.py b/samples/client/petstore/python/petstore_api/models/__init__.py similarity index 100% rename from samples/client/petstore/python/swagger_client/models/__init__.py rename to samples/client/petstore/python/petstore_api/models/__init__.py diff --git a/samples/client/petstore/python/swagger_client/models/additional_properties_class.py b/samples/client/petstore/python/petstore_api/models/additional_properties_class.py similarity index 100% rename from samples/client/petstore/python/swagger_client/models/additional_properties_class.py rename to samples/client/petstore/python/petstore_api/models/additional_properties_class.py diff --git a/samples/client/petstore/python/swagger_client/models/animal.py b/samples/client/petstore/python/petstore_api/models/animal.py similarity index 100% rename from samples/client/petstore/python/swagger_client/models/animal.py rename to samples/client/petstore/python/petstore_api/models/animal.py diff --git a/samples/client/petstore/python/swagger_client/models/animal_farm.py b/samples/client/petstore/python/petstore_api/models/animal_farm.py similarity index 100% rename from samples/client/petstore/python/swagger_client/models/animal_farm.py rename to samples/client/petstore/python/petstore_api/models/animal_farm.py diff --git a/samples/client/petstore/python/swagger_client/models/api_response.py b/samples/client/petstore/python/petstore_api/models/api_response.py similarity index 100% rename from samples/client/petstore/python/swagger_client/models/api_response.py rename to samples/client/petstore/python/petstore_api/models/api_response.py diff --git a/samples/client/petstore/python/swagger_client/models/array_test.py b/samples/client/petstore/python/petstore_api/models/array_test.py similarity index 100% rename from samples/client/petstore/python/swagger_client/models/array_test.py rename to samples/client/petstore/python/petstore_api/models/array_test.py diff --git a/samples/client/petstore/python/swagger_client/models/cat.py b/samples/client/petstore/python/petstore_api/models/cat.py similarity index 100% rename from samples/client/petstore/python/swagger_client/models/cat.py rename to samples/client/petstore/python/petstore_api/models/cat.py diff --git a/samples/client/petstore/python/swagger_client/models/category.py b/samples/client/petstore/python/petstore_api/models/category.py similarity index 100% rename from samples/client/petstore/python/swagger_client/models/category.py rename to samples/client/petstore/python/petstore_api/models/category.py diff --git a/samples/client/petstore/python/swagger_client/models/dog.py b/samples/client/petstore/python/petstore_api/models/dog.py similarity index 100% rename from samples/client/petstore/python/swagger_client/models/dog.py rename to samples/client/petstore/python/petstore_api/models/dog.py diff --git a/samples/client/petstore/python/swagger_client/models/enum_class.py b/samples/client/petstore/python/petstore_api/models/enum_class.py similarity index 100% rename from samples/client/petstore/python/swagger_client/models/enum_class.py rename to samples/client/petstore/python/petstore_api/models/enum_class.py diff --git a/samples/client/petstore/python/swagger_client/models/enum_test.py b/samples/client/petstore/python/petstore_api/models/enum_test.py similarity index 100% rename from samples/client/petstore/python/swagger_client/models/enum_test.py rename to samples/client/petstore/python/petstore_api/models/enum_test.py diff --git a/samples/client/petstore/python/swagger_client/models/format_test.py b/samples/client/petstore/python/petstore_api/models/format_test.py similarity index 100% rename from samples/client/petstore/python/swagger_client/models/format_test.py rename to samples/client/petstore/python/petstore_api/models/format_test.py diff --git a/samples/client/petstore/python/swagger_client/models/mixed_properties_and_additional_properties_class.py b/samples/client/petstore/python/petstore_api/models/mixed_properties_and_additional_properties_class.py similarity index 100% rename from samples/client/petstore/python/swagger_client/models/mixed_properties_and_additional_properties_class.py rename to samples/client/petstore/python/petstore_api/models/mixed_properties_and_additional_properties_class.py diff --git a/samples/client/petstore/python/swagger_client/models/model_200_response.py b/samples/client/petstore/python/petstore_api/models/model_200_response.py similarity index 100% rename from samples/client/petstore/python/swagger_client/models/model_200_response.py rename to samples/client/petstore/python/petstore_api/models/model_200_response.py diff --git a/samples/client/petstore/python/swagger_client/models/model_return.py b/samples/client/petstore/python/petstore_api/models/model_return.py similarity index 100% rename from samples/client/petstore/python/swagger_client/models/model_return.py rename to samples/client/petstore/python/petstore_api/models/model_return.py diff --git a/samples/client/petstore/python/swagger_client/models/name.py b/samples/client/petstore/python/petstore_api/models/name.py similarity index 100% rename from samples/client/petstore/python/swagger_client/models/name.py rename to samples/client/petstore/python/petstore_api/models/name.py diff --git a/samples/client/petstore/python/swagger_client/models/order.py b/samples/client/petstore/python/petstore_api/models/order.py similarity index 100% rename from samples/client/petstore/python/swagger_client/models/order.py rename to samples/client/petstore/python/petstore_api/models/order.py diff --git a/samples/client/petstore/python/swagger_client/models/pet.py b/samples/client/petstore/python/petstore_api/models/pet.py similarity index 100% rename from samples/client/petstore/python/swagger_client/models/pet.py rename to samples/client/petstore/python/petstore_api/models/pet.py diff --git a/samples/client/petstore/python/swagger_client/models/read_only_first.py b/samples/client/petstore/python/petstore_api/models/read_only_first.py similarity index 100% rename from samples/client/petstore/python/swagger_client/models/read_only_first.py rename to samples/client/petstore/python/petstore_api/models/read_only_first.py diff --git a/samples/client/petstore/python/swagger_client/models/special_model_name.py b/samples/client/petstore/python/petstore_api/models/special_model_name.py similarity index 100% rename from samples/client/petstore/python/swagger_client/models/special_model_name.py rename to samples/client/petstore/python/petstore_api/models/special_model_name.py diff --git a/samples/client/petstore/python/swagger_client/models/tag.py b/samples/client/petstore/python/petstore_api/models/tag.py similarity index 100% rename from samples/client/petstore/python/swagger_client/models/tag.py rename to samples/client/petstore/python/petstore_api/models/tag.py diff --git a/samples/client/petstore/python/swagger_client/models/user.py b/samples/client/petstore/python/petstore_api/models/user.py similarity index 100% rename from samples/client/petstore/python/swagger_client/models/user.py rename to samples/client/petstore/python/petstore_api/models/user.py diff --git a/samples/client/petstore/python/swagger_client/rest.py b/samples/client/petstore/python/petstore_api/rest.py similarity index 100% rename from samples/client/petstore/python/swagger_client/rest.py rename to samples/client/petstore/python/petstore_api/rest.py diff --git a/samples/client/petstore/python/setup.cfg b/samples/client/petstore/python/setup.cfg index c9eef8726d6..26b7a359d58 100644 --- a/samples/client/petstore/python/setup.cfg +++ b/samples/client/petstore/python/setup.cfg @@ -4,7 +4,7 @@ verbosity=2 randomize=true exe=true with-coverage=true -cover-package=swagger_client +cover-package=petstore_api cover-erase=true [flake8] diff --git a/samples/client/petstore/python/setup.py b/samples/client/petstore/python/setup.py index 2029c83372c..b15651ff2b5 100644 --- a/samples/client/petstore/python/setup.py +++ b/samples/client/petstore/python/setup.py @@ -25,7 +25,7 @@ import sys from setuptools import setup, find_packages -NAME = "swagger_client" +NAME = "petstore_api" VERSION = "1.0.0" # To install the library, run the following diff --git a/samples/client/petstore/python/swagger_client.egg-info/PKG-INFO b/samples/client/petstore/python/swagger_client.egg-info/PKG-INFO deleted file mode 100644 index 494a1526640..00000000000 --- a/samples/client/petstore/python/swagger_client.egg-info/PKG-INFO +++ /dev/null @@ -1,12 +0,0 @@ -Metadata-Version: 1.0 -Name: swagger-client -Version: 1.0.0 -Summary: Swagger Petstore -Home-page: UNKNOWN -Author: UNKNOWN -Author-email: apiteam@swagger.io -License: UNKNOWN -Description: This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \ - -Keywords: Swagger,Swagger Petstore -Platform: UNKNOWN diff --git a/samples/client/petstore/python/swagger_client.egg-info/dependency_links.txt b/samples/client/petstore/python/swagger_client.egg-info/dependency_links.txt deleted file mode 100644 index 8b137891791..00000000000 --- a/samples/client/petstore/python/swagger_client.egg-info/dependency_links.txt +++ /dev/null @@ -1 +0,0 @@ - diff --git a/samples/client/petstore/python/swagger_client.egg-info/requires.txt b/samples/client/petstore/python/swagger_client.egg-info/requires.txt deleted file mode 100644 index 86355123cff..00000000000 --- a/samples/client/petstore/python/swagger_client.egg-info/requires.txt +++ /dev/null @@ -1,4 +0,0 @@ -urllib3 >= 1.15 -six >= 1.10 -certifi -python-dateutil diff --git a/samples/client/petstore/python/swagger_client.egg-info/top_level.txt b/samples/client/petstore/python/swagger_client.egg-info/top_level.txt deleted file mode 100644 index 01f6691e7ca..00000000000 --- a/samples/client/petstore/python/swagger_client.egg-info/top_level.txt +++ /dev/null @@ -1,3 +0,0 @@ -swagger_client -test -tests diff --git a/samples/client/petstore/python/test/test_additional_properties_class.py b/samples/client/petstore/python/test/test_additional_properties_class.py index f2370e4ea21..de3d2bcd8b6 100644 --- a/samples/client/petstore/python/test/test_additional_properties_class.py +++ b/samples/client/petstore/python/test/test_additional_properties_class.py @@ -28,9 +28,9 @@ import os import sys import unittest -import swagger_client -from swagger_client.rest import ApiException -from swagger_client.models.additional_properties_class import AdditionalPropertiesClass +import petstore_api +from petstore_api.rest import ApiException +from petstore_api.models.additional_properties_class import AdditionalPropertiesClass class TestAdditionalPropertiesClass(unittest.TestCase): @@ -46,7 +46,7 @@ class TestAdditionalPropertiesClass(unittest.TestCase): """ Test AdditionalPropertiesClass """ - model = swagger_client.models.additional_properties_class.AdditionalPropertiesClass() + model = petstore_api.models.additional_properties_class.AdditionalPropertiesClass() if __name__ == '__main__': diff --git a/samples/client/petstore/python/test/test_animal.py b/samples/client/petstore/python/test/test_animal.py index 83c8f872250..7db98a10170 100644 --- a/samples/client/petstore/python/test/test_animal.py +++ b/samples/client/petstore/python/test/test_animal.py @@ -28,9 +28,9 @@ import os import sys import unittest -import swagger_client -from swagger_client.rest import ApiException -from swagger_client.models.animal import Animal +import petstore_api +from petstore_api.rest import ApiException +from petstore_api.models.animal import Animal class TestAnimal(unittest.TestCase): @@ -46,7 +46,7 @@ class TestAnimal(unittest.TestCase): """ Test Animal """ - model = swagger_client.models.animal.Animal() + model = petstore_api.models.animal.Animal() if __name__ == '__main__': diff --git a/samples/client/petstore/python/test/test_animal_farm.py b/samples/client/petstore/python/test/test_animal_farm.py index 637d259b1e8..e4ecbf50478 100644 --- a/samples/client/petstore/python/test/test_animal_farm.py +++ b/samples/client/petstore/python/test/test_animal_farm.py @@ -28,9 +28,9 @@ import os import sys import unittest -import swagger_client -from swagger_client.rest import ApiException -from swagger_client.models.animal_farm import AnimalFarm +import petstore_api +from petstore_api.rest import ApiException +from petstore_api.models.animal_farm import AnimalFarm class TestAnimalFarm(unittest.TestCase): @@ -46,7 +46,7 @@ class TestAnimalFarm(unittest.TestCase): """ Test AnimalFarm """ - model = swagger_client.models.animal_farm.AnimalFarm() + model = petstore_api.models.animal_farm.AnimalFarm() if __name__ == '__main__': diff --git a/samples/client/petstore/python/test/test_api_response.py b/samples/client/petstore/python/test/test_api_response.py index 6ee0ef03ae9..9c62f641cd7 100644 --- a/samples/client/petstore/python/test/test_api_response.py +++ b/samples/client/petstore/python/test/test_api_response.py @@ -28,9 +28,9 @@ import os import sys import unittest -import swagger_client -from swagger_client.rest import ApiException -from swagger_client.models.api_response import ApiResponse +import petstore_api +from petstore_api.rest import ApiException +from petstore_api.models.api_response import ApiResponse class TestApiResponse(unittest.TestCase): @@ -46,7 +46,7 @@ class TestApiResponse(unittest.TestCase): """ Test ApiResponse """ - model = swagger_client.models.api_response.ApiResponse() + model = petstore_api.models.api_response.ApiResponse() if __name__ == '__main__': diff --git a/samples/client/petstore/python/test/test_array_test.py b/samples/client/petstore/python/test/test_array_test.py index 7d2e9ff9fe9..a5509779cc5 100644 --- a/samples/client/petstore/python/test/test_array_test.py +++ b/samples/client/petstore/python/test/test_array_test.py @@ -28,9 +28,9 @@ import os import sys import unittest -import swagger_client -from swagger_client.rest import ApiException -from swagger_client.models.array_test import ArrayTest +import petstore_api +from petstore_api.rest import ApiException +from petstore_api.models.array_test import ArrayTest class TestArrayTest(unittest.TestCase): @@ -46,7 +46,7 @@ class TestArrayTest(unittest.TestCase): """ Test ArrayTest """ - model = swagger_client.models.array_test.ArrayTest() + model = petstore_api.models.array_test.ArrayTest() if __name__ == '__main__': diff --git a/samples/client/petstore/python/test/test_cat.py b/samples/client/petstore/python/test/test_cat.py index 8baccfa294d..3a9f7f1b75d 100644 --- a/samples/client/petstore/python/test/test_cat.py +++ b/samples/client/petstore/python/test/test_cat.py @@ -28,9 +28,9 @@ import os import sys import unittest -import swagger_client -from swagger_client.rest import ApiException -from swagger_client.models.cat import Cat +import petstore_api +from petstore_api.rest import ApiException +from petstore_api.models.cat import Cat class TestCat(unittest.TestCase): @@ -46,7 +46,7 @@ class TestCat(unittest.TestCase): """ Test Cat """ - model = swagger_client.models.cat.Cat() + model = petstore_api.models.cat.Cat() if __name__ == '__main__': diff --git a/samples/client/petstore/python/test/test_category.py b/samples/client/petstore/python/test/test_category.py index ff57ffb1f7d..f4f43796675 100644 --- a/samples/client/petstore/python/test/test_category.py +++ b/samples/client/petstore/python/test/test_category.py @@ -28,9 +28,9 @@ import os import sys import unittest -import swagger_client -from swagger_client.rest import ApiException -from swagger_client.models.category import Category +import petstore_api +from petstore_api.rest import ApiException +from petstore_api.models.category import Category class TestCategory(unittest.TestCase): @@ -46,7 +46,7 @@ class TestCategory(unittest.TestCase): """ Test Category """ - model = swagger_client.models.category.Category() + model = petstore_api.models.category.Category() if __name__ == '__main__': diff --git a/samples/client/petstore/python/test/test_dog.py b/samples/client/petstore/python/test/test_dog.py index cb44931140e..6bac6d65c30 100644 --- a/samples/client/petstore/python/test/test_dog.py +++ b/samples/client/petstore/python/test/test_dog.py @@ -28,9 +28,9 @@ import os import sys import unittest -import swagger_client -from swagger_client.rest import ApiException -from swagger_client.models.dog import Dog +import petstore_api +from petstore_api.rest import ApiException +from petstore_api.models.dog import Dog class TestDog(unittest.TestCase): @@ -46,7 +46,7 @@ class TestDog(unittest.TestCase): """ Test Dog """ - model = swagger_client.models.dog.Dog() + model = petstore_api.models.dog.Dog() if __name__ == '__main__': diff --git a/samples/client/petstore/python/test/test_enum_class.py b/samples/client/petstore/python/test/test_enum_class.py index 488e8306c8f..6d9c50255df 100644 --- a/samples/client/petstore/python/test/test_enum_class.py +++ b/samples/client/petstore/python/test/test_enum_class.py @@ -28,9 +28,9 @@ import os import sys import unittest -import swagger_client -from swagger_client.rest import ApiException -from swagger_client.models.enum_class import EnumClass +import petstore_api +from petstore_api.rest import ApiException +from petstore_api.models.enum_class import EnumClass class TestEnumClass(unittest.TestCase): @@ -46,7 +46,7 @@ class TestEnumClass(unittest.TestCase): """ Test EnumClass """ - model = swagger_client.models.enum_class.EnumClass() + model = petstore_api.models.enum_class.EnumClass() if __name__ == '__main__': diff --git a/samples/client/petstore/python/test/test_enum_test.py b/samples/client/petstore/python/test/test_enum_test.py index bbe985aeeaf..aa8d86a6d78 100644 --- a/samples/client/petstore/python/test/test_enum_test.py +++ b/samples/client/petstore/python/test/test_enum_test.py @@ -28,9 +28,9 @@ import os import sys import unittest -import swagger_client -from swagger_client.rest import ApiException -from swagger_client.models.enum_test import EnumTest +import petstore_api +from petstore_api.rest import ApiException +from petstore_api.models.enum_test import EnumTest class TestEnumTest(unittest.TestCase): @@ -46,7 +46,7 @@ class TestEnumTest(unittest.TestCase): """ Test EnumTest """ - model = swagger_client.models.enum_test.EnumTest() + model = petstore_api.models.enum_test.EnumTest() if __name__ == '__main__': diff --git a/samples/client/petstore/python/test/test_fake_api.py b/samples/client/petstore/python/test/test_fake_api.py index fb480485829..cddf28289ba 100644 --- a/samples/client/petstore/python/test/test_fake_api.py +++ b/samples/client/petstore/python/test/test_fake_api.py @@ -28,16 +28,16 @@ import os import sys import unittest -import swagger_client -from swagger_client.rest import ApiException -from swagger_client.apis.fake_api import FakeApi +import petstore_api +from petstore_api.rest import ApiException +from petstore_api.apis.fake_api import FakeApi class TestFakeApi(unittest.TestCase): """ FakeApi unit test stubs """ def setUp(self): - self.api = swagger_client.apis.fake_api.FakeApi() + self.api = petstore_api.apis.fake_api.FakeApi() def tearDown(self): pass diff --git a/samples/client/petstore/python/test/test_format_test.py b/samples/client/petstore/python/test/test_format_test.py index 966a0887f0a..2c3d0039dce 100644 --- a/samples/client/petstore/python/test/test_format_test.py +++ b/samples/client/petstore/python/test/test_format_test.py @@ -28,9 +28,9 @@ import os import sys import unittest -import swagger_client -from swagger_client.rest import ApiException -from swagger_client.models.format_test import FormatTest +import petstore_api +from petstore_api.rest import ApiException +from petstore_api.models.format_test import FormatTest class TestFormatTest(unittest.TestCase): @@ -46,7 +46,7 @@ class TestFormatTest(unittest.TestCase): """ Test FormatTest """ - model = swagger_client.models.format_test.FormatTest() + model = petstore_api.models.format_test.FormatTest() if __name__ == '__main__': diff --git a/samples/client/petstore/python/test/test_mixed_properties_and_additional_properties_class.py b/samples/client/petstore/python/test/test_mixed_properties_and_additional_properties_class.py index f19e0211af7..90f13e029e2 100644 --- a/samples/client/petstore/python/test/test_mixed_properties_and_additional_properties_class.py +++ b/samples/client/petstore/python/test/test_mixed_properties_and_additional_properties_class.py @@ -28,9 +28,9 @@ import os import sys import unittest -import swagger_client -from swagger_client.rest import ApiException -from swagger_client.models.mixed_properties_and_additional_properties_class import MixedPropertiesAndAdditionalPropertiesClass +import petstore_api +from petstore_api.rest import ApiException +from petstore_api.models.mixed_properties_and_additional_properties_class import MixedPropertiesAndAdditionalPropertiesClass class TestMixedPropertiesAndAdditionalPropertiesClass(unittest.TestCase): @@ -46,7 +46,7 @@ class TestMixedPropertiesAndAdditionalPropertiesClass(unittest.TestCase): """ Test MixedPropertiesAndAdditionalPropertiesClass """ - model = swagger_client.models.mixed_properties_and_additional_properties_class.MixedPropertiesAndAdditionalPropertiesClass() + model = petstore_api.models.mixed_properties_and_additional_properties_class.MixedPropertiesAndAdditionalPropertiesClass() if __name__ == '__main__': diff --git a/samples/client/petstore/python/test/test_model_200_response.py b/samples/client/petstore/python/test/test_model_200_response.py index 74519b4bac5..0b30fa81c89 100644 --- a/samples/client/petstore/python/test/test_model_200_response.py +++ b/samples/client/petstore/python/test/test_model_200_response.py @@ -28,9 +28,9 @@ import os import sys import unittest -import swagger_client -from swagger_client.rest import ApiException -from swagger_client.models.model_200_response import Model200Response +import petstore_api +from petstore_api.rest import ApiException +from petstore_api.models.model_200_response import Model200Response class TestModel200Response(unittest.TestCase): @@ -46,7 +46,7 @@ class TestModel200Response(unittest.TestCase): """ Test Model200Response """ - model = swagger_client.models.model_200_response.Model200Response() + model = petstore_api.models.model_200_response.Model200Response() if __name__ == '__main__': diff --git a/samples/client/petstore/python/test/test_model_return.py b/samples/client/petstore/python/test/test_model_return.py index 54c9422545d..149d658c7cf 100644 --- a/samples/client/petstore/python/test/test_model_return.py +++ b/samples/client/petstore/python/test/test_model_return.py @@ -28,9 +28,9 @@ import os import sys import unittest -import swagger_client -from swagger_client.rest import ApiException -from swagger_client.models.model_return import ModelReturn +import petstore_api +from petstore_api.rest import ApiException +from petstore_api.models.model_return import ModelReturn class TestModelReturn(unittest.TestCase): @@ -46,7 +46,7 @@ class TestModelReturn(unittest.TestCase): """ Test ModelReturn """ - model = swagger_client.models.model_return.ModelReturn() + model = petstore_api.models.model_return.ModelReturn() if __name__ == '__main__': diff --git a/samples/client/petstore/python/test/test_name.py b/samples/client/petstore/python/test/test_name.py index be10b1ddd78..ae3b6106d62 100644 --- a/samples/client/petstore/python/test/test_name.py +++ b/samples/client/petstore/python/test/test_name.py @@ -28,9 +28,9 @@ import os import sys import unittest -import swagger_client -from swagger_client.rest import ApiException -from swagger_client.models.name import Name +import petstore_api +from petstore_api.rest import ApiException +from petstore_api.models.name import Name class TestName(unittest.TestCase): @@ -46,7 +46,7 @@ class TestName(unittest.TestCase): """ Test Name """ - model = swagger_client.models.name.Name() + model = petstore_api.models.name.Name() if __name__ == '__main__': diff --git a/samples/client/petstore/python/test/test_order.py b/samples/client/petstore/python/test/test_order.py index 21c2b4830d9..e2a1290ffc7 100644 --- a/samples/client/petstore/python/test/test_order.py +++ b/samples/client/petstore/python/test/test_order.py @@ -28,9 +28,9 @@ import os import sys import unittest -import swagger_client -from swagger_client.rest import ApiException -from swagger_client.models.order import Order +import petstore_api +from petstore_api.rest import ApiException +from petstore_api.models.order import Order class TestOrder(unittest.TestCase): @@ -46,7 +46,7 @@ class TestOrder(unittest.TestCase): """ Test Order """ - model = swagger_client.models.order.Order() + model = petstore_api.models.order.Order() if __name__ == '__main__': diff --git a/samples/client/petstore/python/test/test_pet.py b/samples/client/petstore/python/test/test_pet.py index fc0ce0a727c..9148c0ac119 100644 --- a/samples/client/petstore/python/test/test_pet.py +++ b/samples/client/petstore/python/test/test_pet.py @@ -28,9 +28,9 @@ import os import sys import unittest -import swagger_client -from swagger_client.rest import ApiException -from swagger_client.models.pet import Pet +import petstore_api +from petstore_api.rest import ApiException +from petstore_api.models.pet import Pet class TestPet(unittest.TestCase): @@ -46,7 +46,7 @@ class TestPet(unittest.TestCase): """ Test Pet """ - model = swagger_client.models.pet.Pet() + model = petstore_api.models.pet.Pet() if __name__ == '__main__': diff --git a/samples/client/petstore/python/test/test_pet_api.py b/samples/client/petstore/python/test/test_pet_api.py index 8ea0c9c0acd..c9ef2d87c45 100644 --- a/samples/client/petstore/python/test/test_pet_api.py +++ b/samples/client/petstore/python/test/test_pet_api.py @@ -28,16 +28,16 @@ import os import sys import unittest -import swagger_client -from swagger_client.rest import ApiException -from swagger_client.apis.pet_api import PetApi +import petstore_api +from petstore_api.rest import ApiException +from petstore_api.apis.pet_api import PetApi class TestPetApi(unittest.TestCase): """ PetApi unit test stubs """ def setUp(self): - self.api = swagger_client.apis.pet_api.PetApi() + self.api = petstore_api.apis.pet_api.PetApi() def tearDown(self): pass diff --git a/samples/client/petstore/python/test/test_read_only_first.py b/samples/client/petstore/python/test/test_read_only_first.py index ea7a0ad76e8..3579ebefb48 100644 --- a/samples/client/petstore/python/test/test_read_only_first.py +++ b/samples/client/petstore/python/test/test_read_only_first.py @@ -28,9 +28,9 @@ import os import sys import unittest -import swagger_client -from swagger_client.rest import ApiException -from swagger_client.models.read_only_first import ReadOnlyFirst +import petstore_api +from petstore_api.rest import ApiException +from petstore_api.models.read_only_first import ReadOnlyFirst class TestReadOnlyFirst(unittest.TestCase): @@ -46,7 +46,7 @@ class TestReadOnlyFirst(unittest.TestCase): """ Test ReadOnlyFirst """ - model = swagger_client.models.read_only_first.ReadOnlyFirst() + model = petstore_api.models.read_only_first.ReadOnlyFirst() if __name__ == '__main__': diff --git a/samples/client/petstore/python/test/test_special_model_name.py b/samples/client/petstore/python/test/test_special_model_name.py index e76bc9bbf9b..1991883e3c1 100644 --- a/samples/client/petstore/python/test/test_special_model_name.py +++ b/samples/client/petstore/python/test/test_special_model_name.py @@ -28,9 +28,9 @@ import os import sys import unittest -import swagger_client -from swagger_client.rest import ApiException -from swagger_client.models.special_model_name import SpecialModelName +import petstore_api +from petstore_api.rest import ApiException +from petstore_api.models.special_model_name import SpecialModelName class TestSpecialModelName(unittest.TestCase): @@ -46,7 +46,7 @@ class TestSpecialModelName(unittest.TestCase): """ Test SpecialModelName """ - model = swagger_client.models.special_model_name.SpecialModelName() + model = petstore_api.models.special_model_name.SpecialModelName() if __name__ == '__main__': diff --git a/samples/client/petstore/python/test/test_store_api.py b/samples/client/petstore/python/test/test_store_api.py index ecce38463b5..0278685372b 100644 --- a/samples/client/petstore/python/test/test_store_api.py +++ b/samples/client/petstore/python/test/test_store_api.py @@ -28,16 +28,16 @@ import os import sys import unittest -import swagger_client -from swagger_client.rest import ApiException -from swagger_client.apis.store_api import StoreApi +import petstore_api +from petstore_api.rest import ApiException +from petstore_api.apis.store_api import StoreApi class TestStoreApi(unittest.TestCase): """ StoreApi unit test stubs """ def setUp(self): - self.api = swagger_client.apis.store_api.StoreApi() + self.api = petstore_api.apis.store_api.StoreApi() def tearDown(self): pass diff --git a/samples/client/petstore/python/test/test_tag.py b/samples/client/petstore/python/test/test_tag.py index db35da374ae..c86dcbb1d5f 100644 --- a/samples/client/petstore/python/test/test_tag.py +++ b/samples/client/petstore/python/test/test_tag.py @@ -28,9 +28,9 @@ import os import sys import unittest -import swagger_client -from swagger_client.rest import ApiException -from swagger_client.models.tag import Tag +import petstore_api +from petstore_api.rest import ApiException +from petstore_api.models.tag import Tag class TestTag(unittest.TestCase): @@ -46,7 +46,7 @@ class TestTag(unittest.TestCase): """ Test Tag """ - model = swagger_client.models.tag.Tag() + model = petstore_api.models.tag.Tag() if __name__ == '__main__': diff --git a/samples/client/petstore/python/test/test_user.py b/samples/client/petstore/python/test/test_user.py index e57b3600f0e..328c07baa88 100644 --- a/samples/client/petstore/python/test/test_user.py +++ b/samples/client/petstore/python/test/test_user.py @@ -28,9 +28,9 @@ import os import sys import unittest -import swagger_client -from swagger_client.rest import ApiException -from swagger_client.models.user import User +import petstore_api +from petstore_api.rest import ApiException +from petstore_api.models.user import User class TestUser(unittest.TestCase): @@ -46,7 +46,7 @@ class TestUser(unittest.TestCase): """ Test User """ - model = swagger_client.models.user.User() + model = petstore_api.models.user.User() if __name__ == '__main__': diff --git a/samples/client/petstore/python/test/test_user_api.py b/samples/client/petstore/python/test/test_user_api.py index 88c2f862983..032d00af315 100644 --- a/samples/client/petstore/python/test/test_user_api.py +++ b/samples/client/petstore/python/test/test_user_api.py @@ -28,16 +28,16 @@ import os import sys import unittest -import swagger_client -from swagger_client.rest import ApiException -from swagger_client.apis.user_api import UserApi +import petstore_api +from petstore_api.rest import ApiException +from petstore_api.apis.user_api import UserApi class TestUserApi(unittest.TestCase): """ UserApi unit test stubs """ def setUp(self): - self.api = swagger_client.apis.user_api.UserApi() + self.api = petstore_api.apis.user_api.UserApi() def tearDown(self): pass diff --git a/samples/client/petstore/python/tests/test_api_client.py b/samples/client/petstore/python/tests/test_api_client.py index 61c57cb7e46..972175835f3 100644 --- a/samples/client/petstore/python/tests/test_api_client.py +++ b/samples/client/petstore/python/tests/test_api_client.py @@ -12,8 +12,8 @@ import time import unittest from dateutil.parser import parse -import swagger_client -import swagger_client.configuration +import petstore_api +import petstore_api.configuration HOST = 'http://petstore.swagger.io/v2' @@ -21,20 +21,20 @@ HOST = 'http://petstore.swagger.io/v2' class ApiClientTests(unittest.TestCase): def setUp(self): - self.api_client = swagger_client.ApiClient(HOST) + self.api_client = petstore_api.ApiClient(HOST) def test_configuration(self): - swagger_client.configuration.api_key['api_key'] = '123456' - swagger_client.configuration.api_key_prefix['api_key'] = 'PREFIX' - swagger_client.configuration.username = 'test_username' - swagger_client.configuration.password = 'test_password' + petstore_api.configuration.api_key['api_key'] = '123456' + petstore_api.configuration.api_key_prefix['api_key'] = 'PREFIX' + petstore_api.configuration.username = 'test_username' + petstore_api.configuration.password = 'test_password' header_params = {'test1': 'value1'} query_params = {'test2': 'value2'} auth_settings = ['api_key', 'unknown'] # test prefix - self.assertEqual('PREFIX', swagger_client.configuration.api_key_prefix['api_key']) + self.assertEqual('PREFIX', petstore_api.configuration.api_key_prefix['api_key']) # update parameters based on auth setting self.api_client.update_params_for_auth(header_params, query_params, auth_settings) @@ -45,8 +45,8 @@ class ApiClientTests(unittest.TestCase): self.assertEqual(query_params['test2'], 'value2') # test basic auth - self.assertEqual('test_username', swagger_client.configuration.username) - self.assertEqual('test_password', swagger_client.configuration.password) + self.assertEqual('test_username', petstore_api.configuration.username) + self.assertEqual('test_password', petstore_api.configuration.password) def test_select_header_accept(self): accepts = ['APPLICATION/JSON', 'APPLICATION/XML'] @@ -139,17 +139,17 @@ class ApiClientTests(unittest.TestCase): "status": "available", "photoUrls": ["http://foo.bar.com/3", "http://foo.bar.com/4"]} - pet = swagger_client.Pet() + pet = petstore_api.Pet() pet.id = pet_dict["id"] pet.name = pet_dict["name"] - cate = swagger_client.Category() + cate = petstore_api.Category() cate.id = pet_dict["category"]["id"] cate.name = pet_dict["category"]["name"] pet.category = cate - tag1 = swagger_client.Tag() + tag1 = petstore_api.Tag() tag1.id = pet_dict["tags"][0]["id"] tag1.name = pet_dict["tags"][0]["name"] - tag2 = swagger_client.Tag() + tag2 = petstore_api.Tag() tag2.id = pet_dict["tags"][1]["id"] tag2.name = pet_dict["tags"][1]["name"] pet.tags = [tag1, tag2] diff --git a/samples/client/petstore/python/tests/test_api_exception.py b/samples/client/petstore/python/tests/test_api_exception.py index 96ca4e7bfbc..8df2b681f01 100644 --- a/samples/client/petstore/python/tests/test_api_exception.py +++ b/samples/client/petstore/python/tests/test_api_exception.py @@ -3,7 +3,7 @@ """ Run the tests. $ pip install nose (optional) -$ cd swagger_client-python +$ cd petstore_api-python $ nosetests -v """ @@ -12,25 +12,25 @@ import sys import time import unittest -import swagger_client -from swagger_client.rest import ApiException +import petstore_api +from petstore_api.rest import ApiException class ApiExceptionTests(unittest.TestCase): def setUp(self): - self.api_client = swagger_client.ApiClient() - self.pet_api = swagger_client.PetApi(self.api_client) + self.api_client = petstore_api.ApiClient() + self.pet_api = petstore_api.PetApi(self.api_client) self.setUpModels() def setUpModels(self): - self.category = swagger_client.Category() + self.category = petstore_api.Category() self.category.id = int(time.time()) self.category.name = "dog" - self.tag = swagger_client.Tag() + self.tag = petstore_api.Tag() self.tag.id = int(time.time()) self.tag.name = "blank" - self.pet = swagger_client.Pet() + self.pet = petstore_api.Pet() self.pet.id = int(time.time()) self.pet.name = "hello kity" self.pet.photo_urls = ["http://foo.bar.com/1", "http://foo.bar.com/2"] diff --git a/samples/client/petstore/python/tests/test_deserialization.py b/samples/client/petstore/python/tests/test_deserialization.py index e1d7e250b4b..143f22b64bd 100644 --- a/samples/client/petstore/python/tests/test_deserialization.py +++ b/samples/client/petstore/python/tests/test_deserialization.py @@ -11,13 +11,13 @@ import time import unittest import datetime -import swagger_client +import petstore_api class DeserializationTests(unittest.TestCase): def setUp(self): - self.api_client = swagger_client.ApiClient() + self.api_client = petstore_api.ApiClient() self.deserialize = self.api_client._ApiClient__deserialize def test_deserialize_dict_str_pet(self): @@ -45,7 +45,7 @@ class DeserializationTests(unittest.TestCase): deserialized = self.deserialize(data, 'dict(str, Pet)') self.assertTrue(isinstance(deserialized, dict)) - self.assertTrue(isinstance(deserialized['pet'], swagger_client.Pet)) + self.assertTrue(isinstance(deserialized['pet'], petstore_api.Pet)) def test_deserialize_dict_str_int(self): """ deserialize dict(str, int) """ @@ -96,10 +96,10 @@ class DeserializationTests(unittest.TestCase): "status": "available" } deserialized = self.deserialize(data, "Pet") - self.assertTrue(isinstance(deserialized, swagger_client.Pet)) + self.assertTrue(isinstance(deserialized, petstore_api.Pet)) self.assertEqual(deserialized.id, 0) self.assertEqual(deserialized.name, "doggie") - self.assertTrue(isinstance(deserialized.category, swagger_client.Category)) + self.assertTrue(isinstance(deserialized.category, petstore_api.Category)) self.assertEqual(deserialized.category.name, "string") self.assertTrue(isinstance(deserialized.tags, list)) self.assertEqual(deserialized.tags[0].name, "string") @@ -145,7 +145,7 @@ class DeserializationTests(unittest.TestCase): }] deserialized = self.deserialize(data, "list[Pet]") self.assertTrue(isinstance(deserialized, list)) - self.assertTrue(isinstance(deserialized[0], swagger_client.Pet)) + self.assertTrue(isinstance(deserialized[0], petstore_api.Pet)) self.assertEqual(deserialized[0].id, 0) self.assertEqual(deserialized[1].id, 1) self.assertEqual(deserialized[0].name, "doggie0") diff --git a/samples/client/petstore/python/tests/test_order_model.py b/samples/client/petstore/python/tests/test_order_model.py index e411ca0103d..710f3c175a9 100644 --- a/samples/client/petstore/python/tests/test_order_model.py +++ b/samples/client/petstore/python/tests/test_order_model.py @@ -3,7 +3,7 @@ """ Run the tests. $ pip install nose (optional) -$ cd swagger_client-python +$ cd petstore_api-python $ nosetests -v """ @@ -11,13 +11,13 @@ import os import time import unittest -import swagger_client +import petstore_api class OrderModelTests(unittest.TestCase): def test_status(self): - order = swagger_client.Order() + order = petstore_api.Order() order.status = "placed" self.assertEqual("placed", order.status) diff --git a/samples/client/petstore/python/tests/test_pet_api.py b/samples/client/petstore/python/tests/test_pet_api.py index 300a7bee783..4b749fc044a 100644 --- a/samples/client/petstore/python/tests/test_pet_api.py +++ b/samples/client/petstore/python/tests/test_pet_api.py @@ -3,7 +3,7 @@ """ Run the tests. $ pip install nose (optional) -$ cd swagger_client-python +$ cd petstore_api-python $ nosetests -v """ @@ -11,8 +11,8 @@ import os import time import unittest -import swagger_client -from swagger_client.rest import ApiException +import petstore_api +from petstore_api.rest import ApiException HOST = 'http://petstore.swagger.io/v2' @@ -20,8 +20,8 @@ HOST = 'http://petstore.swagger.io/v2' class PetApiTests(unittest.TestCase): def setUp(self): - self.api_client = swagger_client.ApiClient(HOST) - self.pet_api = swagger_client.PetApi(self.api_client) + self.api_client = petstore_api.ApiClient(HOST) + self.pet_api = petstore_api.PetApi(self.api_client) self.setUpModels() self.setUpFiles() @@ -30,13 +30,13 @@ class PetApiTests(unittest.TestCase): time.sleep(1) def setUpModels(self): - self.category = swagger_client.Category() + self.category = petstore_api.Category() self.category.id = int(time.time()) self.category.name = "dog" - self.tag = swagger_client.Tag() + self.tag = petstore_api.Tag() self.tag.id = int(time.time()) self.tag.name = "swagger-codegen-python-pet-tag" - self.pet = swagger_client.Pet() + self.pet = petstore_api.Pet() self.pet.id = int(time.time()) self.pet.name = "hello kity" self.pet.photo_urls = ["http://foo.bar.com/1", "http://foo.bar.com/2"] @@ -50,22 +50,22 @@ class PetApiTests(unittest.TestCase): self.foo = os.path.join(self.test_file_dir, "foo.png") def test_create_api_instance(self): - pet_api = swagger_client.PetApi() - pet_api2 = swagger_client.PetApi() - api_client3 = swagger_client.ApiClient() + pet_api = petstore_api.PetApi() + pet_api2 = petstore_api.PetApi() + api_client3 = petstore_api.ApiClient() api_client3.user_agent = 'api client 3' - api_client4 = swagger_client.ApiClient() + api_client4 = petstore_api.ApiClient() api_client4.user_agent = 'api client 4' - pet_api3 = swagger_client.PetApi(api_client3) + pet_api3 = petstore_api.PetApi(api_client3) # same default api client self.assertEqual(pet_api.api_client, pet_api2.api_client) # confirm using the default api client in the config module - self.assertEqual(pet_api.api_client, swagger_client.configuration.api_client) + self.assertEqual(pet_api.api_client, petstore_api.configuration.api_client) # 2 different api clients are not the same self.assertNotEqual(api_client3, api_client4) # customized pet api not using the default api client - self.assertNotEqual(pet_api3.api_client, swagger_client.configuration.api_client) + self.assertNotEqual(pet_api3.api_client, petstore_api.configuration.api_client) # customized pet api not using the old pet api's api client self.assertNotEqual(pet_api3.api_client, pet_api2.api_client) diff --git a/samples/client/petstore/python/tests/test_pet_model.py b/samples/client/petstore/python/tests/test_pet_model.py index d2bd3c9ca3d..52cb55061da 100644 --- a/samples/client/petstore/python/tests/test_pet_model.py +++ b/samples/client/petstore/python/tests/test_pet_model.py @@ -3,7 +3,7 @@ """ Run the tests. $ pip install nose (optional) -$ cd swagger_client-python +$ cd petstore_api-python $ nosetests -v """ @@ -11,22 +11,22 @@ import os import time import unittest -import swagger_client +import petstore_api class PetModelTests(unittest.TestCase): def setUp(self): - self.pet = swagger_client.Pet() + self.pet = petstore_api.Pet() self.pet.name = "test name" self.pet.id = 1 self.pet.photo_urls = ["string"] self.pet.status = "available" - cate = swagger_client.Category() + cate = petstore_api.Category() cate.id = 1 cate.name = "dog" self.pet.category = cate - tag = swagger_client.Tag() + tag = petstore_api.Tag() tag.id = 1 self.pet.tags = [tag] @@ -40,29 +40,29 @@ class PetModelTests(unittest.TestCase): self.assertEqual(data, self.pet.to_str()) def test_equal(self): - self.pet1 = swagger_client.Pet() + self.pet1 = petstore_api.Pet() self.pet1.name = "test name" self.pet1.id = 1 self.pet1.photo_urls = ["string"] self.pet1.status = "available" - cate1 = swagger_client.Category() + cate1 = petstore_api.Category() cate1.id = 1 cate1.name = "dog" self.pet.category = cate1 - tag1 = swagger_client.Tag() + tag1 = petstore_api.Tag() tag1.id = 1 self.pet1.tags = [tag1] - self.pet2 = swagger_client.Pet() + self.pet2 = petstore_api.Pet() self.pet2.name = "test name" self.pet2.id = 1 self.pet2.photo_urls = ["string"] self.pet2.status = "available" - cate2 = swagger_client.Category() + cate2 = petstore_api.Category() cate2.id = 1 cate2.name = "dog" self.pet.category = cate2 - tag2 = swagger_client.Tag() + tag2 = petstore_api.Tag() tag2.id = 1 self.pet2.tags = [tag2] diff --git a/samples/client/petstore/python/tests/test_store_api.py b/samples/client/petstore/python/tests/test_store_api.py index 42b92d0879c..b7e80281707 100644 --- a/samples/client/petstore/python/tests/test_store_api.py +++ b/samples/client/petstore/python/tests/test_store_api.py @@ -11,14 +11,14 @@ import os import time import unittest -import swagger_client -from swagger_client.rest import ApiException +import petstore_api +from petstore_api.rest import ApiException class StoreApiTests(unittest.TestCase): def setUp(self): - self.store_api = swagger_client.StoreApi() + self.store_api = petstore_api.StoreApi() def tearDown(self): # sleep 1 sec between two every 2 tests