Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
fix tests
  • Loading branch information
wing328 committed Jan 23, 2019
commit 0a2961532f381495353339f21d8c1403418235ef
Original file line number Diff line number Diff line change
Expand Up @@ -305,9 +305,9 @@ class Configuration(six.with_metaclass(TypeWithDefault, object)):
if variables[variable_name] in server['variables'][variable_name]['enum_values']:
url = url.replace("{" + variable_name + "}", variables[variable_name])
else:
raise ValueError("The variable `{}` in the host URL has invalid value {}. Must be {}.".format(variable_name, variables[variable_name], server['variables'][variable_name]['enum_values'])) # noqa: E501
raise ValueError("The variable `{}` in the host URL has invalid value {}. Must be {}.".format(variable_name, variables[variable_name], server['variables'][variable_name]['enum_values'])) # noqa: E501
else:
# use default value
url = url.replace("{" + variable_name + "}", server['variables'][variable_name]['default_value']) # noqa: E501
url = url.replace("{" + variable_name + "}", server['variables'][variable_name]['default_value']) # noqa: E501

return url
6 changes: 4 additions & 2 deletions samples/client/petstore/python-asyncio/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -53,11 +53,11 @@ from pprint import pprint

# create an instance of the API class
api_instance = petstore_api.AnotherFakeApi(petstore_api.ApiClient(configuration))
client = petstore_api.Client() # Client | client model
body = petstore_api.Client() # Client | client model

try:
# To test special tags
api_response = api_instance.call_123_test_special_tags(client)
api_response = api_instance.call_123_test_special_tags(body)
pprint(api_response)
except ApiException as e:
print("Exception when calling AnotherFakeApi->call_123_test_special_tags: %s\n" % e)
Expand Down Expand Up @@ -142,6 +142,8 @@ Class | Method | HTTP request | Description
- [ReadOnlyFirst](docs/ReadOnlyFirst.md)
- [SpecialModelName](docs/SpecialModelName.md)
- [Tag](docs/Tag.md)
- [TypeHolderDefault](docs/TypeHolderDefault.md)
- [TypeHolderExample](docs/TypeHolderExample.md)
- [User](docs/User.md)


Expand Down
8 changes: 4 additions & 4 deletions samples/client/petstore/python-asyncio/docs/AnotherFakeApi.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ Method | HTTP request | Description


# **call_123_test_special_tags**
> Client call_123_test_special_tags(client)
> Client call_123_test_special_tags(body)

To test special tags

Expand All @@ -24,11 +24,11 @@ from pprint import pprint

# create an instance of the API class
api_instance = petstore_api.AnotherFakeApi()
client = petstore_api.Client() # Client | client model
body = petstore_api.Client() # Client | client model

try:
# To test special tags
api_response = api_instance.call_123_test_special_tags(client)
api_response = api_instance.call_123_test_special_tags(body)
pprint(api_response)
except ApiException as e:
print("Exception when calling AnotherFakeApi->call_123_test_special_tags: %s\n" % e)
Expand All @@ -38,7 +38,7 @@ except ApiException as e:

Name | Type | Description | Notes
------------- | ------------- | ------------- | -------------
**client** | [**Client**](Client.md)| client model |
**body** | [**Client**](Client.md)| client model |

### Return type

Expand Down
43 changes: 21 additions & 22 deletions samples/client/petstore/python-asyncio/docs/FakeApi.md
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ No authorization required
[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md)

# **fake_outer_composite_serialize**
> OuterComposite fake_outer_composite_serialize(outer_composite=outer_composite)
> OuterComposite fake_outer_composite_serialize(body=body)



Expand All @@ -82,10 +82,10 @@ from pprint import pprint

# create an instance of the API class
api_instance = petstore_api.FakeApi()
outer_composite = petstore_api.OuterComposite() # OuterComposite | Input composite as post body (optional)
body = petstore_api.OuterComposite() # OuterComposite | Input composite as post body (optional)

try:
api_response = api_instance.fake_outer_composite_serialize(outer_composite=outer_composite)
api_response = api_instance.fake_outer_composite_serialize(body=body)
pprint(api_response)
except ApiException as e:
print("Exception when calling FakeApi->fake_outer_composite_serialize: %s\n" % e)
Expand All @@ -95,7 +95,7 @@ except ApiException as e:

Name | Type | Description | Notes
------------- | ------------- | ------------- | -------------
**outer_composite** | [**OuterComposite**](OuterComposite.md)| Input composite as post body | [optional]
**body** | [**OuterComposite**](OuterComposite.md)| Input composite as post body | [optional]

### Return type

Expand Down Expand Up @@ -207,7 +207,7 @@ No authorization required
[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md)

# **test_body_with_file_schema**
> test_body_with_file_schema(file_schema_test_class)
> test_body_with_file_schema(body)



Expand All @@ -223,10 +223,10 @@ from pprint import pprint

# create an instance of the API class
api_instance = petstore_api.FakeApi()
file_schema_test_class = petstore_api.FileSchemaTestClass() # FileSchemaTestClass |
body = petstore_api.FileSchemaTestClass() # FileSchemaTestClass |

