forked from loafle/openapi-generator-original
Merge pull request #2727 from scottrw93/test-cases
Add test cases for Python Client
This commit is contained in:
commit
6b3735e58d
@ -21,19 +21,28 @@ public class PythonClientCodegen extends DefaultCodegen implements CodegenConfig
|
|||||||
protected String apiDocPath = "docs/";
|
protected String apiDocPath = "docs/";
|
||||||
protected String modelDocPath = "docs/";
|
protected String modelDocPath = "docs/";
|
||||||
|
|
||||||
|
private String testFolder;
|
||||||
|
|
||||||
public PythonClientCodegen() {
|
public PythonClientCodegen() {
|
||||||
super();
|
super();
|
||||||
|
|
||||||
modelPackage = "models";
|
modelPackage = "models";
|
||||||
apiPackage = "api";
|
apiPackage = "api";
|
||||||
outputFolder = "generated-code" + File.separatorChar + "python";
|
outputFolder = "generated-code" + File.separatorChar + "python";
|
||||||
|
|
||||||
modelTemplateFiles.put("model.mustache", ".py");
|
modelTemplateFiles.put("model.mustache", ".py");
|
||||||
apiTemplateFiles.put("api.mustache", ".py");
|
apiTemplateFiles.put("api.mustache", ".py");
|
||||||
|
|
||||||
|
modelTestTemplateFiles.put("model_test.mustache", ".py");
|
||||||
|
apiTestTemplateFiles.put("api_test.mustache", ".py");
|
||||||
|
|
||||||
embeddedTemplateDir = templateDir = "python";
|
embeddedTemplateDir = templateDir = "python";
|
||||||
|
|
||||||
modelDocTemplateFiles.put("model_doc.mustache", ".md");
|
modelDocTemplateFiles.put("model_doc.mustache", ".md");
|
||||||
apiDocTemplateFiles.put("api_doc.mustache", ".md");
|
apiDocTemplateFiles.put("api_doc.mustache", ".md");
|
||||||
|
|
||||||
|
testFolder = "test";
|
||||||
|
|
||||||
languageSpecificPrimitives.clear();
|
languageSpecificPrimitives.clear();
|
||||||
languageSpecificPrimitives.add("int");
|
languageSpecificPrimitives.add("int");
|
||||||
languageSpecificPrimitives.add("float");
|
languageSpecificPrimitives.add("float");
|
||||||
@ -126,6 +135,7 @@ public class PythonClientCodegen extends DefaultCodegen implements CodegenConfig
|
|||||||
supportingFiles.add(new SupportingFile("__init__package.mustache", swaggerFolder, "__init__.py"));
|
supportingFiles.add(new SupportingFile("__init__package.mustache", swaggerFolder, "__init__.py"));
|
||||||
supportingFiles.add(new SupportingFile("__init__model.mustache", modelPackage, "__init__.py"));
|
supportingFiles.add(new SupportingFile("__init__model.mustache", modelPackage, "__init__.py"));
|
||||||
supportingFiles.add(new SupportingFile("__init__api.mustache", apiPackage, "__init__.py"));
|
supportingFiles.add(new SupportingFile("__init__api.mustache", apiPackage, "__init__.py"));
|
||||||
|
supportingFiles.add(new SupportingFile("__init__test.mustache", testFolder, "__init__.py"));
|
||||||
supportingFiles.add(new SupportingFile("git_push.sh.mustache", "", "git_push.sh"));
|
supportingFiles.add(new SupportingFile("git_push.sh.mustache", "", "git_push.sh"));
|
||||||
supportingFiles.add(new SupportingFile("gitignore.mustache", "", ".gitignore"));
|
supportingFiles.add(new SupportingFile("gitignore.mustache", "", ".gitignore"));
|
||||||
}
|
}
|
||||||
@ -185,6 +195,16 @@ public class PythonClientCodegen extends DefaultCodegen implements CodegenConfig
|
|||||||
return outputFolder + File.separatorChar + modelPackage().replace('.', File.separatorChar);
|
return outputFolder + File.separatorChar + modelPackage().replace('.', File.separatorChar);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public String apiTestFileFolder() {
|
||||||
|
return outputFolder + File.separatorChar + testFolder;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public String modelTestFileFolder() {
|
||||||
|
return outputFolder + File.separatorChar + testFolder;
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public String getTypeDeclaration(Property p) {
|
public String getTypeDeclaration(Property p) {
|
||||||
if (p instanceof ArrayProperty) {
|
if (p instanceof ArrayProperty) {
|
||||||
@ -311,6 +331,11 @@ public class PythonClientCodegen extends DefaultCodegen implements CodegenConfig
|
|||||||
return underscore(dropDots(name));
|
return underscore(dropDots(name));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public String toModelTestFilename(String name) {
|
||||||
|
return "test_" + toModelFilename(name);
|
||||||
|
};
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public String toApiFilename(String name) {
|
public String toApiFilename(String name) {
|
||||||
// replace - with _ e.g. created-at => created_at
|
// replace - with _ e.g. created-at => created_at
|
||||||
@ -320,6 +345,11 @@ public class PythonClientCodegen extends DefaultCodegen implements CodegenConfig
|
|||||||
return underscore(name) + "_api";
|
return underscore(name) + "_api";
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public String toApiTestFilename(String name) {
|
||||||
|
return "test_" + toApiFilename(name);
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public String toApiName(String name) {
|
public String toApiName(String name) {
|
||||||
if (name.length() == 0) {
|
if (name.length() == 0) {
|
||||||
|
@ -0,0 +1,54 @@
|
|||||||
|
# coding: utf-8
|
||||||
|
|
||||||
|
"""
|
||||||
|
Copyright 2016 SmartBear Software
|
||||||
|
|
||||||
|
Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
|
you may not use this file except in compliance with the License.
|
||||||
|
You may obtain a copy of the License at
|
||||||
|
|
||||||
|
http://www.apache.org/licenses/LICENSE-2.0
|
||||||
|
|
||||||
|
Unless required by applicable law or agreed to in writing, software
|
||||||
|
distributed under the License is distributed on an "AS IS" BASIS,
|
||||||
|
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||||
|
See the License for the specific language governing permissions and
|
||||||
|
limitations under the License.
|
||||||
|
|
||||||
|
ref: https://github.com/swagger-api/swagger-codegen
|
||||||
|
"""
|
||||||
|
|
||||||
|
from __future__ import absolute_import
|
||||||
|
|
||||||
|
import os
|
||||||
|
import sys
|
||||||
|
import unittest
|
||||||
|
|
||||||
|
import swagger_client
|
||||||
|
from swagger_client.rest import ApiException
|
||||||
|
from swagger_client.apis.{{classVarName}} import {{classname}}
|
||||||
|
|
||||||
|
|
||||||
|
class {{#operations}}Test{{classname}}(unittest.TestCase):
|
||||||
|
""" {{classname}} unit test stubs """
|
||||||
|
|
||||||
|
def setUp(self):
|
||||||
|
self.api = swagger_client.apis.{{classVarName}}.{{classname}}()
|
||||||
|
|
||||||
|
def tearDown(self):
|
||||||
|
pass
|
||||||
|
|
||||||
|
{{#operation}}
|
||||||
|
def test_{{operationId}}(self):
|
||||||
|
"""
|
||||||
|
Test case for {{{operationId}}}
|
||||||
|
|
||||||
|
{{{summary}}}
|
||||||
|
"""
|
||||||
|
pass
|
||||||
|
|
||||||
|
{{/operation}}
|
||||||
|
{{/operations}}
|
||||||
|
|
||||||
|
if __name__ == '__main__':
|
||||||
|
unittest.main()
|
@ -0,0 +1,53 @@
|
|||||||
|
# coding: utf-8
|
||||||
|
|
||||||
|
"""
|
||||||
|
Copyright 2016 SmartBear Software
|
||||||
|
|
||||||
|
Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
|
you may not use this file except in compliance with the License.
|
||||||
|
You may obtain a copy of the License at
|
||||||
|
|
||||||
|
http://www.apache.org/licenses/LICENSE-2.0
|
||||||
|
|
||||||
|
Unless required by applicable law or agreed to in writing, software
|
||||||
|
distributed under the License is distributed on an "AS IS" BASIS,
|
||||||
|
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||||
|
See the License for the specific language governing permissions and
|
||||||
|
limitations under the License.
|
||||||
|
|
||||||
|
ref: https://github.com/swagger-api/swagger-codegen
|
||||||
|
"""
|
||||||
|
|
||||||
|
from __future__ import absolute_import
|
||||||
|
|
||||||
|
import os
|
||||||
|
import sys
|
||||||
|
import unittest
|
||||||
|
|
||||||
|
{{#models}}
|
||||||
|
{{#model}}
|
||||||
|
import swagger_client
|
||||||
|
from swagger_client.rest import ApiException
|
||||||
|
from swagger_client.models.{{classFilename}} import {{classname}}
|
||||||
|
|
||||||
|
|
||||||
|
class Test{{classname}}(unittest.TestCase):
|
||||||
|
""" {{classname}} unit test stubs """
|
||||||
|
|
||||||
|
def setUp(self):
|
||||||
|
pass
|
||||||
|
|
||||||
|
def tearDown(self):
|
||||||
|
pass
|
||||||
|
|
||||||
|
def test{{classname}}(self):
|
||||||
|
"""
|
||||||
|
Test {{classname}}
|
||||||
|
"""
|
||||||
|
model = swagger_client.models.{{classFilename}}.{{classname}}()
|
||||||
|
|
||||||
|
{{/model}}
|
||||||
|
{{/models}}
|
||||||
|
|
||||||
|
if __name__ == '__main__':
|
||||||
|
unittest.main()
|
@ -5,7 +5,7 @@ This Python package is automatically generated by the [Swagger Codegen](https://
|
|||||||
|
|
||||||
- API version: 1.0.0
|
- API version: 1.0.0
|
||||||
- Package version: 1.0.0
|
- Package version: 1.0.0
|
||||||
- Build date: 2016-04-27T17:36:32.266+08:00
|
- Build date: 2016-04-27T22:50:21.115+01:00
|
||||||
- Build package: class io.swagger.codegen.languages.PythonClientCodegen
|
- Build package: class io.swagger.codegen.languages.PythonClientCodegen
|
||||||
|
|
||||||
## Requirements.
|
## Requirements.
|
||||||
|
77
samples/client/petstore/python/docs/FakeApi.md
Normal file
77
samples/client/petstore/python/docs/FakeApi.md
Normal file
@ -0,0 +1,77 @@
|
|||||||
|
# swagger_client.FakeApi
|
||||||
|
|
||||||
|
All URIs are relative to *http://petstore.swagger.io/v2*
|
||||||
|
|
||||||
|
Method | HTTP request | Description
|
||||||
|
------------- | ------------- | -------------
|
||||||
|
[**test_endpoint_parameters**](FakeApi.md#test_endpoint_parameters) | **POST** /fake | Fake endpoint for testing various parameters
|
||||||
|
|
||||||
|
|
||||||
|
# **test_endpoint_parameters**
|
||||||
|
> test_endpoint_parameters(number, double, string, byte, integer=integer, int32=int32, int64=int64, float=float, binary=binary, date=date, date_time=date_time, password=password)
|
||||||
|
|
||||||
|
Fake endpoint for testing various parameters
|
||||||
|
|
||||||
|
Fake endpoint for testing various parameters
|
||||||
|
|
||||||
|
### Example
|
||||||
|
```python
|
||||||
|
import time
|
||||||
|
import swagger_client
|
||||||
|
from swagger_client.rest import ApiException
|
||||||
|
from pprint import pprint
|
||||||
|
|
||||||
|
# create an instance of the API class
|
||||||
|
api_instance = swagger_client.FakeApi()
|
||||||
|
number = 3.4 # float | None
|
||||||
|
double = 1.2 # float | None
|
||||||
|
string = 'string_example' # str | None
|
||||||
|
byte = 'B' # str | None
|
||||||
|
integer = 56 # int | None (optional)
|
||||||
|
int32 = 56 # int | None (optional)
|
||||||
|
int64 = 789 # int | None (optional)
|
||||||
|
float = 3.4 # float | None (optional)
|
||||||
|
binary = 'B' # str | None (optional)
|
||||||
|
date = '2013-10-20' # date | None (optional)
|
||||||
|
date_time = '2013-10-20T19:20:30+01:00' # datetime | None (optional)
|
||||||
|
password = 'password_example' # str | None (optional)
|
||||||
|
|
||||||
|
try:
|
||||||
|
# Fake endpoint for testing various parameters
|
||||||
|
api_instance.test_endpoint_parameters(number, double, string, byte, integer=integer, int32=int32, int64=int64, float=float, binary=binary, date=date, date_time=date_time, password=password)
|
||||||
|
except ApiException as e:
|
||||||
|
print "Exception when calling FakeApi->test_endpoint_parameters: %s\n" % e
|
||||||
|
```
|
||||||
|
|
||||||
|
### Parameters
|
||||||
|
|
||||||
|
Name | Type | Description | Notes
|
||||||
|
------------- | ------------- | ------------- | -------------
|
||||||
|
**number** | **float**| None |
|
||||||
|
**double** | **float**| None |
|
||||||
|
**string** | **str**| None |
|
||||||
|
**byte** | **str**| None |
|
||||||
|
**integer** | **int**| None | [optional]
|
||||||
|
**int32** | **int**| None | [optional]
|
||||||
|
**int64** | **int**| None | [optional]
|
||||||
|
**float** | **float**| None | [optional]
|
||||||
|
**binary** | **str**| None | [optional]
|
||||||
|
**date** | **date**| None | [optional]
|
||||||
|
**date_time** | **datetime**| None | [optional]
|
||||||
|
**password** | **str**| None | [optional]
|
||||||
|
|
||||||
|
### Return type
|
||||||
|
|
||||||
|
void (empty response body)
|
||||||
|
|
||||||
|
### Authorization
|
||||||
|
|
||||||
|
No authorization required
|
||||||
|
|
||||||
|
### HTTP request headers
|
||||||
|
|
||||||
|
- **Content-Type**: Not defined
|
||||||
|
- **Accept**: application/xml, application/json
|
||||||
|
|
||||||
|
[[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)
|
||||||
|
|
@ -1,2 +1,3 @@
|
|||||||
swagger_client
|
swagger_client
|
||||||
|
test
|
||||||
tests
|
tests
|
||||||
|
165
samples/client/petstore/python/swagger_client/apis/fake_api.py
Normal file
165
samples/client/petstore/python/swagger_client/apis/fake_api.py
Normal file
@ -0,0 +1,165 @@
|
|||||||
|
# coding: utf-8
|
||||||
|
|
||||||
|
"""
|
||||||
|
FakeApi.py
|
||||||
|
Copyright 2016 SmartBear Software
|
||||||
|
|
||||||
|
Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
|
you may not use this file except in compliance with the License.
|
||||||
|
You may obtain a copy of the License at
|
||||||
|
|
||||||
|
http://www.apache.org/licenses/LICENSE-2.0
|
||||||
|
|
||||||
|
Unless required by applicable law or agreed to in writing, software
|
||||||
|
distributed under the License is distributed on an "AS IS" BASIS,
|
||||||
|
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||||
|
See the License for the specific language governing permissions and
|
||||||
|
limitations under the License.
|
||||||
|
"""
|
||||||
|
|
||||||
|
from __future__ import absolute_import
|
||||||
|
|
||||||
|
import sys
|
||||||
|
import os
|
||||||
|
|
||||||
|
# python 2 and python 3 compatibility library
|
||||||
|
from six import iteritems
|
||||||
|
|
||||||
|
from ..configuration import Configuration
|
||||||
|
from ..api_client import ApiClient
|
||||||
|
|
||||||
|
|
||||||
|
class FakeApi(object):
|
||||||
|
"""
|
||||||
|
NOTE: This class is auto generated by the swagger code generator program.
|
||||||
|
Do not edit the class manually.
|
||||||
|
Ref: https://github.com/swagger-api/swagger-codegen
|
||||||
|
"""
|
||||||
|
|
||||||
|
def __init__(self, api_client=None):
|
||||||
|
config = Configuration()
|
||||||
|
if api_client:
|
||||||
|
self.api_client = api_client
|
||||||
|
else:
|
||||||
|
if not config.api_client:
|
||||||
|
config.api_client = ApiClient()
|
||||||
|
self.api_client = config.api_client
|
||||||
|
|
||||||
|
def test_endpoint_parameters(self, number, double, string, byte, **kwargs):
|
||||||
|
"""
|
||||||
|
Fake endpoint for testing various parameters
|
||||||
|
Fake endpoint for testing various parameters
|
||||||
|
|
||||||
|
This method makes a synchronous HTTP request by default. To make an
|
||||||
|
asynchronous HTTP request, please define a `callback` function
|
||||||
|
to be invoked when receiving the response.
|
||||||
|
>>> def callback_function(response):
|
||||||
|
>>> pprint(response)
|
||||||
|
>>>
|
||||||
|
>>> thread = api.test_endpoint_parameters(number, double, string, byte, callback=callback_function)
|
||||||
|
|
||||||
|
:param callback function: The callback function
|
||||||
|
for asynchronous request. (optional)
|
||||||
|
:param float number: None (required)
|
||||||
|
:param float double: None (required)
|
||||||
|
:param str string: None (required)
|
||||||
|
:param str byte: None (required)
|
||||||
|
:param int integer: None
|
||||||
|
:param int int32: None
|
||||||
|
:param int int64: None
|
||||||
|
:param float float: None
|
||||||
|
:param str binary: None
|
||||||
|
:param date date: None
|
||||||
|
:param datetime date_time: None
|
||||||
|
:param str password: None
|
||||||
|
:return: None
|
||||||
|
If the method is called asynchronously,
|
||||||
|
returns the request thread.
|
||||||
|
"""
|
||||||
|
|
||||||
|
all_params = ['number', 'double', 'string', 'byte', 'integer', 'int32', 'int64', 'float', 'binary', 'date', 'date_time', 'password']
|
||||||
|
all_params.append('callback')
|
||||||
|
|
||||||
|
params = locals()
|
||||||
|
for key, val in iteritems(params['kwargs']):
|
||||||
|
if key not in all_params:
|
||||||
|
raise TypeError(
|
||||||
|
"Got an unexpected keyword argument '%s'"
|
||||||
|
" to method test_endpoint_parameters" % key
|
||||||
|
)
|
||||||
|
params[key] = val
|
||||||
|
del params['kwargs']
|
||||||
|
|
||||||
|
# verify the required parameter 'number' is set
|
||||||
|
if ('number' not in params) or (params['number'] is None):
|
||||||
|
raise ValueError("Missing the required parameter `number` when calling `test_endpoint_parameters`")
|
||||||
|
# verify the required parameter 'double' is set
|
||||||
|
if ('double' not in params) or (params['double'] is None):
|
||||||
|
raise ValueError("Missing the required parameter `double` when calling `test_endpoint_parameters`")
|
||||||
|
# verify the required parameter 'string' is set
|
||||||
|
if ('string' not in params) or (params['string'] is None):
|
||||||
|
raise ValueError("Missing the required parameter `string` when calling `test_endpoint_parameters`")
|
||||||
|
# verify the required parameter 'byte' is set
|
||||||
|
if ('byte' not in params) or (params['byte'] is None):
|
||||||
|
raise ValueError("Missing the required parameter `byte` when calling `test_endpoint_parameters`")
|
||||||
|
|
||||||
|
resource_path = '/fake'.replace('{format}', 'json')
|
||||||
|
path_params = {}
|
||||||
|
|
||||||
|
query_params = {}
|
||||||
|
|
||||||
|
header_params = {}
|
||||||
|
|
||||||
|
form_params = []
|
||||||
|
local_var_files = {}
|
||||||
|
if 'integer' in params:
|
||||||
|
form_params.append(('integer', params['integer']))
|
||||||
|
if 'int32' in params:
|
||||||
|
form_params.append(('int32', params['int32']))
|
||||||
|
if 'int64' in params:
|
||||||
|
form_params.append(('int64', params['int64']))
|
||||||
|
if 'number' in params:
|
||||||
|
form_params.append(('number', params['number']))
|
||||||
|
if 'float' in params:
|
||||||
|
form_params.append(('float', params['float']))
|
||||||
|
if 'double' in params:
|
||||||
|
form_params.append(('double', params['double']))
|
||||||
|
if 'string' in params:
|
||||||
|
form_params.append(('string', params['string']))
|
||||||
|
if 'byte' in params:
|
||||||
|
form_params.append(('byte', params['byte']))
|
||||||
|
if 'binary' in params:
|
||||||
|
form_params.append(('binary', params['binary']))
|
||||||
|
if 'date' in params:
|
||||||
|
form_params.append(('date', params['date']))
|
||||||
|
if 'date_time' in params:
|
||||||
|
form_params.append(('dateTime', params['date_time']))
|
||||||
|
if 'password' in params:
|
||||||
|
form_params.append(('password', params['password']))
|
||||||
|
|
||||||
|
body_params = None
|
||||||
|
|
||||||
|
# HTTP header `Accept`
|
||||||
|
header_params['Accept'] = self.api_client.\
|
||||||
|
select_header_accept(['application/xml', 'application/json'])
|
||||||
|
if not header_params['Accept']:
|
||||||
|
del header_params['Accept']
|
||||||
|
|
||||||
|
# HTTP header `Content-Type`
|
||||||
|
header_params['Content-Type'] = self.api_client.\
|
||||||
|
select_header_content_type([])
|
||||||
|
|
||||||
|
# Authentication setting
|
||||||
|
auth_settings = []
|
||||||
|
|
||||||
|
response = self.api_client.call_api(resource_path, 'POST',
|
||||||
|
path_params,
|
||||||
|
query_params,
|
||||||
|
header_params,
|
||||||
|
body=body_params,
|
||||||
|
post_params=form_params,
|
||||||
|
files=local_var_files,
|
||||||
|
response_type=None,
|
||||||
|
auth_settings=auth_settings,
|
||||||
|
callback=params.get('callback'))
|
||||||
|
return response
|
0
samples/client/petstore/python/test/__init__.py
Normal file
0
samples/client/petstore/python/test/__init__.py
Normal file
49
samples/client/petstore/python/test/test_animal.py
Normal file
49
samples/client/petstore/python/test/test_animal.py
Normal file
@ -0,0 +1,49 @@
|
|||||||
|
# coding: utf-8
|
||||||
|
|
||||||
|
"""
|
||||||
|
Copyright 2016 SmartBear Software
|
||||||
|
|
||||||
|
Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
|
you may not use this file except in compliance with the License.
|
||||||
|
You may obtain a copy of the License at
|
||||||
|
|
||||||
|
http://www.apache.org/licenses/LICENSE-2.0
|
||||||
|
|
||||||
|
Unless required by applicable law or agreed to in writing, software
|
||||||
|
distributed under the License is distributed on an "AS IS" BASIS,
|
||||||
|
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||||
|
See the License for the specific language governing permissions and
|
||||||
|
limitations under the License.
|
||||||
|
|
||||||
|
ref: https://github.com/swagger-api/swagger-codegen
|
||||||
|
"""
|
||||||
|
|
||||||
|
from __future__ import absolute_import
|
||||||
|
|
||||||
|
import os
|
||||||
|
import sys
|
||||||
|
import unittest
|
||||||
|
|
||||||
|
import swagger_client
|
||||||
|
from swagger_client.rest import ApiException
|
||||||
|
from swagger_client.models.animal import Animal
|
||||||
|
|
||||||
|
|
||||||
|
class TestAnimal(unittest.TestCase):
|
||||||
|
""" Animal unit test stubs """
|
||||||
|
|
||||||
|
def setUp(self):
|
||||||
|
pass
|
||||||
|
|
||||||
|
def tearDown(self):
|
||||||
|
pass
|
||||||
|
|
||||||
|
def testAnimal(self):
|
||||||
|
"""
|
||||||
|
Test Animal
|
||||||
|
"""
|
||||||
|
model = swagger_client.models.animal.Animal()
|
||||||
|
|
||||||
|
|
||||||
|
if __name__ == '__main__':
|
||||||
|
unittest.main()
|
49
samples/client/petstore/python/test/test_api_response.py
Normal file
49
samples/client/petstore/python/test/test_api_response.py
Normal file
@ -0,0 +1,49 @@
|
|||||||
|
# coding: utf-8
|
||||||
|
|
||||||
|
"""
|
||||||
|
Copyright 2016 SmartBear Software
|
||||||
|
|
||||||
|
Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
|
you may not use this file except in compliance with the License.
|
||||||
|
You may obtain a copy of the License at
|
||||||
|
|
||||||
|
http://www.apache.org/licenses/LICENSE-2.0
|
||||||
|
|
||||||
|
Unless required by applicable law or agreed to in writing, software
|
||||||
|
distributed under the License is distributed on an "AS IS" BASIS,
|
||||||
|
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||||
|
See the License for the specific language governing permissions and
|
||||||
|
limitations under the License.
|
||||||
|
|
||||||
|
ref: https://github.com/swagger-api/swagger-codegen
|
||||||
|
"""
|
||||||
|
|
||||||
|
from __future__ import absolute_import
|
||||||
|
|
||||||
|
import os
|
||||||
|
import sys
|
||||||
|
import unittest
|
||||||
|
|
||||||
|
import swagger_client
|
||||||
|
from swagger_client.rest import ApiException
|
||||||
|
from swagger_client.models.api_response import ApiResponse
|
||||||
|
|
||||||
|
|
||||||
|
class TestApiResponse(unittest.TestCase):
|
||||||
|
""" ApiResponse unit test stubs """
|
||||||
|
|
||||||
|
def setUp(self):
|
||||||
|
pass
|
||||||
|
|
||||||
|
def tearDown(self):
|
||||||
|
pass
|
||||||
|
|
||||||
|
def testApiResponse(self):
|
||||||
|
"""
|
||||||
|
Test ApiResponse
|
||||||
|
"""
|
||||||
|
model = swagger_client.models.api_response.ApiResponse()
|
||||||
|
|
||||||
|
|
||||||
|
if __name__ == '__main__':
|
||||||
|
unittest.main()
|
49
samples/client/petstore/python/test/test_cat.py
Normal file
49
samples/client/petstore/python/test/test_cat.py
Normal file
@ -0,0 +1,49 @@
|
|||||||
|
# coding: utf-8
|
||||||
|
|
||||||
|
"""
|
||||||
|
Copyright 2016 SmartBear Software
|
||||||
|
|
||||||
|
Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
|
you may not use this file except in compliance with the License.
|
||||||
|
You may obtain a copy of the License at
|
||||||
|
|
||||||
|
http://www.apache.org/licenses/LICENSE-2.0
|
||||||
|
|
||||||
|
Unless required by applicable law or agreed to in writing, software
|
||||||
|
distributed under the License is distributed on an "AS IS" BASIS,
|
||||||
|
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||||
|
See the License for the specific language governing permissions and
|
||||||
|
limitations under the License.
|
||||||
|
|
||||||
|
ref: https://github.com/swagger-api/swagger-codegen
|
||||||
|
"""
|
||||||
|
|
||||||
|
from __future__ import absolute_import
|
||||||
|
|
||||||
|
import os
|
||||||
|
import sys
|
||||||
|
import unittest
|
||||||
|
|
||||||
|
import swagger_client
|
||||||
|
from swagger_client.rest import ApiException
|
||||||
|
from swagger_client.models.cat import Cat
|
||||||
|
|
||||||
|
|
||||||
|
class TestCat(unittest.TestCase):
|
||||||
|
""" Cat unit test stubs """
|
||||||
|
|
||||||
|
def setUp(self):
|
||||||
|
pass
|
||||||
|
|
||||||
|
def tearDown(self):
|
||||||
|
pass
|
||||||
|
|
||||||
|
def testCat(self):
|
||||||
|
"""
|
||||||
|
Test Cat
|
||||||
|
"""
|
||||||
|
model = swagger_client.models.cat.Cat()
|
||||||
|
|
||||||
|
|
||||||
|
if __name__ == '__main__':
|
||||||
|
unittest.main()
|
49
samples/client/petstore/python/test/test_category.py
Normal file
49
samples/client/petstore/python/test/test_category.py
Normal file
@ -0,0 +1,49 @@
|
|||||||
|
# coding: utf-8
|
||||||
|
|
||||||
|
"""
|
||||||
|
Copyright 2016 SmartBear Software
|
||||||
|
|
||||||
|
Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
|
you may not use this file except in compliance with the License.
|
||||||
|
You may obtain a copy of the License at
|
||||||
|
|
||||||
|
http://www.apache.org/licenses/LICENSE-2.0
|
||||||
|
|
||||||
|
Unless required by applicable law or agreed to in writing, software
|
||||||
|
distributed under the License is distributed on an "AS IS" BASIS,
|
||||||
|
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||||
|
See the License for the specific language governing permissions and
|
||||||
|
limitations under the License.
|
||||||
|
|
||||||
|
ref: https://github.com/swagger-api/swagger-codegen
|
||||||
|
"""
|
||||||
|
|
||||||
|
from __future__ import absolute_import
|
||||||
|
|
||||||
|
import os
|
||||||
|
import sys
|
||||||
|
import unittest
|
||||||
|
|
||||||
|
import swagger_client
|
||||||
|
from swagger_client.rest import ApiException
|
||||||
|
from swagger_client.models.category import Category
|
||||||
|
|
||||||
|
|
||||||
|
class TestCategory(unittest.TestCase):
|
||||||
|
""" Category unit test stubs """
|
||||||
|
|
||||||
|
def setUp(self):
|
||||||
|
pass
|
||||||
|
|
||||||
|
def tearDown(self):
|
||||||
|
pass
|
||||||
|
|
||||||
|
def testCategory(self):
|
||||||
|
"""
|
||||||
|
Test Category
|
||||||
|
"""
|
||||||
|
model = swagger_client.models.category.Category()
|
||||||
|
|
||||||
|
|
||||||
|
if __name__ == '__main__':
|
||||||
|
unittest.main()
|
49
samples/client/petstore/python/test/test_dog.py
Normal file
49
samples/client/petstore/python/test/test_dog.py
Normal file
@ -0,0 +1,49 @@
|
|||||||
|
# coding: utf-8
|
||||||
|
|
||||||
|
"""
|
||||||
|
Copyright 2016 SmartBear Software
|
||||||
|
|
||||||
|
Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
|
you may not use this file except in compliance with the License.
|
||||||
|
You may obtain a copy of the License at
|
||||||
|
|
||||||
|
http://www.apache.org/licenses/LICENSE-2.0
|
||||||
|
|
||||||
|
Unless required by applicable law or agreed to in writing, software
|
||||||
|
distributed under the License is distributed on an "AS IS" BASIS,
|
||||||
|
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||||
|
See the License for the specific language governing permissions and
|
||||||
|
limitations under the License.
|
||||||
|
|
||||||
|
ref: https://github.com/swagger-api/swagger-codegen
|
||||||
|
"""
|
||||||
|
|
||||||
|
from __future__ import absolute_import
|
||||||
|
|
||||||
|
import os
|
||||||
|
import sys
|
||||||
|
import unittest
|
||||||
|
|
||||||
|
import swagger_client
|
||||||
|
from swagger_client.rest import ApiException
|
||||||
|
from swagger_client.models.dog import Dog
|
||||||
|
|
||||||
|
|
||||||
|
class TestDog(unittest.TestCase):
|
||||||
|
""" Dog unit test stubs """
|
||||||
|
|
||||||
|
def setUp(self):
|
||||||
|
pass
|
||||||
|
|
||||||
|
def tearDown(self):
|
||||||
|
pass
|
||||||
|
|
||||||
|
def testDog(self):
|
||||||
|
"""
|
||||||
|
Test Dog
|
||||||
|
"""
|
||||||
|
model = swagger_client.models.dog.Dog()
|
||||||
|
|
||||||
|
|
||||||
|
if __name__ == '__main__':
|
||||||
|
unittest.main()
|
51
samples/client/petstore/python/test/test_fake_api.py
Normal file
51
samples/client/petstore/python/test/test_fake_api.py
Normal file
@ -0,0 +1,51 @@
|
|||||||
|
# coding: utf-8
|
||||||
|
|
||||||
|
"""
|
||||||
|
Copyright 2016 SmartBear Software
|
||||||
|
|
||||||
|
Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
|
you may not use this file except in compliance with the License.
|
||||||
|
You may obtain a copy of the License at
|
||||||
|
|
||||||
|
http://www.apache.org/licenses/LICENSE-2.0
|
||||||
|
|
||||||
|
Unless required by applicable law or agreed to in writing, software
|
||||||
|
distributed under the License is distributed on an "AS IS" BASIS,
|
||||||
|
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||||
|
See the License for the specific language governing permissions and
|
||||||
|
limitations under the License.
|
||||||
|
|
||||||
|
ref: https://github.com/swagger-api/swagger-codegen
|
||||||
|
"""
|
||||||
|
|
||||||
|
from __future__ import absolute_import
|
||||||
|
|
||||||
|
import os
|
||||||
|
import sys
|
||||||
|
import unittest
|
||||||
|
|
||||||
|
import swagger_client
|
||||||
|
from swagger_client.rest import ApiException
|
||||||
|
from swagger_client.apis.fake_api import FakeApi
|
||||||
|
|
||||||
|
|
||||||
|
class TestFakeApi(unittest.TestCase):
|
||||||
|
""" FakeApi unit test stubs """
|
||||||
|
|
||||||
|
def setUp(self):
|
||||||
|
self.api = swagger_client.apis.fake_api.FakeApi()
|
||||||
|
|
||||||
|
def tearDown(self):
|
||||||
|
pass
|
||||||
|
|
||||||
|
def test_test_endpoint_parameters(self):
|
||||||
|
"""
|
||||||
|
Test case for test_endpoint_parameters
|
||||||
|
|
||||||
|
Fake endpoint for testing various parameters
|
||||||
|
"""
|
||||||
|
pass
|
||||||
|
|
||||||
|
|
||||||
|
if __name__ == '__main__':
|
||||||
|
unittest.main()
|
49
samples/client/petstore/python/test/test_format_test.py
Normal file
49
samples/client/petstore/python/test/test_format_test.py
Normal file
@ -0,0 +1,49 @@
|
|||||||
|
# coding: utf-8
|
||||||
|
|
||||||
|
"""
|
||||||
|
Copyright 2016 SmartBear Software
|
||||||
|
|
||||||
|
Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
|
you may not use this file except in compliance with the License.
|
||||||
|
You may obtain a copy of the License at
|
||||||
|
|
||||||
|
http://www.apache.org/licenses/LICENSE-2.0
|
||||||
|
|
||||||
|
Unless required by applicable law or agreed to in writing, software
|
||||||
|
distributed under the License is distributed on an "AS IS" BASIS,
|
||||||
|
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||||
|
See the License for the specific language governing permissions and
|
||||||
|
limitations under the License.
|
||||||
|
|
||||||
|
ref: https://github.com/swagger-api/swagger-codegen
|
||||||
|
"""
|
||||||
|
|
||||||
|
from __future__ import absolute_import
|
||||||
|
|
||||||
|
import os
|
||||||
|
import sys
|
||||||
|
import unittest
|
||||||
|
|
||||||
|
import swagger_client
|
||||||
|
from swagger_client.rest import ApiException
|
||||||
|
from swagger_client.models.format_test import FormatTest
|
||||||
|
|
||||||
|
|
||||||
|
class TestFormatTest(unittest.TestCase):
|
||||||
|
""" FormatTest unit test stubs """
|
||||||
|
|
||||||
|
def setUp(self):
|
||||||
|
pass
|
||||||
|
|
||||||
|
def tearDown(self):
|
||||||
|
pass
|
||||||
|
|
||||||
|
def testFormatTest(self):
|
||||||
|
"""
|
||||||
|
Test FormatTest
|
||||||
|
"""
|
||||||
|
model = swagger_client.models.format_test.FormatTest()
|
||||||
|
|
||||||
|
|
||||||
|
if __name__ == '__main__':
|
||||||
|
unittest.main()
|
@ -0,0 +1,49 @@
|
|||||||
|
# coding: utf-8
|
||||||
|
|
||||||
|
"""
|
||||||
|
Copyright 2016 SmartBear Software
|
||||||
|
|
||||||
|
Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
|
you may not use this file except in compliance with the License.
|
||||||
|
You may obtain a copy of the License at
|
||||||
|
|
||||||
|
http://www.apache.org/licenses/LICENSE-2.0
|
||||||
|
|
||||||
|
Unless required by applicable law or agreed to in writing, software
|
||||||
|
distributed under the License is distributed on an "AS IS" BASIS,
|
||||||
|
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||||
|
See the License for the specific language governing permissions and
|
||||||
|
limitations under the License.
|
||||||
|
|
||||||
|
ref: https://github.com/swagger-api/swagger-codegen
|
||||||
|
"""
|
||||||
|
|
||||||
|
from __future__ import absolute_import
|
||||||
|
|
||||||
|
import os
|
||||||
|
import sys
|
||||||
|
import unittest
|
||||||
|
|
||||||
|
import swagger_client
|
||||||
|
from swagger_client.rest import ApiException
|
||||||
|
from swagger_client.models.model_200_response import Model200Response
|
||||||
|
|
||||||
|
|
||||||
|
class TestModel200Response(unittest.TestCase):
|
||||||
|
""" Model200Response unit test stubs """
|
||||||
|
|
||||||
|
def setUp(self):
|
||||||
|
pass
|
||||||
|
|
||||||
|
def tearDown(self):
|
||||||
|
pass
|
||||||
|
|
||||||
|
def testModel200Response(self):
|
||||||
|
"""
|
||||||
|
Test Model200Response
|
||||||
|
"""
|
||||||
|
model = swagger_client.models.model_200_response.Model200Response()
|
||||||
|
|
||||||
|
|
||||||
|
if __name__ == '__main__':
|
||||||
|
unittest.main()
|
49
samples/client/petstore/python/test/test_model_return.py
Normal file
49
samples/client/petstore/python/test/test_model_return.py
Normal file
@ -0,0 +1,49 @@
|
|||||||
|
# coding: utf-8
|
||||||
|
|
||||||
|
"""
|
||||||
|
Copyright 2016 SmartBear Software
|
||||||
|
|
||||||
|
Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
|
you may not use this file except in compliance with the License.
|
||||||
|
You may obtain a copy of the License at
|
||||||
|
|
||||||
|
http://www.apache.org/licenses/LICENSE-2.0
|
||||||
|
|
||||||
|
Unless required by applicable law or agreed to in writing, software
|
||||||
|
distributed under the License is distributed on an "AS IS" BASIS,
|
||||||
|
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||||
|
See the License for the specific language governing permissions and
|
||||||
|
limitations under the License.
|
||||||
|
|
||||||
|
ref: https://github.com/swagger-api/swagger-codegen
|
||||||
|
"""
|
||||||
|
|
||||||
|
from __future__ import absolute_import
|
||||||
|
|
||||||
|
import os
|
||||||
|
import sys
|
||||||
|
import unittest
|
||||||
|
|
||||||
|
import swagger_client
|
||||||
|
from swagger_client.rest import ApiException
|
||||||
|
from swagger_client.models.model_return import ModelReturn
|
||||||
|
|
||||||
|
|
||||||
|
class TestModelReturn(unittest.TestCase):
|
||||||
|
""" ModelReturn unit test stubs """
|
||||||
|
|
||||||
|
def setUp(self):
|
||||||
|
pass
|
||||||
|
|
||||||
|
def tearDown(self):
|
||||||
|
pass
|
||||||
|
|
||||||
|
def testModelReturn(self):
|
||||||
|
"""
|
||||||
|
Test ModelReturn
|
||||||
|
"""
|
||||||
|
model = swagger_client.models.model_return.ModelReturn()
|
||||||
|
|
||||||
|
|
||||||
|
if __name__ == '__main__':
|
||||||
|
unittest.main()
|
49
samples/client/petstore/python/test/test_name.py
Normal file
49
samples/client/petstore/python/test/test_name.py
Normal file
@ -0,0 +1,49 @@
|
|||||||
|
# coding: utf-8
|
||||||
|
|
||||||
|
"""
|
||||||
|
Copyright 2016 SmartBear Software
|
||||||
|
|
||||||
|
Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
|
you may not use this file except in compliance with the License.
|
||||||
|
You may obtain a copy of the License at
|
||||||
|
|
||||||
|
http://www.apache.org/licenses/LICENSE-2.0
|
||||||
|
|
||||||
|
Unless required by applicable law or agreed to in writing, software
|
||||||
|
distributed under the License is distributed on an "AS IS" BASIS,
|
||||||
|
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||||
|
See the License for the specific language governing permissions and
|
||||||
|
limitations under the License.
|
||||||
|
|
||||||
|
ref: https://github.com/swagger-api/swagger-codegen
|
||||||
|
"""
|
||||||
|
|
||||||
|
from __future__ import absolute_import
|
||||||
|
|
||||||
|
import os
|
||||||
|
import sys
|
||||||
|
import unittest
|
||||||
|
|
||||||
|
import swagger_client
|
||||||
|
from swagger_client.rest import ApiException
|
||||||
|
from swagger_client.models.name import Name
|
||||||
|
|
||||||
|
|
||||||
|
class TestName(unittest.TestCase):
|
||||||
|
""" Name unit test stubs """
|
||||||
|
|
||||||
|
def setUp(self):
|
||||||
|
pass
|
||||||
|
|
||||||
|
def tearDown(self):
|
||||||
|
pass
|
||||||
|
|
||||||
|
def testName(self):
|
||||||
|
"""
|
||||||
|
Test Name
|
||||||
|
"""
|
||||||
|
model = swagger_client.models.name.Name()
|
||||||
|
|
||||||
|
|
||||||
|
if __name__ == '__main__':
|
||||||
|
unittest.main()
|
49
samples/client/petstore/python/test/test_order.py
Normal file
49
samples/client/petstore/python/test/test_order.py
Normal file
@ -0,0 +1,49 @@
|
|||||||
|
# coding: utf-8
|
||||||
|
|
||||||
|
"""
|
||||||
|
Copyright 2016 SmartBear Software
|
||||||
|
|
||||||
|
Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
|
you may not use this file except in compliance with the License.
|
||||||
|
You may obtain a copy of the License at
|
||||||
|
|
||||||
|
http://www.apache.org/licenses/LICENSE-2.0
|
||||||
|
|
||||||
|
Unless required by applicable law or agreed to in writing, software
|
||||||
|
distributed under the License is distributed on an "AS IS" BASIS,
|
||||||
|
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||||
|
See the License for the specific language governing permissions and
|
||||||
|
limitations under the License.
|
||||||
|
|
||||||
|
ref: https://github.com/swagger-api/swagger-codegen
|
||||||
|
"""
|
||||||
|
|
||||||
|
from __future__ import absolute_import
|
||||||
|
|
||||||
|
import os
|
||||||
|
import sys
|
||||||
|
import unittest
|
||||||
|
|
||||||
|
import swagger_client
|
||||||
|
from swagger_client.rest import ApiException
|
||||||
|
from swagger_client.models.order import Order
|
||||||
|
|
||||||
|
|
||||||
|
class TestOrder(unittest.TestCase):
|
||||||
|
""" Order unit test stubs """
|
||||||
|
|
||||||
|
def setUp(self):
|
||||||
|
pass
|
||||||
|
|
||||||
|
def tearDown(self):
|
||||||
|
pass
|
||||||
|
|
||||||
|
def testOrder(self):
|
||||||
|
"""
|
||||||
|
Test Order
|
||||||
|
"""
|
||||||
|
model = swagger_client.models.order.Order()
|
||||||
|
|
||||||
|
|
||||||
|
if __name__ == '__main__':
|
||||||
|
unittest.main()
|
49
samples/client/petstore/python/test/test_pet.py
Normal file
49
samples/client/petstore/python/test/test_pet.py
Normal file
@ -0,0 +1,49 @@
|
|||||||
|
# coding: utf-8
|
||||||
|
|
||||||
|
"""
|
||||||
|
Copyright 2016 SmartBear Software
|
||||||
|
|
||||||
|
Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
|
you may not use this file except in compliance with the License.
|
||||||
|
You may obtain a copy of the License at
|
||||||
|
|
||||||
|
http://www.apache.org/licenses/LICENSE-2.0
|
||||||
|
|
||||||
|
Unless required by applicable law or agreed to in writing, software
|
||||||
|
distributed under the License is distributed on an "AS IS" BASIS,
|
||||||
|
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||||
|
See the License for the specific language governing permissions and
|
||||||
|
limitations under the License.
|
||||||
|
|
||||||
|
ref: https://github.com/swagger-api/swagger-codegen
|
||||||
|
"""
|
||||||
|
|
||||||
|
from __future__ import absolute_import
|
||||||
|
|
||||||
|
import os
|
||||||
|
import sys
|
||||||
|
import unittest
|
||||||
|
|
||||||
|
import swagger_client
|
||||||
|
from swagger_client.rest import ApiException
|
||||||
|
from swagger_client.models.pet import Pet
|
||||||
|
|
||||||
|
|
||||||
|
class TestPet(unittest.TestCase):
|
||||||
|
""" Pet unit test stubs """
|
||||||
|
|
||||||
|
def setUp(self):
|
||||||
|
pass
|
||||||
|
|
||||||
|
def tearDown(self):
|
||||||
|
pass
|
||||||
|
|
||||||
|
def testPet(self):
|
||||||
|
"""
|
||||||
|
Test Pet
|
||||||
|
"""
|
||||||
|
model = swagger_client.models.pet.Pet()
|
||||||
|
|
||||||
|
|
||||||
|
if __name__ == '__main__':
|
||||||
|
unittest.main()
|
107
samples/client/petstore/python/test/test_pet_api.py
Normal file
107
samples/client/petstore/python/test/test_pet_api.py
Normal file
@ -0,0 +1,107 @@
|
|||||||
|
# coding: utf-8
|
||||||
|
|
||||||
|
"""
|
||||||
|
Copyright 2016 SmartBear Software
|
||||||
|
|
||||||
|
Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
|
you may not use this file except in compliance with the License.
|
||||||
|
You may obtain a copy of the License at
|
||||||
|
|
||||||
|
http://www.apache.org/licenses/LICENSE-2.0
|
||||||
|
|
||||||
|
Unless required by applicable law or agreed to in writing, software
|
||||||
|
distributed under the License is distributed on an "AS IS" BASIS,
|
||||||
|
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||||
|
See the License for the specific language governing permissions and
|
||||||
|
limitations under the License.
|
||||||
|
|
||||||
|
ref: https://github.com/swagger-api/swagger-codegen
|
||||||
|
"""
|
||||||
|
|
||||||
|
from __future__ import absolute_import
|
||||||
|
|
||||||
|
import os
|
||||||
|
import sys
|
||||||
|
import unittest
|
||||||
|
|
||||||
|
import swagger_client
|
||||||
|
from swagger_client.rest import ApiException
|
||||||
|
from swagger_client.apis.pet_api import PetApi
|
||||||
|
|
||||||
|
|
||||||
|
class TestPetApi(unittest.TestCase):
|
||||||
|
""" PetApi unit test stubs """
|
||||||
|
|
||||||
|
def setUp(self):
|
||||||
|
self.api = swagger_client.apis.pet_api.PetApi()
|
||||||
|
|
||||||
|
def tearDown(self):
|
||||||
|
pass
|
||||||
|
|
||||||
|
def test_add_pet(self):
|
||||||
|
"""
|
||||||
|
Test case for add_pet
|
||||||
|
|
||||||
|
Add a new pet to the store
|
||||||
|
"""
|
||||||
|
pass
|
||||||
|
|
||||||
|
def test_delete_pet(self):
|
||||||
|
"""
|
||||||
|
Test case for delete_pet
|
||||||
|
|
||||||
|
Deletes a pet
|
||||||
|
"""
|
||||||
|
pass
|
||||||
|
|
||||||
|
def test_find_pets_by_status(self):
|
||||||
|
"""
|
||||||
|
Test case for find_pets_by_status
|
||||||
|
|
||||||
|
Finds Pets by status
|
||||||
|
"""
|
||||||
|
pass
|
||||||
|
|
||||||
|
def test_find_pets_by_tags(self):
|
||||||
|
"""
|
||||||
|
Test case for find_pets_by_tags
|
||||||
|
|
||||||
|
Finds Pets by tags
|
||||||
|
"""
|
||||||
|
pass
|
||||||
|
|
||||||
|
def test_get_pet_by_id(self):
|
||||||
|
"""
|
||||||
|
Test case for get_pet_by_id
|
||||||
|
|
||||||
|
Find pet by ID
|
||||||
|
"""
|
||||||
|
pass
|
||||||
|
|
||||||
|
def test_update_pet(self):
|
||||||
|
"""
|
||||||
|
Test case for update_pet
|
||||||
|
|
||||||
|
Update an existing pet
|
||||||
|
"""
|
||||||
|
pass
|
||||||
|
|
||||||
|
def test_update_pet_with_form(self):
|
||||||
|
"""
|
||||||
|
Test case for update_pet_with_form
|
||||||
|
|
||||||
|
Updates a pet in the store with form data
|
||||||
|
"""
|
||||||
|
pass
|
||||||
|
|
||||||
|
def test_upload_file(self):
|
||||||
|
"""
|
||||||
|
Test case for upload_file
|
||||||
|
|
||||||
|
uploads an image
|
||||||
|
"""
|
||||||
|
pass
|
||||||
|
|
||||||
|
|
||||||
|
if __name__ == '__main__':
|
||||||
|
unittest.main()
|
@ -0,0 +1,49 @@
|
|||||||
|
# coding: utf-8
|
||||||
|
|
||||||
|
"""
|
||||||
|
Copyright 2016 SmartBear Software
|
||||||
|
|
||||||
|
Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
|
you may not use this file except in compliance with the License.
|
||||||
|
You may obtain a copy of the License at
|
||||||
|
|
||||||
|
http://www.apache.org/licenses/LICENSE-2.0
|
||||||
|
|
||||||
|
Unless required by applicable law or agreed to in writing, software
|
||||||
|
distributed under the License is distributed on an "AS IS" BASIS,
|
||||||
|
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||||
|
See the License for the specific language governing permissions and
|
||||||
|
limitations under the License.
|
||||||
|
|
||||||
|
ref: https://github.com/swagger-api/swagger-codegen
|
||||||
|
"""
|
||||||
|
|
||||||
|
from __future__ import absolute_import
|
||||||
|
|
||||||
|
import os
|
||||||
|
import sys
|
||||||
|
import unittest
|
||||||
|
|
||||||
|
import swagger_client
|
||||||
|
from swagger_client.rest import ApiException
|
||||||
|
from swagger_client.models.special_model_name import SpecialModelName
|
||||||
|
|
||||||
|
|
||||||
|
class TestSpecialModelName(unittest.TestCase):
|
||||||
|
""" SpecialModelName unit test stubs """
|
||||||
|
|
||||||
|
def setUp(self):
|
||||||
|
pass
|
||||||
|
|
||||||
|
def tearDown(self):
|
||||||
|
pass
|
||||||
|
|
||||||
|
def testSpecialModelName(self):
|
||||||
|
"""
|
||||||
|
Test SpecialModelName
|
||||||
|
"""
|
||||||
|
model = swagger_client.models.special_model_name.SpecialModelName()
|
||||||
|
|
||||||
|
|
||||||
|
if __name__ == '__main__':
|
||||||
|
unittest.main()
|
75
samples/client/petstore/python/test/test_store_api.py
Normal file
75
samples/client/petstore/python/test/test_store_api.py
Normal file
@ -0,0 +1,75 @@
|
|||||||
|
# coding: utf-8
|
||||||
|
|
||||||
|
"""
|
||||||
|
Copyright 2016 SmartBear Software
|
||||||
|
|
||||||
|
Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
|
you may not use this file except in compliance with the License.
|
||||||
|
You may obtain a copy of the License at
|
||||||
|
|
||||||
|
http://www.apache.org/licenses/LICENSE-2.0
|
||||||
|
|
||||||
|
Unless required by applicable law or agreed to in writing, software
|
||||||
|
distributed under the License is distributed on an "AS IS" BASIS,
|
||||||
|
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||||
|
See the License for the specific language governing permissions and
|
||||||
|
limitations under the License.
|
||||||
|
|
||||||
|
ref: https://github.com/swagger-api/swagger-codegen
|
||||||
|
"""
|
||||||
|
|
||||||
|
from __future__ import absolute_import
|
||||||
|
|
||||||
|
import os
|
||||||
|
import sys
|
||||||
|
import unittest
|
||||||
|
|
||||||
|
import swagger_client
|
||||||
|
from swagger_client.rest import ApiException
|
||||||
|
from swagger_client.apis.store_api import StoreApi
|
||||||
|
|
||||||
|
|
||||||
|
class TestStoreApi(unittest.TestCase):
|
||||||
|
""" StoreApi unit test stubs """
|
||||||
|
|
||||||
|
def setUp(self):
|
||||||
|
self.api = swagger_client.apis.store_api.StoreApi()
|
||||||
|
|
||||||
|
def tearDown(self):
|
||||||
|
pass
|
||||||
|
|
||||||
|
def test_delete_order(self):
|
||||||
|
"""
|
||||||
|
Test case for delete_order
|
||||||
|
|
||||||
|
Delete purchase order by ID
|
||||||
|
"""
|
||||||
|
pass
|
||||||
|
|
||||||
|
def test_get_inventory(self):
|
||||||
|
"""
|
||||||
|
Test case for get_inventory
|
||||||
|
|
||||||
|
Returns pet inventories by status
|
||||||
|
"""
|
||||||
|
pass
|
||||||
|
|
||||||
|
def test_get_order_by_id(self):
|
||||||
|
"""
|
||||||
|
Test case for get_order_by_id
|
||||||
|
|
||||||
|
Find purchase order by ID
|
||||||
|
"""
|
||||||
|
pass
|
||||||
|
|
||||||
|
def test_place_order(self):
|
||||||
|
"""
|
||||||
|
Test case for place_order
|
||||||
|
|
||||||
|
Place an order for a pet
|
||||||
|
"""
|
||||||
|
pass
|
||||||
|
|
||||||
|
|
||||||
|
if __name__ == '__main__':
|
||||||
|
unittest.main()
|
49
samples/client/petstore/python/test/test_tag.py
Normal file
49
samples/client/petstore/python/test/test_tag.py
Normal file
@ -0,0 +1,49 @@
|
|||||||
|
# coding: utf-8
|
||||||
|
|
||||||
|
"""
|
||||||
|
Copyright 2016 SmartBear Software
|
||||||
|
|
||||||
|
Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
|
you may not use this file except in compliance with the License.
|
||||||
|
You may obtain a copy of the License at
|
||||||
|
|
||||||
|
http://www.apache.org/licenses/LICENSE-2.0
|
||||||
|
|
||||||
|
Unless required by applicable law or agreed to in writing, software
|
||||||
|
distributed under the License is distributed on an "AS IS" BASIS,
|
||||||
|
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||||
|
See the License for the specific language governing permissions and
|
||||||
|
limitations under the License.
|
||||||
|
|
||||||
|
ref: https://github.com/swagger-api/swagger-codegen
|
||||||
|
"""
|
||||||
|
|
||||||
|
from __future__ import absolute_import
|
||||||
|
|
||||||
|
import os
|
||||||
|
import sys
|
||||||
|
import unittest
|
||||||
|
|
||||||
|
import swagger_client
|
||||||
|
from swagger_client.rest import ApiException
|
||||||
|
from swagger_client.models.tag import Tag
|
||||||
|
|
||||||
|
|
||||||
|
class TestTag(unittest.TestCase):
|
||||||
|
""" Tag unit test stubs """
|
||||||
|
|
||||||
|
def setUp(self):
|
||||||
|
pass
|
||||||
|
|
||||||
|
def tearDown(self):
|
||||||
|
pass
|
||||||
|
|
||||||
|
def testTag(self):
|
||||||
|
"""
|
||||||
|
Test Tag
|
||||||
|
"""
|
||||||
|
model = swagger_client.models.tag.Tag()
|
||||||
|
|
||||||
|
|
||||||
|
if __name__ == '__main__':
|
||||||
|
unittest.main()
|
49
samples/client/petstore/python/test/test_user.py
Normal file
49
samples/client/petstore/python/test/test_user.py
Normal file
@ -0,0 +1,49 @@
|
|||||||
|
# coding: utf-8
|
||||||
|
|
||||||
|
"""
|
||||||
|
Copyright 2016 SmartBear Software
|
||||||
|
|
||||||
|
Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
|
you may not use this file except in compliance with the License.
|
||||||
|
You may obtain a copy of the License at
|
||||||
|
|
||||||
|
http://www.apache.org/licenses/LICENSE-2.0
|
||||||
|
|
||||||
|
Unless required by applicable law or agreed to in writing, software
|
||||||
|
distributed under the License is distributed on an "AS IS" BASIS,
|
||||||
|
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||||
|
See the License for the specific language governing permissions and
|
||||||
|
limitations under the License.
|
||||||
|
|
||||||
|
ref: https://github.com/swagger-api/swagger-codegen
|
||||||
|
"""
|
||||||
|
|
||||||
|
from __future__ import absolute_import
|
||||||
|
|
||||||
|
import os
|
||||||
|
import sys
|
||||||
|
import unittest
|
||||||
|
|
||||||
|
import swagger_client
|
||||||
|
from swagger_client.rest import ApiException
|
||||||
|
from swagger_client.models.user import User
|
||||||
|
|
||||||
|
|
||||||
|
class TestUser(unittest.TestCase):
|
||||||
|
""" User unit test stubs """
|
||||||
|
|
||||||
|
def setUp(self):
|
||||||
|
pass
|
||||||
|
|
||||||
|
def tearDown(self):
|
||||||
|
pass
|
||||||
|
|
||||||
|
def testUser(self):
|
||||||
|
"""
|
||||||
|
Test User
|
||||||
|
"""
|
||||||
|
model = swagger_client.models.user.User()
|
||||||
|
|
||||||
|
|
||||||
|
if __name__ == '__main__':
|
||||||
|
unittest.main()
|
107
samples/client/petstore/python/test/test_user_api.py
Normal file
107
samples/client/petstore/python/test/test_user_api.py
Normal file
@ -0,0 +1,107 @@
|
|||||||
|
# coding: utf-8
|
||||||
|
|
||||||
|
"""
|
||||||
|
Copyright 2016 SmartBear Software
|
||||||
|
|
||||||
|
Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
|
you may not use this file except in compliance with the License.
|
||||||
|
You may obtain a copy of the License at
|
||||||
|
|
||||||
|
http://www.apache.org/licenses/LICENSE-2.0
|
||||||
|
|
||||||
|
Unless required by applicable law or agreed to in writing, software
|
||||||
|
distributed under the License is distributed on an "AS IS" BASIS,
|
||||||
|
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||||
|
See the License for the specific language governing permissions and
|
||||||
|
limitations under the License.
|
||||||
|
|
||||||
|
ref: https://github.com/swagger-api/swagger-codegen
|
||||||
|
"""
|
||||||
|
|
||||||
|
from __future__ import absolute_import
|
||||||
|
|
||||||
|
import os
|
||||||
|
import sys
|
||||||
|
import unittest
|
||||||
|
|
||||||
|
import swagger_client
|
||||||
|
from swagger_client.rest import ApiException
|
||||||
|
from swagger_client.apis.user_api import UserApi
|
||||||
|
|
||||||
|
|
||||||
|
class TestUserApi(unittest.TestCase):
|
||||||
|
""" UserApi unit test stubs """
|
||||||
|
|
||||||
|
def setUp(self):
|
||||||
|
self.api = swagger_client.apis.user_api.UserApi()
|
||||||
|
|
||||||
|
def tearDown(self):
|
||||||
|
pass
|
||||||
|
|
||||||
|
def test_create_user(self):
|
||||||
|
"""
|
||||||
|
Test case for create_user
|
||||||
|
|
||||||
|
Create user
|
||||||
|
"""
|
||||||
|
pass
|
||||||
|
|
||||||
|
def test_create_users_with_array_input(self):
|
||||||
|
"""
|
||||||
|
Test case for create_users_with_array_input
|
||||||
|
|
||||||
|
Creates list of users with given input array
|
||||||
|
"""
|
||||||
|
pass
|
||||||
|
|
||||||
|
def test_create_users_with_list_input(self):
|
||||||
|
"""
|
||||||
|
Test case for create_users_with_list_input
|
||||||
|
|
||||||
|
Creates list of users with given input array
|
||||||
|
"""
|
||||||
|
pass
|
||||||
|
|
||||||
|
def test_delete_user(self):
|
||||||
|
"""
|
||||||
|
Test case for delete_user
|
||||||
|
|
||||||
|
Delete user
|
||||||
|
"""
|
||||||
|
pass
|
||||||
|
|
||||||
|
def test_get_user_by_name(self):
|
||||||
|
"""
|
||||||
|
Test case for get_user_by_name
|
||||||
|
|
||||||
|
Get user by user name
|
||||||
|
"""
|
||||||
|
pass
|
||||||
|
|
||||||
|
def test_login_user(self):
|
||||||
|
"""
|
||||||
|
Test case for login_user
|
||||||
|
|
||||||
|
Logs user into the system
|
||||||
|
"""
|
||||||
|
pass
|
||||||
|
|
||||||
|
def test_logout_user(self):
|
||||||
|
"""
|
||||||
|
Test case for logout_user
|
||||||
|
|
||||||
|
Logs out current logged in user session
|
||||||
|
"""
|
||||||
|
pass
|
||||||
|
|
||||||
|
def test_update_user(self):
|
||||||
|
"""
|
||||||
|
Test case for update_user
|
||||||
|
|
||||||
|
Updated user
|
||||||
|
"""
|
||||||
|
pass
|
||||||
|
|
||||||
|
|
||||||
|
if __name__ == '__main__':
|
||||||
|
unittest.main()
|
Loading…
x
Reference in New Issue
Block a user