try:
api_instance.test_body_with_file_schema(file_schema_test_class)
api_instance.test_body_with_file_schema(body)
except ApiException as e:
print("Exception when calling FakeApi->test_body_with_file_schema: %s\n" % e)
```
Expand All @@ -235,7 +235,7 @@ except ApiException as e:

Name | Type | Description | Notes
------------- | ------------- | ------------- | -------------
**file_schema_test_class** | [**FileSchemaTestClass**](FileSchemaTestClass.md)| |
**body** | [**FileSchemaTestClass**](FileSchemaTestClass.md)| |

### Return type

Expand All @@ -253,7 +253,7 @@ No authorization required
[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md)

# **test_body_with_query_params**
> test_body_with_query_params(query, user)
> test_body_with_query_params(query, body)



Expand All @@ -268,10 +268,10 @@ from pprint import pprint
# create an instance of the API class
api_instance = petstore_api.FakeApi()
query = 'query_example' # str |
user = petstore_api.User() # User |
body = petstore_api.User() # User |

try:
api_instance.test_body_with_query_params(query, user)
api_instance.test_body_with_query_params(query, body)
except ApiException as e:
print("Exception when calling FakeApi->test_body_with_query_params: %s\n" % e)
```
Expand All @@ -281,7 +281,7 @@ except ApiException as e:
Name | Type | Description | Notes
------------- | ------------- | ------------- | -------------
**query** | **str**| |
**user** | [**User**](User.md)| |
**body** | [**User**](User.md)| |

### Return type

Expand All @@ -299,7 +299,7 @@ No authorization required
[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md)

# **test_client_model**
> Client test_client_model(client)
> Client test_client_model(body)

To test \"client\" model

Expand All @@ -315,11 +315,11 @@ from pprint import pprint

# create an instance of the API class
api_instance = petstore_api.FakeApi()
client = petstore_api.Client() # Client | client model
body = petstore_api.Client() # Client | client model

try:
# To test \"client\" model
api_response = api_instance.test_client_model(client)
api_response = api_instance.test_client_model(body)
pprint(api_response)
except ApiException as e:
print("Exception when calling FakeApi->test_client_model: %s\n" % e)
Expand All @@ -329,7 +329,7 @@ except ApiException as e:

Name | Type | Description | Notes
------------- | ------------- | ------------- | -------------
**client** | [**Client**](Client.md)| client model |
**body** | [**Client**](Client.md)| client model |

### Return type

Expand Down Expand Up @@ -362,9 +362,8 @@ import time
import petstore_api
from petstore_api.rest import ApiException
from pprint import pprint

# Configure HTTP basic authorization: http_basic_test
configuration = petstore_api.Configuration()
# Configure HTTP basic authorization: http_basic_test
configuration.username = 'YOUR_USERNAME'
configuration.password = 'YOUR_PASSWORD'

Expand Down Expand Up @@ -545,7 +544,7 @@ No authorization required
[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md)

# **test_inline_additional_properties**
> test_inline_additional_properties(request_body)
> test_inline_additional_properties(param)

test inline additionalProperties

Expand All @@ -559,11 +558,11 @@ from pprint import pprint

# create an instance of the API class
api_instance = petstore_api.FakeApi()
request_body = {'key': 'request_body_example'} # dict(str, str) | request body
param = {'key': 'param_example'} # dict(str, str) | request body

try:
# test inline additionalProperties
api_instance.test_inline_additional_properties(request_body)
api_instance.test_inline_additional_properties(param)
except ApiException as e:
print("Exception when calling FakeApi->test_inline_additional_properties: %s\n" % e)
```
Expand All @@ -572,7 +571,7 @@ except ApiException as e:

Name | Type | Description | Notes
------------- | ------------- | ------------- | -------------
**request_body** | [**dict(str, str)**](str.md)| request body |
**param** | [**dict(str, str)**](str.md)| request body |

### Return type

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ Method | HTTP request | Description


# **test_classname**
> Client test_classname(client)
> Client test_classname(body)

To test class name in snake case

Expand All @@ -23,20 +23,19 @@ import time
import petstore_api
from petstore_api.rest import ApiException
from pprint import pprint

# Configure API key authorization: api_key_query
configuration = petstore_api.Configuration()
# Configure API key authorization: api_key_query
configuration.api_key['api_key_query'] = 'YOUR_API_KEY'
# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
# configuration.api_key_prefix['api_key_query'] = 'Bearer'

# create an instance of the API class
api_instance = petstore_api.FakeClassnameTags123Api(petstore_api.ApiClient(configuration))
client = petstore_api.Client() # Client | client model
body = petstore_api.Client() # Client | client model

try:
# To test class name in snake case
api_response = api_instance.test_classname(client)
api_response = api_instance.test_classname(body)
pprint(api_response)
except ApiException as e:
print("Exception when calling FakeClassnameTags123Api->test_classname: %s\n" % e)
Expand All @@ -46,7 +45,7 @@ except ApiException as e:

Name | Type | Description | Notes
------------- | ------------- | ------------- | -------------
**client** | [**Client**](Client.md)| client model |
**body** | [**Client**](Client.md)| client model |

### Return type

Expand Down
2 changes: 1 addition & 1 deletion samples/client/petstore/python-asyncio/docs/Pet.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**id** | **int** | | [optional]
**category** | [**Category**](Category.md) | | [optional]
**name** | **str** | |
**name** | **str** | | [default to 'doggie']
**photo_urls** | **list[str]** | |
**tags** | [**list[Tag]**](Tag.md) | | [optional]
**status** | **str** | pet status in the store | [optional]
Expand Down
Loading