forked from loafle/openapi-generator-original
[python-pydantic-v1] various improvements (#16658)
* rename, add tests * remove library support in python pydantic v1 codegen * copy tests * copy echo api tests * update samples * update doc * add back library support
This commit is contained in:
parent
3b95f701e5
commit
077744a7af
File diff suppressed because it is too large
Load Diff
@ -41,8 +41,8 @@ import java.util.*;
|
|||||||
import static org.openapitools.codegen.utils.StringUtils.escape;
|
import static org.openapitools.codegen.utils.StringUtils.escape;
|
||||||
import static org.openapitools.codegen.utils.StringUtils.underscore;
|
import static org.openapitools.codegen.utils.StringUtils.underscore;
|
||||||
|
|
||||||
public class PythonClientPydanticV1Codegen extends AbstractPythonCodegen implements CodegenConfig {
|
public class PythonPydanticV1ClientCodegen extends AbstractPythonPydanticV1Codegen implements CodegenConfig {
|
||||||
private final Logger LOGGER = LoggerFactory.getLogger(PythonClientCodegen.class);
|
private final Logger LOGGER = LoggerFactory.getLogger(PythonPydanticV1ClientCodegen.class);
|
||||||
|
|
||||||
public static final String PACKAGE_URL = "packageUrl";
|
public static final String PACKAGE_URL = "packageUrl";
|
||||||
public static final String DEFAULT_LIBRARY = "urllib3";
|
public static final String DEFAULT_LIBRARY = "urllib3";
|
||||||
@ -60,7 +60,7 @@ public class PythonClientPydanticV1Codegen extends AbstractPythonCodegen impleme
|
|||||||
|
|
||||||
private String testFolder;
|
private String testFolder;
|
||||||
|
|
||||||
public PythonClientPydanticV1Codegen() {
|
public PythonPydanticV1ClientCodegen() {
|
||||||
super();
|
super();
|
||||||
|
|
||||||
// force sortParamsByRequiredFlag to true to make the api method signature less complicated
|
// force sortParamsByRequiredFlag to true to make the api method signature less complicated
|
@ -101,7 +101,7 @@ org.openapitools.codegen.languages.PostmanCollectionCodegen
|
|||||||
org.openapitools.codegen.languages.PowerShellClientCodegen
|
org.openapitools.codegen.languages.PowerShellClientCodegen
|
||||||
org.openapitools.codegen.languages.ProtobufSchemaCodegen
|
org.openapitools.codegen.languages.ProtobufSchemaCodegen
|
||||||
org.openapitools.codegen.languages.PythonClientCodegen
|
org.openapitools.codegen.languages.PythonClientCodegen
|
||||||
org.openapitools.codegen.languages.PythonClientPydanticV1Codegen
|
org.openapitools.codegen.languages.PythonPydanticV1ClientCodegen
|
||||||
org.openapitools.codegen.languages.PythonFastAPIServerCodegen
|
org.openapitools.codegen.languages.PythonFastAPIServerCodegen
|
||||||
org.openapitools.codegen.languages.PythonFlaskConnexionServerCodegen
|
org.openapitools.codegen.languages.PythonFlaskConnexionServerCodegen
|
||||||
org.openapitools.codegen.languages.PythonAiohttpConnexionServerCodegen
|
org.openapitools.codegen.languages.PythonAiohttpConnexionServerCodegen
|
||||||
|
@ -1,241 +0,0 @@
|
|||||||
# coding: utf-8
|
|
||||||
|
|
||||||
{{>partial_header}}
|
|
||||||
|
|
||||||
import io
|
|
||||||
import json
|
|
||||||
import logging
|
|
||||||
import re
|
|
||||||
import ssl
|
|
||||||
|
|
||||||
import aiohttp
|
|
||||||
from urllib.parse import urlencode, quote_plus
|
|
||||||
|
|
||||||
from {{packageName}}.exceptions import ApiException, ApiValueError
|
|
||||||
|
|
||||||
logger = logging.getLogger(__name__)
|
|
||||||
|
|
||||||
|
|
||||||
class RESTResponse(io.IOBase):
|
|
||||||
|
|
||||||
def __init__(self, resp, data) -> None:
|
|
||||||
self.aiohttp_response = resp
|
|
||||||
self.status = resp.status
|
|
||||||
self.reason = resp.reason
|
|
||||||
self.data = data
|
|
||||||
|
|
||||||
def getheaders(self):
|
|
||||||
"""Returns a CIMultiDictProxy of the response headers."""
|
|
||||||
return self.aiohttp_response.headers
|
|
||||||
|
|
||||||
def getheader(self, name, default=None):
|
|
||||||
"""Returns a given response header."""
|
|
||||||
return self.aiohttp_response.headers.get(name, default)
|
|
||||||
|
|
||||||
|
|
||||||
class RESTClientObject:
|
|
||||||
|
|
||||||
def __init__(self, configuration, pools_size=4, maxsize=None) -> None:
|
|
||||||
|
|
||||||
# maxsize is number of requests to host that are allowed in parallel
|
|
||||||
if maxsize is None:
|
|
||||||
maxsize = configuration.connection_pool_maxsize
|
|
||||||
|
|
||||||
ssl_context = ssl.create_default_context(cafile=configuration.ssl_ca_cert)
|
|
||||||
if configuration.cert_file:
|
|
||||||
ssl_context.load_cert_chain(
|
|
||||||
configuration.cert_file, keyfile=configuration.key_file
|
|
||||||
)
|
|
||||||
|
|
||||||
if not configuration.verify_ssl:
|
|
||||||
ssl_context.check_hostname = False
|
|
||||||
ssl_context.verify_mode = ssl.CERT_NONE
|
|
||||||
|
|
||||||
connector = aiohttp.TCPConnector(
|
|
||||||
limit=maxsize,
|
|
||||||
ssl=ssl_context
|
|
||||||
)
|
|
||||||
|
|
||||||
self.proxy = configuration.proxy
|
|
||||||
self.proxy_headers = configuration.proxy_headers
|
|
||||||
|
|
||||||
# https pool manager
|
|
||||||
self.pool_manager = aiohttp.ClientSession(
|
|
||||||
connector=connector,
|
|
||||||
trust_env=True
|
|
||||||
)
|
|
||||||
|
|
||||||
async def close(self):
|
|
||||||
await self.pool_manager.close()
|
|
||||||
|
|
||||||
async def request(self, method, url, query_params=None, headers=None,
|
|
||||||
body=None, post_params=None, _preload_content=True,
|
|
||||||
_request_timeout=None):
|
|
||||||
"""Execute request
|
|
||||||
|
|
||||||
:param method: http request method
|
|
||||||
:param url: http request url
|
|
||||||
:param query_params: query parameters in the url
|
|
||||||
:param headers: http request headers
|
|
||||||
:param body: request json body, for `application/json`
|
|
||||||
:param post_params: request post parameters,
|
|
||||||
`application/x-www-form-urlencoded`
|
|
||||||
and `multipart/form-data`
|
|
||||||
:param _preload_content: this is a non-applicable field for
|
|
||||||
the AiohttpClient.
|
|
||||||
:param _request_timeout: timeout setting for this request. If one
|
|
||||||
number provided, it will be total request
|
|
||||||
timeout. It can also be a pair (tuple) of
|
|
||||||
(connection, read) timeouts.
|
|
||||||
"""
|
|
||||||
method = method.upper()
|
|
||||||
assert method in ['GET', 'HEAD', 'DELETE', 'POST', 'PUT',
|
|
||||||
'PATCH', 'OPTIONS']
|
|
||||||
|
|
||||||
if post_params and body:
|
|
||||||
raise ApiValueError(
|
|
||||||
"body parameter cannot be used with post_params parameter."
|
|
||||||
)
|
|
||||||
|
|
||||||
post_params = post_params or {}
|
|
||||||
headers = headers or {}
|
|
||||||
# url already contains the URL query string
|
|
||||||
# so reset query_params to empty dict
|
|
||||||
query_params = {}
|
|
||||||
timeout = _request_timeout or 5 * 60
|
|
||||||
|
|
||||||
if 'Content-Type' not in headers:
|
|
||||||
headers['Content-Type'] = 'application/json'
|
|
||||||
|
|
||||||
args = {
|
|
||||||
"method": method,
|
|
||||||
"url": url,
|
|
||||||
"timeout": timeout,
|
|
||||||
"headers": headers
|
|
||||||
}
|
|
||||||
|
|
||||||
if self.proxy:
|
|
||||||
args["proxy"] = self.proxy
|
|
||||||
if self.proxy_headers:
|
|
||||||
args["proxy_headers"] = self.proxy_headers
|
|
||||||
|
|
||||||
if query_params:
|
|
||||||
args["url"] += '?' + urlencode(query_params)
|
|
||||||
|
|
||||||
# For `POST`, `PUT`, `PATCH`, `OPTIONS`, `DELETE`
|
|
||||||
if method in ['POST', 'PUT', 'PATCH', 'OPTIONS', 'DELETE']:
|
|
||||||
if re.search('json', headers['Content-Type'], re.IGNORECASE):
|
|
||||||
if body is not None:
|
|
||||||
body = json.dumps(body)
|
|
||||||
args["data"] = body
|
|
||||||
elif headers['Content-Type'] == 'application/x-www-form-urlencoded': # noqa: E501
|
|
||||||
args["data"] = aiohttp.FormData(post_params)
|
|
||||||
elif headers['Content-Type'] == 'multipart/form-data':
|
|
||||||
# must del headers['Content-Type'], or the correct
|
|
||||||
# Content-Type which generated by aiohttp
|
|
||||||
del headers['Content-Type']
|
|
||||||
data = aiohttp.FormData()
|
|
||||||
for param in post_params:
|
|
||||||
k, v = param
|
|
||||||
if isinstance(v, tuple) and len(v) == 3:
|
|
||||||
data.add_field(k,
|
|
||||||
value=v[1],
|
|
||||||
filename=v[0],
|
|
||||||
content_type=v[2])
|
|
||||||
else:
|
|
||||||
data.add_field(k, v)
|
|
||||||
args["data"] = data
|
|
||||||
|
|
||||||
# Pass a `bytes` parameter directly in the body to support
|
|
||||||
# other content types than Json when `body` argument is provided
|
|
||||||
# in serialized form
|
|
||||||
elif isinstance(body, bytes):
|
|
||||||
args["data"] = body
|
|
||||||
else:
|
|
||||||
# Cannot generate the request from given parameters
|
|
||||||
msg = """Cannot prepare a request message for provided
|
|
||||||
arguments. Please check that your arguments match
|
|
||||||
declared content type."""
|
|
||||||
raise ApiException(status=0, reason=msg)
|
|
||||||
|
|
||||||
r = await self.pool_manager.request(**args)
|
|
||||||
if _preload_content:
|
|
||||||
|
|
||||||
data = await r.read()
|
|
||||||
r = RESTResponse(r, data)
|
|
||||||
|
|
||||||
# log response body
|
|
||||||
logger.debug("response body: %s", r.data)
|
|
||||||
|
|
||||||
if not 200 <= r.status <= 299:
|
|
||||||
raise ApiException(http_resp=r)
|
|
||||||
|
|
||||||
return r
|
|
||||||
|
|
||||||
async def get_request(self, url, headers=None, query_params=None,
|
|
||||||
_preload_content=True, _request_timeout=None):
|
|
||||||
return (await self.request("GET", url,
|
|
||||||
headers=headers,
|
|
||||||
_preload_content=_preload_content,
|
|
||||||
_request_timeout=_request_timeout,
|
|
||||||
query_params=query_params))
|
|
||||||
|
|
||||||
async def head_request(self, url, headers=None, query_params=None,
|
|
||||||
_preload_content=True, _request_timeout=None):
|
|
||||||
return (await self.request("HEAD", url,
|
|
||||||
headers=headers,
|
|
||||||
_preload_content=_preload_content,
|
|
||||||
_request_timeout=_request_timeout,
|
|
||||||
query_params=query_params))
|
|
||||||
|
|
||||||
async def options_request(self, url, headers=None, query_params=None,
|
|
||||||
post_params=None, body=None, _preload_content=True,
|
|
||||||
_request_timeout=None):
|
|
||||||
return (await self.request("OPTIONS", url,
|
|
||||||
headers=headers,
|
|
||||||
query_params=query_params,
|
|
||||||
post_params=post_params,
|
|
||||||
_preload_content=_preload_content,
|
|
||||||
_request_timeout=_request_timeout,
|
|
||||||
body=body))
|
|
||||||
|
|
||||||
async def delete_request(self, url, headers=None, query_params=None, body=None,
|
|
||||||
_preload_content=True, _request_timeout=None):
|
|
||||||
return (await self.request("DELETE", url,
|
|
||||||
headers=headers,
|
|
||||||
query_params=query_params,
|
|
||||||
_preload_content=_preload_content,
|
|
||||||
_request_timeout=_request_timeout,
|
|
||||||
body=body))
|
|
||||||
|
|
||||||
async def post_request(self, url, headers=None, query_params=None,
|
|
||||||
post_params=None, body=None, _preload_content=True,
|
|
||||||
_request_timeout=None):
|
|
||||||
return (await self.request("POST", url,
|
|
||||||
headers=headers,
|
|
||||||
query_params=query_params,
|
|
||||||
post_params=post_params,
|
|
||||||
_preload_content=_preload_content,
|
|
||||||
_request_timeout=_request_timeout,
|
|
||||||
body=body))
|
|
||||||
|
|
||||||
async def put_request(self, url, headers=None, query_params=None, post_params=None,
|
|
||||||
body=None, _preload_content=True, _request_timeout=None):
|
|
||||||
return (await self.request("PUT", url,
|
|
||||||
headers=headers,
|
|
||||||
query_params=query_params,
|
|
||||||
post_params=post_params,
|
|
||||||
_preload_content=_preload_content,
|
|
||||||
_request_timeout=_request_timeout,
|
|
||||||
body=body))
|
|
||||||
|
|
||||||
async def patch_request(self, url, headers=None, query_params=None,
|
|
||||||
post_params=None, body=None, _preload_content=True,
|
|
||||||
_request_timeout=None):
|
|
||||||
return (await self.request("PATCH", url,
|
|
||||||
headers=headers,
|
|
||||||
query_params=query_params,
|
|
||||||
post_params=post_params,
|
|
||||||
_preload_content=_preload_content,
|
|
||||||
_request_timeout=_request_timeout,
|
|
||||||
body=body))
|
|
@ -1,223 +0,0 @@
|
|||||||
# coding: utf-8
|
|
||||||
|
|
||||||
{{>partial_header}}
|
|
||||||
|
|
||||||
import io
|
|
||||||
import json
|
|
||||||
import logging
|
|
||||||
import re
|
|
||||||
|
|
||||||
from urllib.parse import urlencode, quote_plus
|
|
||||||
import tornado
|
|
||||||
import tornado.gen
|
|
||||||
from tornado import httpclient
|
|
||||||
from urllib3.filepost import encode_multipart_formdata
|
|
||||||
|
|
||||||
from {{packageName}}.exceptions import ApiException, ApiValueError
|
|
||||||
|
|
||||||
logger = logging.getLogger(__name__)
|
|
||||||
|
|
||||||
|
|
||||||
class RESTResponse(io.IOBase):
|
|
||||||
|
|
||||||
def __init__(self, resp) -> None:
|
|
||||||
self.tornado_response = resp
|
|
||||||
self.status = resp.code
|
|
||||||
self.reason = resp.reason
|
|
||||||
|
|
||||||
if resp.body:
|
|
||||||
self.data = resp.body
|
|
||||||
else:
|
|
||||||
self.data = None
|
|
||||||
|
|
||||||
def getheaders(self):
|
|
||||||
"""Returns a CIMultiDictProxy of the response headers."""
|
|
||||||
return self.tornado_response.headers
|
|
||||||
|
|
||||||
def getheader(self, name, default=None):
|
|
||||||
"""Returns a given response header."""
|
|
||||||
return self.tornado_response.headers.get(name, default)
|
|
||||||
|
|
||||||
|
|
||||||
class RESTClientObject:
|
|
||||||
|
|
||||||
def __init__(self, configuration, pools_size=4, maxsize=4) -> None:
|
|
||||||
# maxsize is number of requests to host that are allowed in parallel
|
|
||||||
|
|
||||||
self.ca_certs = configuration.ssl_ca_cert
|
|
||||||
self.client_key = configuration.key_file
|
|
||||||
self.client_cert = configuration.cert_file
|
|
||||||
|
|
||||||
self.proxy_port = self.proxy_host = None
|
|
||||||
|
|
||||||
# https pool manager
|
|
||||||
if configuration.proxy:
|
|
||||||
self.proxy_port = 80
|
|
||||||
self.proxy_host = configuration.proxy
|
|
||||||
|
|
||||||
self.pool_manager = httpclient.AsyncHTTPClient()
|
|
||||||
|
|
||||||
@tornado.gen.coroutine
|
|
||||||
def request(self, method, url, query_params=None, headers=None, body=None,
|
|
||||||
post_params=None, _preload_content=True,
|
|
||||||
_request_timeout=None):
|
|
||||||
"""Execute Request
|
|
||||||
|
|
||||||
:param method: http request method
|
|
||||||
:param url: http request url
|
|
||||||
:param query_params: query parameters in the url
|
|
||||||
:param headers: http request headers
|
|
||||||
:param body: request json body, for `application/json`
|
|
||||||
:param post_params: request post parameters,
|
|
||||||
`application/x-www-form-urlencoded`
|
|
||||||
and `multipart/form-data`
|
|
||||||
:param _preload_content: this is a non-applicable field for
|
|
||||||
the AiohttpClient.
|
|
||||||
:param _request_timeout: timeout setting for this request. If one
|
|
||||||
number provided, it will be total request
|
|
||||||
timeout. It can also be a pair (tuple) of
|
|
||||||
(connection, read) timeouts.
|
|
||||||
"""
|
|
||||||
method = method.upper()
|
|
||||||
assert method in ['GET', 'HEAD', 'DELETE', 'POST', 'PUT',
|
|
||||||
'PATCH', 'OPTIONS']
|
|
||||||
|
|
||||||
if post_params and body:
|
|
||||||
raise ApiValueError(
|
|
||||||
"body parameter cannot be used with post_params parameter."
|
|
||||||
)
|
|
||||||
|
|
||||||
request = httpclient.HTTPRequest(url)
|
|
||||||
request.allow_nonstandard_methods = True
|
|
||||||
request.ca_certs = self.ca_certs
|
|
||||||
request.client_key = self.client_key
|
|
||||||
request.client_cert = self.client_cert
|
|
||||||
request.proxy_host = self.proxy_host
|
|
||||||
request.proxy_port = self.proxy_port
|
|
||||||
request.method = method
|
|
||||||
if headers:
|
|
||||||
request.headers = headers
|
|
||||||
if 'Content-Type' not in headers:
|
|
||||||
request.headers['Content-Type'] = 'application/json'
|
|
||||||
request.request_timeout = _request_timeout or 5 * 60
|
|
||||||
|
|
||||||
post_params = post_params or {}
|
|
||||||
|
|
||||||
if query_params:
|
|
||||||
request.url += '?' + urlencode(query_params)
|
|
||||||
|
|
||||||
# For `POST`, `PUT`, `PATCH`, `OPTIONS`, `DELETE`
|
|
||||||
if method in ['POST', 'PUT', 'PATCH', 'OPTIONS', 'DELETE']:
|
|
||||||
if re.search('json', headers['Content-Type'], re.IGNORECASE):
|
|
||||||
if body:
|
|
||||||
body = json.dumps(body)
|
|
||||||
request.body = body
|
|
||||||
elif headers['Content-Type'] == 'application/x-www-form-urlencoded': # noqa: E501
|
|
||||||
request.body = urlencode(post_params)
|
|
||||||
elif headers['Content-Type'] == 'multipart/form-data':
|
|
||||||
multipart = encode_multipart_formdata(post_params)
|
|
||||||
request.body, headers['Content-Type'] = multipart
|
|
||||||
# Pass a `bytes` parameter directly in the body to support
|
|
||||||
# other content types than Json when `body` argument is provided
|
|
||||||
# in serialized form
|
|
||||||
elif isinstance(body, bytes):
|
|
||||||
request.body = body
|
|
||||||
else:
|
|
||||||
# Cannot generate the request from given parameters
|
|
||||||
msg = """Cannot prepare a request message for provided
|
|
||||||
arguments. Please check that your arguments match
|
|
||||||
declared content type."""
|
|
||||||
raise ApiException(status=0, reason=msg)
|
|
||||||
|
|
||||||
r = yield self.pool_manager.fetch(request, raise_error=False)
|
|
||||||
|
|
||||||
if _preload_content:
|
|
||||||
|
|
||||||
r = RESTResponse(r)
|
|
||||||
|
|
||||||
# log response body
|
|
||||||
logger.debug("response body: %s", r.data)
|
|
||||||
|
|
||||||
if not 200 <= r.status <= 299:
|
|
||||||
raise ApiException(http_resp=r)
|
|
||||||
|
|
||||||
raise tornado.gen.Return(r)
|
|
||||||
|
|
||||||
@tornado.gen.coroutine
|
|
||||||
def GET(self, url, headers=None, query_params=None, _preload_content=True,
|
|
||||||
_request_timeout=None):
|
|
||||||
result = yield self.request("GET", url,
|
|
||||||
headers=headers,
|
|
||||||
_preload_content=_preload_content,
|
|
||||||
_request_timeout=_request_timeout,
|
|
||||||
query_params=query_params)
|
|
||||||
raise tornado.gen.Return(result)
|
|
||||||
|
|
||||||
@tornado.gen.coroutine
|
|
||||||
def HEAD(self, url, headers=None, query_params=None, _preload_content=True,
|
|
||||||
_request_timeout=None):
|
|
||||||
result = yield self.request("HEAD", url,
|
|
||||||
headers=headers,
|
|
||||||
_preload_content=_preload_content,
|
|
||||||
_request_timeout=_request_timeout,
|
|
||||||
query_params=query_params)
|
|
||||||
raise tornado.gen.Return(result)
|
|
||||||
|
|
||||||
@tornado.gen.coroutine
|
|
||||||
def OPTIONS(self, url, headers=None, query_params=None, post_params=None,
|
|
||||||
body=None, _preload_content=True, _request_timeout=None):
|
|
||||||
result = yield self.request("OPTIONS", url,
|
|
||||||
headers=headers,
|
|
||||||
query_params=query_params,
|
|
||||||
post_params=post_params,
|
|
||||||
_preload_content=_preload_content,
|
|
||||||
_request_timeout=_request_timeout,
|
|
||||||
body=body)
|
|
||||||
raise tornado.gen.Return(result)
|
|
||||||
|
|
||||||
@tornado.gen.coroutine
|
|
||||||
def DELETE(self, url, headers=None, query_params=None, body=None,
|
|
||||||
_preload_content=True, _request_timeout=None):
|
|
||||||
result = yield self.request("DELETE", url,
|
|
||||||
headers=headers,
|
|
||||||
query_params=query_params,
|
|
||||||
_preload_content=_preload_content,
|
|
||||||
_request_timeout=_request_timeout,
|
|
||||||
body=body)
|
|
||||||
raise tornado.gen.Return(result)
|
|
||||||
|
|
||||||
@tornado.gen.coroutine
|
|
||||||
def POST(self, url, headers=None, query_params=None, post_params=None,
|
|
||||||
body=None, _preload_content=True, _request_timeout=None):
|
|
||||||
result = yield self.request("POST", url,
|
|
||||||
headers=headers,
|
|
||||||
query_params=query_params,
|
|
||||||
post_params=post_params,
|
|
||||||
_preload_content=_preload_content,
|
|
||||||
_request_timeout=_request_timeout,
|
|
||||||
body=body)
|
|
||||||
raise tornado.gen.Return(result)
|
|
||||||
|
|
||||||
@tornado.gen.coroutine
|
|
||||||
def PUT(self, url, headers=None, query_params=None, post_params=None,
|
|
||||||
body=None, _preload_content=True, _request_timeout=None):
|
|
||||||
result = yield self.request("PUT", url,
|
|
||||||
headers=headers,
|
|
||||||
query_params=query_params,
|
|
||||||
post_params=post_params,
|
|
||||||
_preload_content=_preload_content,
|
|
||||||
_request_timeout=_request_timeout,
|
|
||||||
body=body)
|
|
||||||
raise tornado.gen.Return(result)
|
|
||||||
|
|
||||||
@tornado.gen.coroutine
|
|
||||||
def PATCH(self, url, headers=None, query_params=None, post_params=None,
|
|
||||||
body=None, _preload_content=True, _request_timeout=None):
|
|
||||||
result = yield self.request("PATCH", url,
|
|
||||||
headers=headers,
|
|
||||||
query_params=query_params,
|
|
||||||
post_params=post_params,
|
|
||||||
_preload_content=_preload_content,
|
|
||||||
_request_timeout=_request_timeout,
|
|
||||||
body=body)
|
|
||||||
raise tornado.gen.Return(result)
|
|
@ -0,0 +1,504 @@
|
|||||||
|
/*
|
||||||
|
* Copyright 2018 OpenAPI-Generator Contributors (https://openapi-generator.tech)
|
||||||
|
* Copyright 2018 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
|
||||||
|
*
|
||||||
|
* https://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.
|
||||||
|
*/
|
||||||
|
|
||||||
|
package org.openapitools.codegen.python;
|
||||||
|
|
||||||
|
import com.google.common.collect.Sets;
|
||||||
|
import io.swagger.parser.OpenAPIParser;
|
||||||
|
import io.swagger.v3.oas.models.OpenAPI;
|
||||||
|
import io.swagger.v3.oas.models.Operation;
|
||||||
|
import io.swagger.v3.oas.models.media.*;
|
||||||
|
import io.swagger.v3.parser.core.models.ParseOptions;
|
||||||
|
import io.swagger.v3.parser.util.SchemaTypeUtil;
|
||||||
|
import org.openapitools.codegen.*;
|
||||||
|
import org.openapitools.codegen.languages.PythonPydanticV1ClientCodegen;
|
||||||
|
import org.openapitools.codegen.languages.features.CXFServerFeatures;
|
||||||
|
import static org.openapitools.codegen.TestUtils.assertFileContains;
|
||||||
|
import static org.openapitools.codegen.TestUtils.assertFileExists;
|
||||||
|
import org.openapitools.codegen.TestUtils;
|
||||||
|
import org.testng.Assert;
|
||||||
|
import org.testng.annotations.Test;
|
||||||
|
import java.io.File;
|
||||||
|
import java.io.IOException;
|
||||||
|
import java.nio.file.Files;
|
||||||
|
import java.nio.file.Paths;
|
||||||
|
import java.nio.file.Path;
|
||||||
|
import java.util.ArrayList;
|
||||||
|
import java.util.Arrays;
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
public class PythonPydanticV1ClientCodegenTest {
|
||||||
|
|
||||||
|
@Test
|
||||||
|
public void testInitialConfigValues() throws Exception {
|
||||||
|
final PythonPydanticV1ClientCodegen codegen = new PythonPydanticV1ClientCodegen();
|
||||||
|
codegen.processOpts();
|
||||||
|
|
||||||
|
Assert.assertEquals(codegen.additionalProperties().get(CodegenConstants.HIDE_GENERATION_TIMESTAMP), Boolean.TRUE);
|
||||||
|
Assert.assertEquals(codegen.isHideGenerationTimestamp(), true);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Test
|
||||||
|
public void testSettersForConfigValues() throws Exception {
|
||||||
|
final PythonPydanticV1ClientCodegen codegen = new PythonPydanticV1ClientCodegen();
|
||||||
|
codegen.setHideGenerationTimestamp(false);
|
||||||
|
codegen.processOpts();
|
||||||
|
|
||||||
|
Assert.assertEquals(codegen.additionalProperties().get(CodegenConstants.HIDE_GENERATION_TIMESTAMP), Boolean.FALSE);
|
||||||
|
Assert.assertEquals(codegen.isHideGenerationTimestamp(), false);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Test
|
||||||
|
public void testAdditionalPropertiesPutForConfigValues() throws Exception {
|
||||||
|
final PythonPydanticV1ClientCodegen codegen = new PythonPydanticV1ClientCodegen();
|
||||||
|
codegen.additionalProperties().put(CodegenConstants.HIDE_GENERATION_TIMESTAMP, false);
|
||||||
|
codegen.processOpts();
|
||||||
|
|
||||||
|
Assert.assertEquals(codegen.additionalProperties().get(CodegenConstants.HIDE_GENERATION_TIMESTAMP), Boolean.FALSE);
|
||||||
|
Assert.assertEquals(codegen.isHideGenerationTimestamp(), false);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Test(description = "test enum null/nullable patterns")
|
||||||
|
public void testEnumNull() {
|
||||||
|
final OpenAPI openAPI = TestUtils.parseFlattenSpec("src/test/resources/3_0/issue_1997.yaml");
|
||||||
|
|
||||||
|
StringSchema prop = (StringSchema) openAPI.getComponents().getSchemas().get("Type").getProperties().get("prop");
|
||||||
|
ArrayList<Object> expected = new ArrayList<>(Arrays.asList("A", "B", "C"));
|
||||||
|
assert prop.getNullable();
|
||||||
|
assert prop.getEnum().equals(expected);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Test(description = "test regex patterns")
|
||||||
|
public void testRegularExpressionOpenAPISchemaVersion3() {
|
||||||
|
final OpenAPI openAPI = TestUtils.parseFlattenSpec("src/test/resources/3_0/issue_1517.yaml");
|
||||||
|
final PythonPydanticV1ClientCodegen codegen = new PythonPydanticV1ClientCodegen();
|
||||||
|
codegen.setOpenAPI(openAPI);
|
||||||
|
final String path = "/ping";
|
||||||
|
final Operation p = openAPI.getPaths().get(path).getGet();
|
||||||
|
final CodegenOperation op = codegen.fromOperation(path, "get", p, null);
|
||||||
|
// pattern_no_forward_slashes '^pattern$'
|
||||||
|
Assert.assertEquals(op.allParams.get(0).pattern, "/^pattern$/");
|
||||||
|
// pattern_two_slashes '/^pattern$/'
|
||||||
|
Assert.assertEquals(op.allParams.get(1).pattern, "/^pattern$/");
|
||||||
|
// pattern_dont_escape_backslash '/^pattern\d{3}$/'
|
||||||
|
Assert.assertEquals(op.allParams.get(2).pattern, "/^pattern\\d{3}$/");
|
||||||
|
// pattern_dont_escape_escaped_forward_slash '/^pattern\/\d{3}$/'
|
||||||
|
Assert.assertEquals(op.allParams.get(3).pattern, "/^pattern\\/\\d{3}$/");
|
||||||
|
// pattern_escape_unescaped_forward_slash '^pattern/\d{3}$'
|
||||||
|
Assert.assertEquals(op.allParams.get(4).pattern, "/^pattern\\/\\d{3}$/");
|
||||||
|
// pattern_with_modifiers '/^pattern\d{3}$/i
|
||||||
|
Assert.assertEquals(op.allParams.get(5).pattern, "/^pattern\\d{3}$/i");
|
||||||
|
// pattern_with_backslash_after_bracket '/^[\pattern\d{3}$/i'
|
||||||
|
// added to test fix for issue #6675
|
||||||
|
// removed because "/^[\\pattern\\d{3}$/i" is invalid regex because [ is not escaped and there is no closing ]
|
||||||
|
// Assert.assertEquals(op.allParams.get(6).pattern, "/^[\\pattern\\d{3}$/i");
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@Test(description = "test generated example values for string properties")
|
||||||
|
public void testGeneratedExampleValues() {
|
||||||
|
final OpenAPI openAPI = TestUtils.parseFlattenSpec("src/test/resources/3_0/examples.yaml");
|
||||||
|
final PythonPydanticV1ClientCodegen codegen = new PythonPydanticV1ClientCodegen();
|
||||||
|
codegen.setOpenAPI(openAPI);
|
||||||
|
final Schema dummyUserSchema = openAPI.getComponents().getSchemas().get("DummyUser");
|
||||||
|
final Schema nameSchema = (Schema) dummyUserSchema.getProperties().get("name");
|
||||||
|
final Schema numberSchema = (Schema) dummyUserSchema.getProperties().get("number");
|
||||||
|
final Schema addressSchema = (Schema) dummyUserSchema.getProperties().get("address");
|
||||||
|
final String namePattern = codegen.patternCorrection(nameSchema.getPattern());
|
||||||
|
final String numberPattern = codegen.patternCorrection(numberSchema.getPattern());
|
||||||
|
final String addressPattern = codegen.patternCorrection(addressSchema.getPattern());
|
||||||
|
Assert.assertTrue(codegen.escapeQuotationMark(codegen.toExampleValue(nameSchema)).matches(namePattern));
|
||||||
|
Assert.assertTrue(codegen.escapeQuotationMark(codegen.toExampleValue(numberSchema)).matches(numberPattern));
|
||||||
|
Assert.assertTrue(codegen.escapeQuotationMark(codegen.toExampleValue(addressSchema)).matches(addressPattern));
|
||||||
|
}
|
||||||
|
|
||||||
|
@Test(description = "test single quotes escape")
|
||||||
|
public void testSingleQuotes() {
|
||||||
|
final PythonPydanticV1ClientCodegen codegen = new PythonPydanticV1ClientCodegen();
|
||||||
|
StringSchema schema = new StringSchema();
|
||||||
|
schema.setDefault("Text containing 'single' quote");
|
||||||
|
String defaultValue = codegen.toDefaultValue(schema);
|
||||||
|
Assert.assertEquals("'Text containing \'single\' quote'", defaultValue);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Test(description = "test backslash default")
|
||||||
|
public void testBackslashDefault() {
|
||||||
|
final PythonPydanticV1ClientCodegen codegen = new PythonPydanticV1ClientCodegen();
|
||||||
|
StringSchema schema = new StringSchema();
|
||||||
|
schema.setDefault("\\");
|
||||||
|
String defaultValue = codegen.toDefaultValue(schema);
|
||||||
|
Assert.assertEquals("'\\\\'", defaultValue);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Test(description = "convert a python model with dots")
|
||||||
|
public void modelTest() {
|
||||||
|
final OpenAPI openAPI = TestUtils.parseFlattenSpec("src/test/resources/3_0/v1beta3.yaml");
|
||||||
|
final DefaultCodegen codegen = new PythonPydanticV1ClientCodegen();
|
||||||
|
codegen.setOpenAPI(openAPI);
|
||||||
|
|
||||||
|
codegen.setOpenAPI(openAPI);
|
||||||
|
final CodegenModel simpleName = codegen.fromModel("v1beta3.Binding", openAPI.getComponents().getSchemas().get("v1beta3.Binding"));
|
||||||
|
Assert.assertEquals(simpleName.name, "v1beta3.Binding");
|
||||||
|
Assert.assertEquals(simpleName.classname, "V1beta3Binding");
|
||||||
|
Assert.assertEquals(simpleName.classVarName, "v1beta3_binding");
|
||||||
|
|
||||||
|
codegen.setOpenAPI(openAPI);
|
||||||
|
final CodegenModel compoundName = codegen.fromModel("v1beta3.ComponentStatus", openAPI.getComponents().getSchemas().get("v1beta3.ComponentStatus"));
|
||||||
|
Assert.assertEquals(compoundName.name, "v1beta3.ComponentStatus");
|
||||||
|
Assert.assertEquals(compoundName.classname, "V1beta3ComponentStatus");
|
||||||
|
Assert.assertEquals(compoundName.classVarName, "v1beta3_component_status");
|
||||||
|
|
||||||
|
final String path = "/api/v1beta3/namespaces/{namespaces}/bindings";
|
||||||
|
final Operation operation = openAPI.getPaths().get(path).getPost();
|
||||||
|
final CodegenOperation codegenOperation = codegen.fromOperation(path, "get", operation, null);
|
||||||
|
Assert.assertEquals(codegenOperation.returnType, "V1beta3Binding");
|
||||||
|
Assert.assertEquals(codegenOperation.returnBaseType, "V1beta3Binding");
|
||||||
|
}
|
||||||
|
|
||||||
|
@Test(description = "convert a simple java model")
|
||||||
|
public void simpleModelTest() {
|
||||||
|
final Schema schema = new Schema()
|
||||||
|
.description("a sample model")
|
||||||
|
.addProperties("id", new IntegerSchema().format(SchemaTypeUtil.INTEGER64_FORMAT))
|
||||||
|
.addProperties("name", new StringSchema())
|
||||||
|
.addProperties("createdAt", new DateTimeSchema())
|
||||||
|
.addRequiredItem("id")
|
||||||
|
.addRequiredItem("name");
|
||||||
|
final DefaultCodegen codegen = new PythonPydanticV1ClientCodegen();
|
||||||
|
OpenAPI openAPI = TestUtils.createOpenAPIWithOneSchema("sample", schema);
|
||||||
|
codegen.setOpenAPI(openAPI);
|
||||||
|
final CodegenModel cm = codegen.fromModel("sample", schema);
|
||||||
|
|
||||||
|
Assert.assertEquals(cm.name, "sample");
|
||||||
|
Assert.assertEquals(cm.classname, "Sample");
|
||||||
|
Assert.assertEquals(cm.description, "a sample model");
|
||||||
|
Assert.assertEquals(cm.vars.size(), 3);
|
||||||
|
|
||||||
|
final CodegenProperty property1 = cm.vars.get(0);
|
||||||
|
Assert.assertEquals(property1.baseName, "id");
|
||||||
|
Assert.assertEquals(property1.dataType, "int");
|
||||||
|
Assert.assertEquals(property1.name, "id");
|
||||||
|
Assert.assertNull(property1.defaultValue);
|
||||||
|
Assert.assertEquals(property1.baseType, "int");
|
||||||
|
Assert.assertTrue(property1.required);
|
||||||
|
Assert.assertTrue(property1.isPrimitiveType);
|
||||||
|
|
||||||
|
final CodegenProperty property2 = cm.vars.get(1);
|
||||||
|
Assert.assertEquals(property2.baseName, "name");
|
||||||
|
Assert.assertEquals(property2.dataType, "str");
|
||||||
|
Assert.assertEquals(property2.name, "name");
|
||||||
|
Assert.assertNull(property2.defaultValue);
|
||||||
|
Assert.assertEquals(property2.baseType, "str");
|
||||||
|
Assert.assertTrue(property2.required);
|
||||||
|
Assert.assertTrue(property2.isPrimitiveType);
|
||||||
|
|
||||||
|
final CodegenProperty property3 = cm.vars.get(2);
|
||||||
|
Assert.assertEquals(property3.baseName, "createdAt");
|
||||||
|
Assert.assertEquals(property3.dataType, "datetime");
|
||||||
|
Assert.assertEquals(property3.name, "created_at");
|
||||||
|
Assert.assertNull(property3.defaultValue);
|
||||||
|
Assert.assertEquals(property3.baseType, "datetime");
|
||||||
|
Assert.assertFalse(property3.required);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Test(description = "convert a model with list property")
|
||||||
|
public void listPropertyTest() {
|
||||||
|
final Schema model = new Schema()
|
||||||
|
.description("a sample model")
|
||||||
|
.addProperties("id", new IntegerSchema().format(SchemaTypeUtil.INTEGER64_FORMAT))
|
||||||
|
.addProperties("urls", new ArraySchema()
|
||||||
|
.items(new StringSchema()))
|
||||||
|
.addRequiredItem("id");
|
||||||
|
final DefaultCodegen codegen = new PythonPydanticV1ClientCodegen();
|
||||||
|
OpenAPI openAPI = TestUtils.createOpenAPIWithOneSchema("sample", model);
|
||||||
|
codegen.setOpenAPI(openAPI);
|
||||||
|
final CodegenModel cm = codegen.fromModel("sample", model);
|
||||||
|
|
||||||
|
Assert.assertEquals(cm.name, "sample");
|
||||||
|
Assert.assertEquals(cm.classname, "Sample");
|
||||||
|
Assert.assertEquals(cm.description, "a sample model");
|
||||||
|
Assert.assertEquals(cm.vars.size(), 2);
|
||||||
|
|
||||||
|
final CodegenProperty property1 = cm.vars.get(0);
|
||||||
|
Assert.assertEquals(property1.baseName, "id");
|
||||||
|
Assert.assertEquals(property1.dataType, "int");
|
||||||
|
Assert.assertEquals(property1.name, "id");
|
||||||
|
Assert.assertNull(property1.defaultValue);
|
||||||
|
Assert.assertEquals(property1.baseType, "int");
|
||||||
|
Assert.assertTrue(property1.required);
|
||||||
|
Assert.assertTrue(property1.isPrimitiveType);
|
||||||
|
|
||||||
|
final CodegenProperty property2 = cm.vars.get(1);
|
||||||
|
Assert.assertEquals(property2.baseName, "urls");
|
||||||
|
Assert.assertEquals(property2.dataType, "List[str]");
|
||||||
|
Assert.assertEquals(property2.name, "urls");
|
||||||
|
Assert.assertNull(property2.defaultValue);
|
||||||
|
Assert.assertEquals(property2.baseType, "List");
|
||||||
|
Assert.assertEquals(property2.containerType, "array");
|
||||||
|
Assert.assertFalse(property2.required);
|
||||||
|
Assert.assertTrue(property2.isPrimitiveType);
|
||||||
|
Assert.assertTrue(property2.isContainer);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Test(description = "convert a model with a map property")
|
||||||
|
public void mapPropertyTest() {
|
||||||
|
final Schema model = new Schema()
|
||||||
|
.description("a sample model")
|
||||||
|
.addProperties("translations", new MapSchema()
|
||||||
|
.additionalProperties(new StringSchema()))
|
||||||
|
.addRequiredItem("id");
|
||||||
|
final DefaultCodegen codegen = new PythonPydanticV1ClientCodegen();
|
||||||
|
OpenAPI openAPI = TestUtils.createOpenAPIWithOneSchema("sample", model);
|
||||||
|
codegen.setOpenAPI(openAPI);
|
||||||
|
final CodegenModel cm = codegen.fromModel("sample", model);
|
||||||
|
|
||||||
|
Assert.assertEquals(cm.name, "sample");
|
||||||
|
Assert.assertEquals(cm.classname, "Sample");
|
||||||
|
Assert.assertEquals(cm.description, "a sample model");
|
||||||
|
Assert.assertEquals(cm.vars.size(), 1);
|
||||||
|
|
||||||
|
final CodegenProperty property1 = cm.vars.get(0);
|
||||||
|
Assert.assertEquals(property1.baseName, "translations");
|
||||||
|
Assert.assertEquals(property1.dataType, "Dict[str, str]");
|
||||||
|
Assert.assertEquals(property1.name, "translations");
|
||||||
|
Assert.assertEquals(property1.baseType, "Dict");
|
||||||
|
Assert.assertEquals(property1.containerType, "map");
|
||||||
|
Assert.assertFalse(property1.required);
|
||||||
|
Assert.assertTrue(property1.isContainer);
|
||||||
|
Assert.assertTrue(property1.isPrimitiveType);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Test(description = "convert a model with complex property")
|
||||||
|
public void complexPropertyTest() {
|
||||||
|
final Schema model = new Schema()
|
||||||
|
.description("a sample model")
|
||||||
|
.addProperties("children", new Schema().$ref("#/definitions/Children"));
|
||||||
|
final DefaultCodegen codegen = new PythonPydanticV1ClientCodegen();
|
||||||
|
OpenAPI openAPI = TestUtils.createOpenAPIWithOneSchema("sample", model);
|
||||||
|
codegen.setOpenAPI(openAPI);
|
||||||
|
final CodegenModel cm = codegen.fromModel("sample", model);
|
||||||
|
|
||||||
|
Assert.assertEquals(cm.name, "sample");
|
||||||
|
Assert.assertEquals(cm.classname, "Sample");
|
||||||
|
Assert.assertEquals(cm.description, "a sample model");
|
||||||
|
Assert.assertEquals(cm.vars.size(), 1);
|
||||||
|
|
||||||
|
final CodegenProperty property1 = cm.vars.get(0);
|
||||||
|
Assert.assertEquals(property1.baseName, "children");
|
||||||
|
Assert.assertEquals(property1.dataType, "Children");
|
||||||
|
Assert.assertEquals(property1.name, "children");
|
||||||
|
Assert.assertEquals(property1.baseType, "Children");
|
||||||
|
Assert.assertFalse(property1.required);
|
||||||
|
Assert.assertFalse(property1.isContainer);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Test(description = "convert a model with complex list property")
|
||||||
|
public void complexListPropertyTest() {
|
||||||
|
final Schema model = new Schema()
|
||||||
|
.description("a sample model")
|
||||||
|
.addProperties("children", new ArraySchema()
|
||||||
|
.items(new Schema().$ref("#/definitions/Children")));
|
||||||
|
final DefaultCodegen codegen = new PythonPydanticV1ClientCodegen();
|
||||||
|
OpenAPI openAPI = TestUtils.createOpenAPIWithOneSchema("sample", model);
|
||||||
|
codegen.setOpenAPI(openAPI);
|
||||||
|
final CodegenModel cm = codegen.fromModel("sample", model);
|
||||||
|
|
||||||
|
Assert.assertEquals(cm.name, "sample");
|
||||||
|
Assert.assertEquals(cm.classname, "Sample");
|
||||||
|
Assert.assertEquals(cm.description, "a sample model");
|
||||||
|
Assert.assertEquals(cm.vars.size(), 1);
|
||||||
|
|
||||||
|
final CodegenProperty property1 = cm.vars.get(0);
|
||||||
|
Assert.assertEquals(property1.baseName, "children");
|
||||||
|
Assert.assertEquals(property1.complexType, "Children");
|
||||||
|
Assert.assertEquals(property1.dataType, "List[Children]");
|
||||||
|
Assert.assertEquals(property1.name, "children");
|
||||||
|
Assert.assertEquals(property1.baseType, "List");
|
||||||
|
Assert.assertEquals(property1.containerType, "array");
|
||||||
|
Assert.assertFalse(property1.required);
|
||||||
|
Assert.assertTrue(property1.isContainer);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Test(description = "convert a model with complex map property")
|
||||||
|
public void complexMapPropertyTest() {
|
||||||
|
final Schema model = new Schema()
|
||||||
|
.description("a sample model")
|
||||||
|
.addProperties("children", new MapSchema()
|
||||||
|
.additionalProperties(new Schema().$ref("#/definitions/Children")));
|
||||||
|
final DefaultCodegen codegen = new PythonPydanticV1ClientCodegen();
|
||||||
|
OpenAPI openAPI = TestUtils.createOpenAPIWithOneSchema("sample", model);
|
||||||
|
codegen.setOpenAPI(openAPI);
|
||||||
|
final CodegenModel cm = codegen.fromModel("sample", model);
|
||||||
|
|
||||||
|
Assert.assertEquals(cm.name, "sample");
|
||||||
|
Assert.assertEquals(cm.classname, "Sample");
|
||||||
|
Assert.assertEquals(cm.description, "a sample model");
|
||||||
|
Assert.assertEquals(cm.vars.size(), 1);
|
||||||
|
Assert.assertEquals(Sets.intersection(cm.imports, Sets.newHashSet("Children")).size(), 1);
|
||||||
|
|
||||||
|
final CodegenProperty property1 = cm.vars.get(0);
|
||||||
|
Assert.assertEquals(property1.baseName, "children");
|
||||||
|
Assert.assertEquals(property1.complexType, "Children");
|
||||||
|
Assert.assertEquals(property1.dataType, "Dict[str, Children]");
|
||||||
|
Assert.assertEquals(property1.name, "children");
|
||||||
|
Assert.assertEquals(property1.baseType, "Dict");
|
||||||
|
Assert.assertEquals(property1.containerType, "map");
|
||||||
|
Assert.assertFalse(property1.required);
|
||||||
|
Assert.assertTrue(property1.isContainer);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
// should not start with 'null'. need help from the community to investigate further
|
||||||
|
@Test(description = "convert an array model")
|
||||||
|
public void arrayModelTest() {
|
||||||
|
final Schema model = new ArraySchema()
|
||||||
|
//.description()
|
||||||
|
.items(new Schema().$ref("#/definitions/Children"))
|
||||||
|
.description("an array model");
|
||||||
|
final DefaultCodegen codegen = new PythonPydanticV1ClientCodegen();
|
||||||
|
OpenAPI openAPI = TestUtils.createOpenAPIWithOneSchema("sample", model);
|
||||||
|
codegen.setOpenAPI(openAPI);
|
||||||
|
final CodegenModel cm = codegen.fromModel("sample", model);
|
||||||
|
|
||||||
|
Assert.assertEquals(cm.name, "sample");
|
||||||
|
Assert.assertEquals(cm.classname, "Sample");
|
||||||
|
Assert.assertEquals(cm.description, "an array model");
|
||||||
|
Assert.assertEquals(cm.vars.size(), 0);
|
||||||
|
Assert.assertEquals(cm.parent, "null<Children>");
|
||||||
|
Assert.assertEquals(cm.imports.size(), 1);
|
||||||
|
Assert.assertEquals(Sets.intersection(cm.imports, Sets.newHashSet("Children")).size(), 1);
|
||||||
|
}
|
||||||
|
|
||||||
|
// should not start with 'null'. need help from the community to investigate further
|
||||||
|
@Test(description = "convert a map model")
|
||||||
|
public void mapModelTest() {
|
||||||
|
final Schema model = new Schema()
|
||||||
|
.description("a map model")
|
||||||
|
.additionalProperties(new Schema().$ref("#/definitions/Children"));
|
||||||
|
final DefaultCodegen codegen = new PythonPydanticV1ClientCodegen();
|
||||||
|
OpenAPI openAPI = TestUtils.createOpenAPIWithOneSchema("sample", model);
|
||||||
|
codegen.setOpenAPI(openAPI);
|
||||||
|
final CodegenModel cm = codegen.fromModel("sample", model);
|
||||||
|
|
||||||
|
Assert.assertEquals(cm.name, "sample");
|
||||||
|
Assert.assertEquals(cm.classname, "Sample");
|
||||||
|
Assert.assertEquals(cm.description, "a map model");
|
||||||
|
Assert.assertEquals(cm.vars.size(), 0);
|
||||||
|
Assert.assertEquals(cm.parent, null);
|
||||||
|
Assert.assertEquals(cm.imports.size(), 0);
|
||||||
|
}
|
||||||
|
@Test(description ="check API example has input param(configuration) when it creates api_client")
|
||||||
|
public void apiExampleDocTest() throws Exception {
|
||||||
|
final DefaultCodegen codegen = new PythonPydanticV1ClientCodegen();
|
||||||
|
final String outputPath = generateFiles(codegen, "src/test/resources/3_0/generic.yaml");
|
||||||
|
final Path p = Paths.get(outputPath + "docs/DefaultApi.md");
|
||||||
|
|
||||||
|
assertFileExists(p);
|
||||||
|
assertFileContains(p, "openapi_client.ApiClient(configuration) as api_client");
|
||||||
|
}
|
||||||
|
|
||||||
|
// Helper function, intended to reduce boilerplate
|
||||||
|
static private String generateFiles(DefaultCodegen codegen, String filePath) throws IOException {
|
||||||
|
final File output = Files.createTempDirectory("test").toFile().getCanonicalFile();
|
||||||
|
output.deleteOnExit();
|
||||||
|
final String outputPath = output.getAbsolutePath().replace('\\', '/');
|
||||||
|
|
||||||
|
codegen.setOutputDir(output.getAbsolutePath());
|
||||||
|
codegen.additionalProperties().put(CXFServerFeatures.LOAD_TEST_DATA_FROM_FILE, "true");
|
||||||
|
|
||||||
|
final ClientOptInput input = new ClientOptInput();
|
||||||
|
final OpenAPI openAPI = new OpenAPIParser().readLocation(filePath, null, new ParseOptions()).getOpenAPI();
|
||||||
|
input.openAPI(openAPI);
|
||||||
|
input.config(codegen);
|
||||||
|
|
||||||
|
final DefaultGenerator generator = new DefaultGenerator();
|
||||||
|
final List<File> files = generator.opts(input).generate();
|
||||||
|
|
||||||
|
Assert.assertTrue(files.size() > 0);
|
||||||
|
return outputPath + "/";
|
||||||
|
}
|
||||||
|
|
||||||
|
@Test(description = "test containerType in parameters")
|
||||||
|
public void testContainerType() {
|
||||||
|
final OpenAPI openAPI = TestUtils.parseFlattenSpec("src/test/resources/3_0/petstore.yaml");
|
||||||
|
final PythonPydanticV1ClientCodegen codegen = new PythonPydanticV1ClientCodegen();
|
||||||
|
codegen.setOpenAPI(openAPI);
|
||||||
|
// path parameter
|
||||||
|
String path = "/store/order/{orderId}";
|
||||||
|
Operation p = openAPI.getPaths().get(path).getGet();
|
||||||
|
CodegenOperation op = codegen.fromOperation(path, "get", p, null);
|
||||||
|
Assert.assertEquals(op.allParams.get(0).containerType, null);
|
||||||
|
Assert.assertEquals(op.allParams.get(0).baseName, "orderId");
|
||||||
|
|
||||||
|
// query parameter
|
||||||
|
path = "/user/login";
|
||||||
|
p = openAPI.getPaths().get(path).getGet();
|
||||||
|
op = codegen.fromOperation(path, "get", p, null);
|
||||||
|
Assert.assertEquals(op.allParams.get(0).containerType, null);
|
||||||
|
Assert.assertEquals(op.allParams.get(0).baseName, "username");
|
||||||
|
Assert.assertEquals(op.allParams.get(1).containerType, null);
|
||||||
|
Assert.assertEquals(op.allParams.get(1).baseName, "password");
|
||||||
|
|
||||||
|
// body parameter
|
||||||
|
path = "/user/createWithList";
|
||||||
|
p = openAPI.getPaths().get(path).getPost();
|
||||||
|
op = codegen.fromOperation(path, "post", p, null);
|
||||||
|
Assert.assertEquals(op.allParams.get(0).baseName, "User");
|
||||||
|
Assert.assertEquals(op.allParams.get(0).containerType, "array");
|
||||||
|
Assert.assertEquals(op.allParams.get(0).containerTypeMapped, "List");
|
||||||
|
|
||||||
|
path = "/pet";
|
||||||
|
p = openAPI.getPaths().get(path).getPost();
|
||||||
|
op = codegen.fromOperation(path, "post", p, null);
|
||||||
|
Assert.assertEquals(op.allParams.get(0).baseName, "Pet");
|
||||||
|
Assert.assertEquals(op.allParams.get(0).containerType, null);
|
||||||
|
Assert.assertEquals(op.allParams.get(0).containerTypeMapped, null);
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
@Test(description = "test containerType (dict) in parameters")
|
||||||
|
public void testContainerTypeForDict() {
|
||||||
|
final OpenAPI openAPI = TestUtils.parseFlattenSpec("src/test/resources/3_0/dict_query_parameter.yaml");
|
||||||
|
final PythonPydanticV1ClientCodegen codegen = new PythonPydanticV1ClientCodegen();
|
||||||
|
codegen.setOpenAPI(openAPI);
|
||||||
|
// query parameter
|
||||||
|
String path = "/query_parameter_dict";
|
||||||
|
Operation p = openAPI.getPaths().get(path).getGet();
|
||||||
|
CodegenOperation op = codegen.fromOperation(path, "get", p, null);
|
||||||
|
Assert.assertEquals(op.allParams.get(0).containerType, "map");
|
||||||
|
Assert.assertEquals(op.allParams.get(0).containerTypeMapped, "Dict");
|
||||||
|
Assert.assertEquals(op.allParams.get(0).baseName, "dict_string_integer");
|
||||||
|
}
|
||||||
|
|
||||||
|
@Test(description = "convert a model with dollar signs")
|
||||||
|
public void modelTestDollarSign() {
|
||||||
|
final OpenAPI openAPI = TestUtils.parseFlattenSpec("src/test/resources/3_0/dollar-in-names-pull14359.yaml");
|
||||||
|
final DefaultCodegen codegen = new PythonPydanticV1ClientCodegen();
|
||||||
|
|
||||||
|
codegen.setOpenAPI(openAPI);
|
||||||
|
final CodegenModel simpleName = codegen.fromModel("$DollarModel$", openAPI.getComponents().getSchemas().get("$DollarModel$"));
|
||||||
|
Assert.assertEquals(simpleName.name, "$DollarModel$");
|
||||||
|
Assert.assertEquals(simpleName.classname, "DollarModel");
|
||||||
|
Assert.assertEquals(simpleName.classVarName, "dollar_model");
|
||||||
|
|
||||||
|
List<CodegenProperty> vars = simpleName.getVars();
|
||||||
|
Assert.assertEquals(vars.size(), 1);
|
||||||
|
CodegenProperty property = vars.get(0);
|
||||||
|
Assert.assertEquals(property.name, "dollar_value");
|
||||||
|
}
|
||||||
|
}
|
2
pom.xml
2
pom.xml
@ -1217,7 +1217,9 @@
|
|||||||
<modules>
|
<modules>
|
||||||
<!-- clients -->
|
<!-- clients -->
|
||||||
<module>samples/openapi3/client/petstore/python</module>
|
<module>samples/openapi3/client/petstore/python</module>
|
||||||
|
<module>samples/openapi3/client/petstore/python-pydantic-v1</module>
|
||||||
<module>samples/openapi3/client/petstore/python-aiohttp</module>
|
<module>samples/openapi3/client/petstore/python-aiohttp</module>
|
||||||
|
<module>samples/openapi3/client/petstore/python-pydantic-v1-aiohttp</module>
|
||||||
<!-- TODO comment out below when the test for typescript-nestjs is ready
|
<!-- TODO comment out below when the test for typescript-nestjs is ready
|
||||||
<module>samples/client/petstore/typescript-nestjs-v6-provided-in-root</module>-->
|
<module>samples/client/petstore/typescript-nestjs-v6-provided-in-root</module>-->
|
||||||
<!-- comment out due to error `npm run build`
|
<!-- comment out due to error `npm run build`
|
||||||
|
@ -5,7 +5,7 @@ This Python package is automatically generated by the [OpenAPI Generator](https:
|
|||||||
|
|
||||||
- API version: 0.1.0
|
- API version: 0.1.0
|
||||||
- Package version: 1.0.0
|
- Package version: 1.0.0
|
||||||
- Build package: org.openapitools.codegen.languages.PythonClientPydanticV1Codegen
|
- Build package: org.openapitools.codegen.languages.PythonPydanticV1ClientCodegen
|
||||||
|
|
||||||
## Requirements.
|
## Requirements.
|
||||||
|
|
||||||
|
@ -3,20 +3,22 @@
|
|||||||
"""
|
"""
|
||||||
Echo Server API
|
Echo Server API
|
||||||
|
|
||||||
Echo Server API
|
Echo Server API # noqa: E501
|
||||||
|
|
||||||
The version of the OpenAPI document: 0.1.0
|
The version of the OpenAPI document: 0.1.0
|
||||||
Contact: team@openapitools.org
|
Contact: team@openapitools.org
|
||||||
Generated by OpenAPI Generator (https://openapi-generator.tech)
|
Generated by: https://openapi-generator.tech
|
||||||
|
"""
|
||||||
|
|
||||||
Do not edit the class manually.
|
|
||||||
""" # noqa: E501
|
|
||||||
|
|
||||||
|
from __future__ import absolute_import
|
||||||
|
|
||||||
import unittest
|
import unittest
|
||||||
import datetime
|
import datetime
|
||||||
|
|
||||||
|
import openapi_client
|
||||||
from openapi_client.models.bird import Bird # noqa: E501
|
from openapi_client.models.bird import Bird # noqa: E501
|
||||||
|
from openapi_client.rest import ApiException
|
||||||
|
|
||||||
class TestBird(unittest.TestCase):
|
class TestBird(unittest.TestCase):
|
||||||
"""Bird unit test stubs"""
|
"""Bird unit test stubs"""
|
||||||
@ -27,20 +29,20 @@ class TestBird(unittest.TestCase):
|
|||||||
def tearDown(self):
|
def tearDown(self):
|
||||||
pass
|
pass
|
||||||
|
|
||||||
def make_instance(self, include_optional) -> Bird:
|
def make_instance(self, include_optional):
|
||||||
"""Test Bird
|
"""Test Bird
|
||||||
include_option is a boolean, when False only required
|
include_option is a boolean, when False only required
|
||||||
params are included, when True both required and
|
params are included, when True both required and
|
||||||
optional params are included """
|
optional params are included """
|
||||||
# uncomment below to create an instance of `Bird`
|
# uncomment below to create an instance of `Bird`
|
||||||
"""
|
"""
|
||||||
model = Bird() # noqa: E501
|
model = openapi_client.models.bird.Bird() # noqa: E501
|
||||||
if include_optional:
|
if include_optional :
|
||||||
return Bird(
|
return Bird(
|
||||||
size = '',
|
size = '',
|
||||||
color = ''
|
color = ''
|
||||||
)
|
)
|
||||||
else:
|
else :
|
||||||
return Bird(
|
return Bird(
|
||||||
)
|
)
|
||||||
"""
|
"""
|
||||||
|
@ -3,79 +3,39 @@
|
|||||||
"""
|
"""
|
||||||
Echo Server API
|
Echo Server API
|
||||||
|
|
||||||
Echo Server API
|
Echo Server API # noqa: E501
|
||||||
|
|
||||||
The version of the OpenAPI document: 0.1.0
|
The version of the OpenAPI document: 0.1.0
|
||||||
Contact: team@openapitools.org
|
Contact: team@openapitools.org
|
||||||
Generated by OpenAPI Generator (https://openapi-generator.tech)
|
Generated by: https://openapi-generator.tech
|
||||||
|
"""
|
||||||
|
|
||||||
Do not edit the class manually.
|
|
||||||
""" # noqa: E501
|
|
||||||
|
|
||||||
|
from __future__ import absolute_import
|
||||||
|
|
||||||
import unittest
|
import unittest
|
||||||
|
|
||||||
|
import openapi_client
|
||||||
from openapi_client.api.body_api import BodyApi # noqa: E501
|
from openapi_client.api.body_api import BodyApi # noqa: E501
|
||||||
|
from openapi_client.rest import ApiException
|
||||||
|
|
||||||
|
|
||||||
class TestBodyApi(unittest.TestCase):
|
class TestBodyApi(unittest.TestCase):
|
||||||
"""BodyApi unit test stubs"""
|
"""BodyApi unit test stubs"""
|
||||||
|
|
||||||
def setUp(self) -> None:
|
def setUp(self):
|
||||||
self.api = BodyApi() # noqa: E501
|
self.api = openapi_client.api.body_api.BodyApi() # noqa: E501
|
||||||
|
|
||||||
def tearDown(self) -> None:
|
def tearDown(self):
|
||||||
pass
|
pass
|
||||||
|
|
||||||
def test_test_binary_gif(self) -> None:
|
def test_test_echo_body_pet(self):
|
||||||
"""Test case for test_binary_gif
|
|
||||||
|
|
||||||
Test binary (gif) response body # noqa: E501
|
|
||||||
"""
|
|
||||||
pass
|
|
||||||
|
|
||||||
def test_test_body_application_octetstream_binary(self) -> None:
|
|
||||||
"""Test case for test_body_application_octetstream_binary
|
|
||||||
|
|
||||||
Test body parameter(s) # noqa: E501
|
|
||||||
"""
|
|
||||||
pass
|
|
||||||
|
|
||||||
def test_test_body_multipart_formdata_array_of_binary(self) -> None:
|
|
||||||
"""Test case for test_body_multipart_formdata_array_of_binary
|
|
||||||
|
|
||||||
Test array of binary in multipart mime # noqa: E501
|
|
||||||
"""
|
|
||||||
pass
|
|
||||||
|
|
||||||
def test_test_echo_body_free_form_object_response_string(self) -> None:
|
|
||||||
"""Test case for test_echo_body_free_form_object_response_string
|
|
||||||
|
|
||||||
Test free form object # noqa: E501
|
|
||||||
"""
|
|
||||||
pass
|
|
||||||
|
|
||||||
def test_test_echo_body_pet(self) -> None:
|
|
||||||
"""Test case for test_echo_body_pet
|
"""Test case for test_echo_body_pet
|
||||||
|
|
||||||
Test body parameter(s) # noqa: E501
|
Test body parameter(s) # noqa: E501
|
||||||
"""
|
"""
|
||||||
pass
|
pass
|
||||||
|
|
||||||
def test_test_echo_body_pet_response_string(self) -> None:
|
|
||||||
"""Test case for test_echo_body_pet_response_string
|
|
||||||
|
|
||||||
Test empty response body # noqa: E501
|
|
||||||
"""
|
|
||||||
pass
|
|
||||||
|
|
||||||
def test_test_echo_body_tag_response_string(self) -> None:
|
|
||||||
"""Test case for test_echo_body_tag_response_string
|
|
||||||
|
|
||||||
Test empty json (request body) # noqa: E501
|
|
||||||
"""
|
|
||||||
pass
|
|
||||||
|
|
||||||
|
|
||||||
if __name__ == '__main__':
|
if __name__ == '__main__':
|
||||||
unittest.main()
|
unittest.main()
|
||||||
|
@ -3,20 +3,22 @@
|
|||||||
"""
|
"""
|
||||||
Echo Server API
|
Echo Server API
|
||||||
|
|
||||||
Echo Server API
|
Echo Server API # noqa: E501
|
||||||
|
|
||||||
The version of the OpenAPI document: 0.1.0
|
The version of the OpenAPI document: 0.1.0
|
||||||
Contact: team@openapitools.org
|
Contact: team@openapitools.org
|
||||||
Generated by OpenAPI Generator (https://openapi-generator.tech)
|
Generated by: https://openapi-generator.tech
|
||||||
|
"""
|
||||||
|
|
||||||
Do not edit the class manually.
|
|
||||||
""" # noqa: E501
|
|
||||||
|
|
||||||
|
from __future__ import absolute_import
|
||||||
|
|
||||||
import unittest
|
import unittest
|
||||||
import datetime
|
import datetime
|
||||||
|
|
||||||
|
import openapi_client
|
||||||
from openapi_client.models.category import Category # noqa: E501
|
from openapi_client.models.category import Category # noqa: E501
|
||||||
|
from openapi_client.rest import ApiException
|
||||||
|
|
||||||
class TestCategory(unittest.TestCase):
|
class TestCategory(unittest.TestCase):
|
||||||
"""Category unit test stubs"""
|
"""Category unit test stubs"""
|
||||||
@ -27,20 +29,20 @@ class TestCategory(unittest.TestCase):
|
|||||||
def tearDown(self):
|
def tearDown(self):
|
||||||
pass
|
pass
|
||||||
|
|
||||||
def make_instance(self, include_optional) -> Category:
|
def make_instance(self, include_optional):
|
||||||
"""Test Category
|
"""Test Category
|
||||||
include_option is a boolean, when False only required
|
include_option is a boolean, when False only required
|
||||||
params are included, when True both required and
|
params are included, when True both required and
|
||||||
optional params are included """
|
optional params are included """
|
||||||
# uncomment below to create an instance of `Category`
|
# uncomment below to create an instance of `Category`
|
||||||
"""
|
"""
|
||||||
model = Category() # noqa: E501
|
model = openapi_client.models.category.Category() # noqa: E501
|
||||||
if include_optional:
|
if include_optional :
|
||||||
return Category(
|
return Category(
|
||||||
id = 1,
|
id = 1,
|
||||||
name = 'Dogs'
|
name = 'Dogs'
|
||||||
)
|
)
|
||||||
else:
|
else :
|
||||||
return Category(
|
return Category(
|
||||||
)
|
)
|
||||||
"""
|
"""
|
||||||
|
@ -3,20 +3,22 @@
|
|||||||
"""
|
"""
|
||||||
Echo Server API
|
Echo Server API
|
||||||
|
|
||||||
Echo Server API
|
Echo Server API # noqa: E501
|
||||||
|
|
||||||
The version of the OpenAPI document: 0.1.0
|
The version of the OpenAPI document: 0.1.0
|
||||||
Contact: team@openapitools.org
|
Contact: team@openapitools.org
|
||||||
Generated by OpenAPI Generator (https://openapi-generator.tech)
|
Generated by: https://openapi-generator.tech
|
||||||
|
"""
|
||||||
|
|
||||||
Do not edit the class manually.
|
|
||||||
""" # noqa: E501
|
|
||||||
|
|
||||||
|
from __future__ import absolute_import
|
||||||
|
|
||||||
import unittest
|
import unittest
|
||||||
import datetime
|
import datetime
|
||||||
|
|
||||||
|
import openapi_client
|
||||||
from openapi_client.models.data_query import DataQuery # noqa: E501
|
from openapi_client.models.data_query import DataQuery # noqa: E501
|
||||||
|
from openapi_client.rest import ApiException
|
||||||
|
|
||||||
class TestDataQuery(unittest.TestCase):
|
class TestDataQuery(unittest.TestCase):
|
||||||
"""DataQuery unit test stubs"""
|
"""DataQuery unit test stubs"""
|
||||||
@ -27,21 +29,21 @@ class TestDataQuery(unittest.TestCase):
|
|||||||
def tearDown(self):
|
def tearDown(self):
|
||||||
pass
|
pass
|
||||||
|
|
||||||
def make_instance(self, include_optional) -> DataQuery:
|
def make_instance(self, include_optional):
|
||||||
"""Test DataQuery
|
"""Test DataQuery
|
||||||
include_option is a boolean, when False only required
|
include_option is a boolean, when False only required
|
||||||
params are included, when True both required and
|
params are included, when True both required and
|
||||||
optional params are included """
|
optional params are included """
|
||||||
# uncomment below to create an instance of `DataQuery`
|
# uncomment below to create an instance of `DataQuery`
|
||||||
"""
|
"""
|
||||||
model = DataQuery() # noqa: E501
|
model = openapi_client.models.data_query.DataQuery() # noqa: E501
|
||||||
if include_optional:
|
if include_optional :
|
||||||
return DataQuery(
|
return DataQuery(
|
||||||
suffix = '',
|
suffix = '',
|
||||||
text = 'Some text',
|
text = 'Some text',
|
||||||
var_date = datetime.datetime.strptime('2013-10-20 19:20:30.00', '%Y-%m-%d %H:%M:%S.%f')
|
var_date = datetime.datetime.strptime('2013-10-20 19:20:30.00', '%Y-%m-%d %H:%M:%S.%f')
|
||||||
)
|
)
|
||||||
else:
|
else :
|
||||||
return DataQuery(
|
return DataQuery(
|
||||||
)
|
)
|
||||||
"""
|
"""
|
||||||
|
@ -3,20 +3,22 @@
|
|||||||
"""
|
"""
|
||||||
Echo Server API
|
Echo Server API
|
||||||
|
|
||||||
Echo Server API
|
Echo Server API # noqa: E501
|
||||||
|
|
||||||
The version of the OpenAPI document: 0.1.0
|
The version of the OpenAPI document: 0.1.0
|
||||||
Contact: team@openapitools.org
|
Contact: team@openapitools.org
|
||||||
Generated by OpenAPI Generator (https://openapi-generator.tech)
|
Generated by: https://openapi-generator.tech
|
||||||
|
"""
|
||||||
|
|
||||||
Do not edit the class manually.
|
|
||||||
""" # noqa: E501
|
|
||||||
|
|
||||||
|
from __future__ import absolute_import
|
||||||
|
|
||||||
import unittest
|
import unittest
|
||||||
import datetime
|
import datetime
|
||||||
|
|
||||||
|
import openapi_client
|
||||||
from openapi_client.models.default_value import DefaultValue # noqa: E501
|
from openapi_client.models.default_value import DefaultValue # noqa: E501
|
||||||
|
from openapi_client.rest import ApiException
|
||||||
|
|
||||||
class TestDefaultValue(unittest.TestCase):
|
class TestDefaultValue(unittest.TestCase):
|
||||||
"""DefaultValue unit test stubs"""
|
"""DefaultValue unit test stubs"""
|
||||||
@ -27,19 +29,16 @@ class TestDefaultValue(unittest.TestCase):
|
|||||||
def tearDown(self):
|
def tearDown(self):
|
||||||
pass
|
pass
|
||||||
|
|
||||||
def make_instance(self, include_optional) -> DefaultValue:
|
def make_instance(self, include_optional):
|
||||||
"""Test DefaultValue
|
"""Test DefaultValue
|
||||||
include_option is a boolean, when False only required
|
include_option is a boolean, when False only required
|
||||||
params are included, when True both required and
|
params are included, when True both required and
|
||||||
optional params are included """
|
optional params are included """
|
||||||
# uncomment below to create an instance of `DefaultValue`
|
# uncomment below to create an instance of `DefaultValue`
|
||||||
"""
|
"""
|
||||||
model = DefaultValue() # noqa: E501
|
model = openapi_client.models.default_value.DefaultValue() # noqa: E501
|
||||||
if include_optional:
|
if include_optional :
|
||||||
return DefaultValue(
|
return DefaultValue(
|
||||||
array_string_enum_ref_default = [
|
|
||||||
'success'
|
|
||||||
],
|
|
||||||
array_string_enum_default = [
|
array_string_enum_default = [
|
||||||
'success'
|
'success'
|
||||||
],
|
],
|
||||||
@ -55,12 +54,9 @@ class TestDefaultValue(unittest.TestCase):
|
|||||||
array_string_nullable = [
|
array_string_nullable = [
|
||||||
''
|
''
|
||||||
],
|
],
|
||||||
array_string_extension_nullable = [
|
|
||||||
''
|
|
||||||
],
|
|
||||||
string_nullable = ''
|
string_nullable = ''
|
||||||
)
|
)
|
||||||
else:
|
else :
|
||||||
return DefaultValue(
|
return DefaultValue(
|
||||||
)
|
)
|
||||||
"""
|
"""
|
||||||
|
@ -3,44 +3,39 @@
|
|||||||
"""
|
"""
|
||||||
Echo Server API
|
Echo Server API
|
||||||
|
|
||||||
Echo Server API
|
Echo Server API # noqa: E501
|
||||||
|
|
||||||
The version of the OpenAPI document: 0.1.0
|
The version of the OpenAPI document: 0.1.0
|
||||||
Contact: team@openapitools.org
|
Contact: team@openapitools.org
|
||||||
Generated by OpenAPI Generator (https://openapi-generator.tech)
|
Generated by: https://openapi-generator.tech
|
||||||
|
"""
|
||||||
|
|
||||||
Do not edit the class manually.
|
|
||||||
""" # noqa: E501
|
|
||||||
|
|
||||||
|
from __future__ import absolute_import
|
||||||
|
|
||||||
import unittest
|
import unittest
|
||||||
|
|
||||||
|
import openapi_client
|
||||||
from openapi_client.api.form_api import FormApi # noqa: E501
|
from openapi_client.api.form_api import FormApi # noqa: E501
|
||||||
|
from openapi_client.rest import ApiException
|
||||||
|
|
||||||
|
|
||||||
class TestFormApi(unittest.TestCase):
|
class TestFormApi(unittest.TestCase):
|
||||||
"""FormApi unit test stubs"""
|
"""FormApi unit test stubs"""
|
||||||
|
|
||||||
def setUp(self) -> None:
|
def setUp(self):
|
||||||
self.api = FormApi() # noqa: E501
|
self.api = openapi_client.api.form_api.FormApi() # noqa: E501
|
||||||
|
|
||||||
def tearDown(self) -> None:
|
def tearDown(self):
|
||||||
pass
|
pass
|
||||||
|
|
||||||
def test_test_form_integer_boolean_string(self) -> None:
|
def test_test_form_integer_boolean_string(self):
|
||||||
"""Test case for test_form_integer_boolean_string
|
"""Test case for test_form_integer_boolean_string
|
||||||
|
|
||||||
Test form parameter(s) # noqa: E501
|
Test form parameter(s) # noqa: E501
|
||||||
"""
|
"""
|
||||||
pass
|
pass
|
||||||
|
|
||||||
def test_test_form_oneof(self) -> None:
|
|
||||||
"""Test case for test_form_oneof
|
|
||||||
|
|
||||||
Test form parameter(s) for oneOf schema # noqa: E501
|
|
||||||
"""
|
|
||||||
pass
|
|
||||||
|
|
||||||
|
|
||||||
if __name__ == '__main__':
|
if __name__ == '__main__':
|
||||||
unittest.main()
|
unittest.main()
|
||||||
|
@ -3,31 +3,33 @@
|
|||||||
"""
|
"""
|
||||||
Echo Server API
|
Echo Server API
|
||||||
|
|
||||||
Echo Server API
|
Echo Server API # noqa: E501
|
||||||
|
|
||||||
The version of the OpenAPI document: 0.1.0
|
The version of the OpenAPI document: 0.1.0
|
||||||
Contact: team@openapitools.org
|
Contact: team@openapitools.org
|
||||||
Generated by OpenAPI Generator (https://openapi-generator.tech)
|
Generated by: https://openapi-generator.tech
|
||||||
|
"""
|
||||||
|
|
||||||
Do not edit the class manually.
|
|
||||||
""" # noqa: E501
|
|
||||||
|
|
||||||
|
from __future__ import absolute_import
|
||||||
|
|
||||||
import unittest
|
import unittest
|
||||||
|
|
||||||
|
import openapi_client
|
||||||
from openapi_client.api.header_api import HeaderApi # noqa: E501
|
from openapi_client.api.header_api import HeaderApi # noqa: E501
|
||||||
|
from openapi_client.rest import ApiException
|
||||||
|
|
||||||
|
|
||||||
class TestHeaderApi(unittest.TestCase):
|
class TestHeaderApi(unittest.TestCase):
|
||||||
"""HeaderApi unit test stubs"""
|
"""HeaderApi unit test stubs"""
|
||||||
|
|
||||||
def setUp(self) -> None:
|
def setUp(self):
|
||||||
self.api = HeaderApi() # noqa: E501
|
self.api = openapi_client.api.header_api.HeaderApi() # noqa: E501
|
||||||
|
|
||||||
def tearDown(self) -> None:
|
def tearDown(self):
|
||||||
pass
|
pass
|
||||||
|
|
||||||
def test_test_header_integer_boolean_string(self) -> None:
|
def test_test_header_integer_boolean_string(self):
|
||||||
"""Test case for test_header_integer_boolean_string
|
"""Test case for test_header_integer_boolean_string
|
||||||
|
|
||||||
Test header parameter(s) # noqa: E501
|
Test header parameter(s) # noqa: E501
|
||||||
|
187
samples/client/echo_api/python-pydantic-v1/test/test_manual.py
Normal file
187
samples/client/echo_api/python-pydantic-v1/test/test_manual.py
Normal file
@ -0,0 +1,187 @@
|
|||||||
|
# coding: utf-8
|
||||||
|
|
||||||
|
"""
|
||||||
|
Echo Server API
|
||||||
|
|
||||||
|
Echo Server API # noqa: E501
|
||||||
|
|
||||||
|
The version of the OpenAPI document: 0.1.0
|
||||||
|
Contact: team@openapitools.org
|
||||||
|
Generated by: https://openapi-generator.tech
|
||||||
|
"""
|
||||||
|
|
||||||
|
from __future__ import absolute_import
|
||||||
|
|
||||||
|
import unittest
|
||||||
|
import datetime
|
||||||
|
import base64
|
||||||
|
import os
|
||||||
|
|
||||||
|
import openapi_client
|
||||||
|
from openapi_client.api.query_api import QueryApi # noqa: E501
|
||||||
|
from openapi_client.rest import ApiException
|
||||||
|
|
||||||
|
class TestManual(unittest.TestCase):
|
||||||
|
"""Manually written tests"""
|
||||||
|
|
||||||
|
gif_base64 = "R0lGODlhAQABAIABAP///wAAACH5BAEKAAEALAAAAAABAAEAAAICTAEAOw=="
|
||||||
|
|
||||||
|
def setUpFiles(self):
|
||||||
|
self.test_file_dir = os.path.join(os.path.dirname(__file__), "..", "testfiles")
|
||||||
|
self.test_file_dir = os.path.realpath(self.test_file_dir)
|
||||||
|
self.test_gif = os.path.join(self.test_file_dir, "test.gif")
|
||||||
|
|
||||||
|
def setUp(self):
|
||||||
|
self.setUpFiles()
|
||||||
|
|
||||||
|
def tearDown(self):
|
||||||
|
pass
|
||||||
|
|
||||||
|
def testEnumRefString(self):
|
||||||
|
api_instance = openapi_client.QueryApi()
|
||||||
|
q = openapi_client.StringEnumRef("unclassified")
|
||||||
|
|
||||||
|
# Test query parameter(s)
|
||||||
|
api_response = api_instance.test_enum_ref_string(enum_ref_string_query=q)
|
||||||
|
e = EchoServerResponseParser(api_response)
|
||||||
|
self.assertEqual(e.path, "/query/enum_ref_string?enum_ref_string_query=unclassified")
|
||||||
|
|
||||||
|
|
||||||
|
def testDateTimeQueryWithDateTimeFormat(self):
|
||||||
|
api_instance = openapi_client.QueryApi()
|
||||||
|
datetime_format_backup = api_instance.api_client.configuration.datetime_format # backup dateime_format
|
||||||
|
api_instance.api_client.configuration.datetime_format = "%Y-%m-%d %a %H:%M:%S%Z"
|
||||||
|
datetime_query = datetime.datetime.fromisoformat('2013-10-20T19:20:30-05:00') # datetime | (optional)
|
||||||
|
date_query = '2013-10-20' # date | (optional)
|
||||||
|
string_query = 'string_query_example' # str | (optional)
|
||||||
|
|
||||||
|
# Test query parameter(s)
|
||||||
|
api_response = api_instance.test_query_datetime_date_string(datetime_query=datetime_query, date_query=date_query, string_query=string_query)
|
||||||
|
e = EchoServerResponseParser(api_response)
|
||||||
|
self.assertEqual(e.path, "/query/datetime/date/string?datetime_query=2013-10-20%20Sun%2019%3A20%3A30UTC-05%3A00&date_query=2013-10-20&string_query=string_query_example")
|
||||||
|
|
||||||
|
# restore datetime format
|
||||||
|
api_instance.api_client.configuration.datetime_format = datetime_format_backup
|
||||||
|
|
||||||
|
def testDateTimeQueryWithDateTime(self):
|
||||||
|
api_instance = openapi_client.QueryApi()
|
||||||
|
datetime_query = datetime.datetime.fromisoformat('2013-10-20T19:20:30-05:00') # datetime | (optional)
|
||||||
|
date_query = '2013-10-20' # date | (optional)
|
||||||
|
string_query = 'string_query_example' # str | (optional)
|
||||||
|
|
||||||
|
# Test query parameter(s)
|
||||||
|
api_response = api_instance.test_query_datetime_date_string(datetime_query=datetime_query, date_query=date_query, string_query=string_query)
|
||||||
|
e = EchoServerResponseParser(api_response)
|
||||||
|
self.assertEqual(e.path, "/query/datetime/date/string?datetime_query=2013-10-20T19%3A20%3A30.000000-0500&date_query=2013-10-20&string_query=string_query_example")
|
||||||
|
|
||||||
|
def testBinaryGif(self):
|
||||||
|
api_instance = openapi_client.BodyApi()
|
||||||
|
|
||||||
|
# Test binary response
|
||||||
|
api_response = api_instance.test_binary_gif()
|
||||||
|
self.assertEqual((base64.b64encode(api_response)).decode("utf-8"), self.gif_base64)
|
||||||
|
|
||||||
|
def testNumberPropertiesOnly(self):
|
||||||
|
n = openapi_client.NumberPropertiesOnly.from_json('{"number": 123, "float": 456, "double": 34}')
|
||||||
|
self.assertEqual(n.number, 123)
|
||||||
|
self.assertEqual(n.float, 456)
|
||||||
|
self.assertEqual(n.double, 34)
|
||||||
|
|
||||||
|
n = openapi_client.NumberPropertiesOnly.from_json('{"number": 123.1, "float": 456.2, "double": 34.3}')
|
||||||
|
self.assertEqual(n.number, 123.1)
|
||||||
|
self.assertEqual(n.float, 456.2)
|
||||||
|
self.assertEqual(n.double, 34.3)
|
||||||
|
|
||||||
|
def testApplicatinOctetStreamBinaryBodyParameter(self):
|
||||||
|
api_instance = openapi_client.BodyApi()
|
||||||
|
binary_body = base64.b64decode(self.gif_base64)
|
||||||
|
api_response = api_instance.test_body_application_octetstream_binary(binary_body)
|
||||||
|
e = EchoServerResponseParser(api_response)
|
||||||
|
self.assertEqual(e.path, "/body/application/octetstream/binary")
|
||||||
|
self.assertEqual(e.headers["Content-Type"], 'application/octet-stream')
|
||||||
|
self.assertEqual(bytes(e.body, "utf-8"), b'GIF89a\x01\x00\x01\x00\xef\xbf\xbd\x01\x00\xef\xbf\xbd\xef\xbf\xbd\xef\xbf\xbd\x00\x00\x00!\xef\xbf\xbd\x04\x01\n\x00\x01\x00,\x00\x00\x00\x00\x01\x00\x01\x00\x00\x02\x02L\x01\x00;')
|
||||||
|
|
||||||
|
def testApplicatinOctetStreamBinaryBodyParameterWithFile(self):
|
||||||
|
api_instance = openapi_client.BodyApi()
|
||||||
|
try:
|
||||||
|
api_response = api_instance.test_body_application_octetstream_binary("invalid_file_path")
|
||||||
|
except FileNotFoundError as err:
|
||||||
|
self.assertEqual("[Errno 2] No such file or directory: 'invalid_file_path'", str(err))
|
||||||
|
|
||||||
|
api_response = api_instance.test_body_application_octetstream_binary(self.test_gif)
|
||||||
|
e = EchoServerResponseParser(api_response)
|
||||||
|
self.assertEqual(e.path, "/body/application/octetstream/binary")
|
||||||
|
self.assertEqual(e.headers["Content-Type"], 'application/octet-stream')
|
||||||
|
self.assertEqual(bytes(e.body, "utf-8"), b'GIF89a\x01\x00\x01\x00\xef\xbf\xbd\x01\x00\xef\xbf\xbd\xef\xbf\xbd\xef\xbf\xbd\x00\x00\x00!\xef\xbf\xbd\x04\x01\n\x00\x01\x00,\x00\x00\x00\x00\x01\x00\x01\x00\x00\x02\x02L\x01\x00;')
|
||||||
|
|
||||||
|
def testBodyParameter(self):
|
||||||
|
n = openapi_client.Pet.from_dict({"name": "testing", "photoUrls": ["http://1", "http://2"]})
|
||||||
|
api_instance = openapi_client.BodyApi()
|
||||||
|
api_response = api_instance.test_echo_body_pet_response_string(n)
|
||||||
|
self.assertEqual(api_response, "{'name': 'testing', 'photoUrls': ['http://1', 'http://2']}")
|
||||||
|
|
||||||
|
t = openapi_client.Tag()
|
||||||
|
api_response = api_instance.test_echo_body_tag_response_string(t)
|
||||||
|
self.assertEqual(api_response, "{}") # assertion to ensure {} is sent in the body
|
||||||
|
|
||||||
|
api_response = api_instance.test_echo_body_tag_response_string(None)
|
||||||
|
self.assertEqual(api_response, "") # assertion to ensure emtpy string is sent in the body
|
||||||
|
|
||||||
|
api_response = api_instance.test_echo_body_free_form_object_response_string({})
|
||||||
|
self.assertEqual(api_response, "{}") # assertion to ensure {} is sent in the body
|
||||||
|
|
||||||
|
def testAuthHttpBasic(self):
|
||||||
|
api_instance = openapi_client.AuthApi()
|
||||||
|
api_response = api_instance.test_auth_http_basic()
|
||||||
|
e = EchoServerResponseParser(api_response)
|
||||||
|
self.assertFalse("Authorization" in e.headers)
|
||||||
|
|
||||||
|
api_instance.api_client.configuration.username = "test_username"
|
||||||
|
api_instance.api_client.configuration.password = "test_password"
|
||||||
|
api_response = api_instance.test_auth_http_basic()
|
||||||
|
e = EchoServerResponseParser(api_response)
|
||||||
|
self.assertTrue("Authorization" in e.headers)
|
||||||
|
self.assertEqual(e.headers["Authorization"], "Basic dGVzdF91c2VybmFtZTp0ZXN0X3Bhc3N3b3Jk")
|
||||||
|
|
||||||
|
def echoServerResponseParaserTest(self):
|
||||||
|
s = """POST /echo/body/Pet/response_string HTTP/1.1
|
||||||
|
Host: localhost:3000
|
||||||
|
Accept-Encoding: identity
|
||||||
|
Content-Length: 58
|
||||||
|
Accept: text/plain
|
||||||
|
Content-Type: application/json
|
||||||
|
User-Agent: OpenAPI-Generator/1.0.0/python
|
||||||
|
|
||||||
|
{"name": "testing", "photoUrls": ["http://1", "http://2"]}"""
|
||||||
|
e = EchoServerResponseParser(s)
|
||||||
|
self.assertEqual(e.body, '{"name": "testing", "photoUrls": ["http://1", "http://2"]}')
|
||||||
|
self.assertEqual(e.path, '/echo/body/Pet/response_string')
|
||||||
|
self.assertEqual(e.headers["Accept"], 'text/plain')
|
||||||
|
self.assertEqual(e.method, 'POST')
|
||||||
|
|
||||||
|
class EchoServerResponseParser():
|
||||||
|
def __init__(self, http_response):
|
||||||
|
if http_response is None:
|
||||||
|
raise ValueError("http response must not be None.")
|
||||||
|
|
||||||
|
lines = http_response.splitlines()
|
||||||
|
self.headers = dict()
|
||||||
|
x = 0
|
||||||
|
while x < len(lines):
|
||||||
|
if x == 0:
|
||||||
|
items = lines[x].split(" ")
|
||||||
|
self.method = items[0];
|
||||||
|
self.path = items[1];
|
||||||
|
self.protocol = items[2];
|
||||||
|
elif lines[x] == "": # blank line
|
||||||
|
self.body = "\n".join(lines[x+1:])
|
||||||
|
break
|
||||||
|
else:
|
||||||
|
key_value = lines[x].split(": ")
|
||||||
|
# store the header key-value pair in headers
|
||||||
|
if len(key_value) == 2:
|
||||||
|
self.headers[key_value[0]] = key_value[1]
|
||||||
|
x = x+1
|
||||||
|
|
||||||
|
if __name__ == '__main__':
|
||||||
|
unittest.main()
|
@ -3,20 +3,22 @@
|
|||||||
"""
|
"""
|
||||||
Echo Server API
|
Echo Server API
|
||||||
|
|
||||||
Echo Server API
|
Echo Server API # noqa: E501
|
||||||
|
|
||||||
The version of the OpenAPI document: 0.1.0
|
The version of the OpenAPI document: 0.1.0
|
||||||
Contact: team@openapitools.org
|
Contact: team@openapitools.org
|
||||||
Generated by OpenAPI Generator (https://openapi-generator.tech)
|
Generated by OpenAPI Generator (https://openapi-generator.tech)
|
||||||
|
|
||||||
Do not edit the class manually.
|
Do not edit the class manually.
|
||||||
""" # noqa: E501
|
"""
|
||||||
|
|
||||||
|
|
||||||
import unittest
|
import unittest
|
||||||
import datetime
|
import datetime
|
||||||
|
|
||||||
|
import openapi_client
|
||||||
from openapi_client.models.number_properties_only import NumberPropertiesOnly # noqa: E501
|
from openapi_client.models.number_properties_only import NumberPropertiesOnly # noqa: E501
|
||||||
|
from openapi_client.rest import ApiException
|
||||||
|
|
||||||
class TestNumberPropertiesOnly(unittest.TestCase):
|
class TestNumberPropertiesOnly(unittest.TestCase):
|
||||||
"""NumberPropertiesOnly unit test stubs"""
|
"""NumberPropertiesOnly unit test stubs"""
|
||||||
@ -27,21 +29,21 @@ class TestNumberPropertiesOnly(unittest.TestCase):
|
|||||||
def tearDown(self):
|
def tearDown(self):
|
||||||
pass
|
pass
|
||||||
|
|
||||||
def make_instance(self, include_optional) -> NumberPropertiesOnly:
|
def make_instance(self, include_optional):
|
||||||
"""Test NumberPropertiesOnly
|
"""Test NumberPropertiesOnly
|
||||||
include_option is a boolean, when False only required
|
include_option is a boolean, when False only required
|
||||||
params are included, when True both required and
|
params are included, when True both required and
|
||||||
optional params are included """
|
optional params are included """
|
||||||
# uncomment below to create an instance of `NumberPropertiesOnly`
|
# uncomment below to create an instance of `NumberPropertiesOnly`
|
||||||
"""
|
"""
|
||||||
model = NumberPropertiesOnly() # noqa: E501
|
model = openapi_client.models.number_properties_only.NumberPropertiesOnly() # noqa: E501
|
||||||
if include_optional:
|
if include_optional :
|
||||||
return NumberPropertiesOnly(
|
return NumberPropertiesOnly(
|
||||||
number = 1.337,
|
number = 1.337,
|
||||||
float = 1.337,
|
float = 1.337,
|
||||||
double = 0.8
|
double = ''
|
||||||
)
|
)
|
||||||
else:
|
else :
|
||||||
return NumberPropertiesOnly(
|
return NumberPropertiesOnly(
|
||||||
)
|
)
|
||||||
"""
|
"""
|
||||||
|
@ -3,31 +3,33 @@
|
|||||||
"""
|
"""
|
||||||
Echo Server API
|
Echo Server API
|
||||||
|
|
||||||
Echo Server API
|
Echo Server API # noqa: E501
|
||||||
|
|
||||||
The version of the OpenAPI document: 0.1.0
|
The version of the OpenAPI document: 0.1.0
|
||||||
Contact: team@openapitools.org
|
Contact: team@openapitools.org
|
||||||
Generated by OpenAPI Generator (https://openapi-generator.tech)
|
Generated by: https://openapi-generator.tech
|
||||||
|
"""
|
||||||
|
|
||||||
Do not edit the class manually.
|
|
||||||
""" # noqa: E501
|
|
||||||
|
|
||||||
|
from __future__ import absolute_import
|
||||||
|
|
||||||
import unittest
|
import unittest
|
||||||
|
|
||||||
|
import openapi_client
|
||||||
from openapi_client.api.path_api import PathApi # noqa: E501
|
from openapi_client.api.path_api import PathApi # noqa: E501
|
||||||
|
from openapi_client.rest import ApiException
|
||||||
|
|
||||||
|
|
||||||
class TestPathApi(unittest.TestCase):
|
class TestPathApi(unittest.TestCase):
|
||||||
"""PathApi unit test stubs"""
|
"""PathApi unit test stubs"""
|
||||||
|
|
||||||
def setUp(self) -> None:
|
def setUp(self):
|
||||||
self.api = PathApi() # noqa: E501
|
self.api = openapi_client.api.path_api.PathApi() # noqa: E501
|
||||||
|
|
||||||
def tearDown(self) -> None:
|
def tearDown(self):
|
||||||
pass
|
pass
|
||||||
|
|
||||||
def test_tests_path_string_path_string_integer_path_integer(self) -> None:
|
def test_tests_path_string_path_string_integer_path_integer(self):
|
||||||
"""Test case for tests_path_string_path_string_integer_path_integer
|
"""Test case for tests_path_string_path_string_integer_path_integer
|
||||||
|
|
||||||
Test path parameter(s) # noqa: E501
|
Test path parameter(s) # noqa: E501
|
||||||
|
@ -3,20 +3,22 @@
|
|||||||
"""
|
"""
|
||||||
Echo Server API
|
Echo Server API
|
||||||
|
|
||||||
Echo Server API
|
Echo Server API # noqa: E501
|
||||||
|
|
||||||
The version of the OpenAPI document: 0.1.0
|
The version of the OpenAPI document: 0.1.0
|
||||||
Contact: team@openapitools.org
|
Contact: team@openapitools.org
|
||||||
Generated by OpenAPI Generator (https://openapi-generator.tech)
|
Generated by: https://openapi-generator.tech
|
||||||
|
"""
|
||||||
|
|
||||||
Do not edit the class manually.
|
|
||||||
""" # noqa: E501
|
|
||||||
|
|
||||||
|
from __future__ import absolute_import
|
||||||
|
|
||||||
import unittest
|
import unittest
|
||||||
import datetime
|
import datetime
|
||||||
|
|
||||||
|
import openapi_client
|
||||||
from openapi_client.models.pet import Pet # noqa: E501
|
from openapi_client.models.pet import Pet # noqa: E501
|
||||||
|
from openapi_client.rest import ApiException
|
||||||
|
|
||||||
class TestPet(unittest.TestCase):
|
class TestPet(unittest.TestCase):
|
||||||
"""Pet unit test stubs"""
|
"""Pet unit test stubs"""
|
||||||
@ -27,15 +29,15 @@ class TestPet(unittest.TestCase):
|
|||||||
def tearDown(self):
|
def tearDown(self):
|
||||||
pass
|
pass
|
||||||
|
|
||||||
def make_instance(self, include_optional) -> Pet:
|
def make_instance(self, include_optional):
|
||||||
"""Test Pet
|
"""Test Pet
|
||||||
include_option is a boolean, when False only required
|
include_option is a boolean, when False only required
|
||||||
params are included, when True both required and
|
params are included, when True both required and
|
||||||
optional params are included """
|
optional params are included """
|
||||||
# uncomment below to create an instance of `Pet`
|
# uncomment below to create an instance of `Pet`
|
||||||
"""
|
"""
|
||||||
model = Pet() # noqa: E501
|
model = openapi_client.models.pet.Pet() # noqa: E501
|
||||||
if include_optional:
|
if include_optional :
|
||||||
return Pet(
|
return Pet(
|
||||||
id = 10,
|
id = 10,
|
||||||
name = 'doggie',
|
name = 'doggie',
|
||||||
@ -52,7 +54,7 @@ class TestPet(unittest.TestCase):
|
|||||||
],
|
],
|
||||||
status = 'available'
|
status = 'available'
|
||||||
)
|
)
|
||||||
else:
|
else :
|
||||||
return Pet(
|
return Pet(
|
||||||
name = 'doggie',
|
name = 'doggie',
|
||||||
photo_urls = [
|
photo_urls = [
|
||||||
|
@ -3,20 +3,22 @@
|
|||||||
"""
|
"""
|
||||||
Echo Server API
|
Echo Server API
|
||||||
|
|
||||||
Echo Server API
|
Echo Server API # noqa: E501
|
||||||
|
|
||||||
The version of the OpenAPI document: 0.1.0
|
The version of the OpenAPI document: 0.1.0
|
||||||
Contact: team@openapitools.org
|
Contact: team@openapitools.org
|
||||||
Generated by OpenAPI Generator (https://openapi-generator.tech)
|
Generated by: https://openapi-generator.tech
|
||||||
|
"""
|
||||||
|
|
||||||
Do not edit the class manually.
|
|
||||||
""" # noqa: E501
|
|
||||||
|
|
||||||
|
from __future__ import absolute_import
|
||||||
|
|
||||||
import unittest
|
import unittest
|
||||||
import datetime
|
import datetime
|
||||||
|
|
||||||
|
import openapi_client
|
||||||
from openapi_client.models.query import Query # noqa: E501
|
from openapi_client.models.query import Query # noqa: E501
|
||||||
|
from openapi_client.rest import ApiException
|
||||||
|
|
||||||
class TestQuery(unittest.TestCase):
|
class TestQuery(unittest.TestCase):
|
||||||
"""Query unit test stubs"""
|
"""Query unit test stubs"""
|
||||||
@ -27,22 +29,22 @@ class TestQuery(unittest.TestCase):
|
|||||||
def tearDown(self):
|
def tearDown(self):
|
||||||
pass
|
pass
|
||||||
|
|
||||||
def make_instance(self, include_optional) -> Query:
|
def make_instance(self, include_optional):
|
||||||
"""Test Query
|
"""Test Query
|
||||||
include_option is a boolean, when False only required
|
include_option is a boolean, when False only required
|
||||||
params are included, when True both required and
|
params are included, when True both required and
|
||||||
optional params are included """
|
optional params are included """
|
||||||
# uncomment below to create an instance of `Query`
|
# uncomment below to create an instance of `Query`
|
||||||
"""
|
"""
|
||||||
model = Query() # noqa: E501
|
model = openapi_client.models.query.Query() # noqa: E501
|
||||||
if include_optional:
|
if include_optional :
|
||||||
return Query(
|
return Query(
|
||||||
id = 56,
|
id = 56,
|
||||||
outcomes = [
|
outcomes = [
|
||||||
'SUCCESS'
|
'SUCCESS'
|
||||||
]
|
]
|
||||||
)
|
)
|
||||||
else:
|
else :
|
||||||
return Query(
|
return Query(
|
||||||
)
|
)
|
||||||
"""
|
"""
|
||||||
|
@ -3,86 +3,53 @@
|
|||||||
"""
|
"""
|
||||||
Echo Server API
|
Echo Server API
|
||||||
|
|
||||||
Echo Server API
|
Echo Server API # noqa: E501
|
||||||
|
|
||||||
The version of the OpenAPI document: 0.1.0
|
The version of the OpenAPI document: 0.1.0
|
||||||
Contact: team@openapitools.org
|
Contact: team@openapitools.org
|
||||||
Generated by OpenAPI Generator (https://openapi-generator.tech)
|
Generated by: https://openapi-generator.tech
|
||||||
|
"""
|
||||||
|
|
||||||
Do not edit the class manually.
|
|
||||||
""" # noqa: E501
|
|
||||||
|
|
||||||
|
from __future__ import absolute_import
|
||||||
|
|
||||||
import unittest
|
import unittest
|
||||||
|
|
||||||
|
import openapi_client
|
||||||
from openapi_client.api.query_api import QueryApi # noqa: E501
|
from openapi_client.api.query_api import QueryApi # noqa: E501
|
||||||
|
from openapi_client.rest import ApiException
|
||||||
|
|
||||||
|
|
||||||
class TestQueryApi(unittest.TestCase):
|
class TestQueryApi(unittest.TestCase):
|
||||||
"""QueryApi unit test stubs"""
|
"""QueryApi unit test stubs"""
|
||||||
|
|
||||||
def setUp(self) -> None:
|
def setUp(self):
|
||||||
self.api = QueryApi() # noqa: E501
|
self.api = openapi_client.api.query_api.QueryApi() # noqa: E501
|
||||||
|
|
||||||
def tearDown(self) -> None:
|
def tearDown(self):
|
||||||
pass
|
pass
|
||||||
|
|
||||||
def test_test_enum_ref_string(self) -> None:
|
def test_test_query_integer_boolean_string(self):
|
||||||
"""Test case for test_enum_ref_string
|
|
||||||
|
|
||||||
Test query parameter(s) # noqa: E501
|
|
||||||
"""
|
|
||||||
pass
|
|
||||||
|
|
||||||
def test_test_query_datetime_date_string(self) -> None:
|
|
||||||
"""Test case for test_query_datetime_date_string
|
|
||||||
|
|
||||||
Test query parameter(s) # noqa: E501
|
|
||||||
"""
|
|
||||||
pass
|
|
||||||
|
|
||||||
def test_test_query_integer_boolean_string(self) -> None:
|
|
||||||
"""Test case for test_query_integer_boolean_string
|
"""Test case for test_query_integer_boolean_string
|
||||||
|
|
||||||
Test query parameter(s) # noqa: E501
|
Test query parameter(s) # noqa: E501
|
||||||
"""
|
"""
|
||||||
pass
|
pass
|
||||||
|
|
||||||
def test_test_query_style_deep_object_explode_true_object(self) -> None:
|
def test_test_query_style_form_explode_true_array_string(self):
|
||||||
"""Test case for test_query_style_deep_object_explode_true_object
|
|
||||||
|
|
||||||
Test query parameter(s) # noqa: E501
|
|
||||||
"""
|
|
||||||
pass
|
|
||||||
|
|
||||||
def test_test_query_style_deep_object_explode_true_object_all_of(self) -> None:
|
|
||||||
"""Test case for test_query_style_deep_object_explode_true_object_all_of
|
|
||||||
|
|
||||||
Test query parameter(s) # noqa: E501
|
|
||||||
"""
|
|
||||||
pass
|
|
||||||
|
|
||||||
def test_test_query_style_form_explode_true_array_string(self) -> None:
|
|
||||||
"""Test case for test_query_style_form_explode_true_array_string
|
"""Test case for test_query_style_form_explode_true_array_string
|
||||||
|
|
||||||
Test query parameter(s) # noqa: E501
|
Test query parameter(s) # noqa: E501
|
||||||
"""
|
"""
|
||||||
pass
|
pass
|
||||||
|
|
||||||
def test_test_query_style_form_explode_true_object(self) -> None:
|
def test_test_query_style_form_explode_true_object(self):
|
||||||
"""Test case for test_query_style_form_explode_true_object
|
"""Test case for test_query_style_form_explode_true_object
|
||||||
|
|
||||||
Test query parameter(s) # noqa: E501
|
Test query parameter(s) # noqa: E501
|
||||||
"""
|
"""
|
||||||
pass
|
pass
|
||||||
|
|
||||||
def test_test_query_style_form_explode_true_object_all_of(self) -> None:
|
|
||||||
"""Test case for test_query_style_form_explode_true_object_all_of
|
|
||||||
|
|
||||||
Test query parameter(s) # noqa: E501
|
|
||||||
"""
|
|
||||||
pass
|
|
||||||
|
|
||||||
|
|
||||||
if __name__ == '__main__':
|
if __name__ == '__main__':
|
||||||
unittest.main()
|
unittest.main()
|
||||||
|
@ -3,20 +3,22 @@
|
|||||||
"""
|
"""
|
||||||
Echo Server API
|
Echo Server API
|
||||||
|
|
||||||
Echo Server API
|
Echo Server API # noqa: E501
|
||||||
|
|
||||||
The version of the OpenAPI document: 0.1.0
|
The version of the OpenAPI document: 0.1.0
|
||||||
Contact: team@openapitools.org
|
Contact: team@openapitools.org
|
||||||
Generated by OpenAPI Generator (https://openapi-generator.tech)
|
Generated by: https://openapi-generator.tech
|
||||||
|
"""
|
||||||
|
|
||||||
Do not edit the class manually.
|
|
||||||
""" # noqa: E501
|
|
||||||
|
|
||||||
|
from __future__ import absolute_import
|
||||||
|
|
||||||
import unittest
|
import unittest
|
||||||
import datetime
|
import datetime
|
||||||
|
|
||||||
|
import openapi_client
|
||||||
from openapi_client.models.string_enum_ref import StringEnumRef # noqa: E501
|
from openapi_client.models.string_enum_ref import StringEnumRef # noqa: E501
|
||||||
|
from openapi_client.rest import ApiException
|
||||||
|
|
||||||
class TestStringEnumRef(unittest.TestCase):
|
class TestStringEnumRef(unittest.TestCase):
|
||||||
"""StringEnumRef unit test stubs"""
|
"""StringEnumRef unit test stubs"""
|
||||||
|
@ -3,20 +3,22 @@
|
|||||||
"""
|
"""
|
||||||
Echo Server API
|
Echo Server API
|
||||||
|
|
||||||
Echo Server API
|
Echo Server API # noqa: E501
|
||||||
|
|
||||||
The version of the OpenAPI document: 0.1.0
|
The version of the OpenAPI document: 0.1.0
|
||||||
Contact: team@openapitools.org
|
Contact: team@openapitools.org
|
||||||
Generated by OpenAPI Generator (https://openapi-generator.tech)
|
Generated by: https://openapi-generator.tech
|
||||||
|
"""
|
||||||
|
|
||||||
Do not edit the class manually.
|
|
||||||
""" # noqa: E501
|
|
||||||
|
|
||||||
|
from __future__ import absolute_import
|
||||||
|
|
||||||
import unittest
|
import unittest
|
||||||
import datetime
|
import datetime
|
||||||
|
|
||||||
|
import openapi_client
|
||||||
from openapi_client.models.tag import Tag # noqa: E501
|
from openapi_client.models.tag import Tag # noqa: E501
|
||||||
|
from openapi_client.rest import ApiException
|
||||||
|
|
||||||
class TestTag(unittest.TestCase):
|
class TestTag(unittest.TestCase):
|
||||||
"""Tag unit test stubs"""
|
"""Tag unit test stubs"""
|
||||||
@ -27,20 +29,20 @@ class TestTag(unittest.TestCase):
|
|||||||
def tearDown(self):
|
def tearDown(self):
|
||||||
pass
|
pass
|
||||||
|
|
||||||
def make_instance(self, include_optional) -> Tag:
|
def make_instance(self, include_optional):
|
||||||
"""Test Tag
|
"""Test Tag
|
||||||
include_option is a boolean, when False only required
|
include_option is a boolean, when False only required
|
||||||
params are included, when True both required and
|
params are included, when True both required and
|
||||||
optional params are included """
|
optional params are included """
|
||||||
# uncomment below to create an instance of `Tag`
|
# uncomment below to create an instance of `Tag`
|
||||||
"""
|
"""
|
||||||
model = Tag() # noqa: E501
|
model = openapi_client.models.tag.Tag() # noqa: E501
|
||||||
if include_optional:
|
if include_optional :
|
||||||
return Tag(
|
return Tag(
|
||||||
id = 56,
|
id = 56,
|
||||||
name = ''
|
name = ''
|
||||||
)
|
)
|
||||||
else:
|
else :
|
||||||
return Tag(
|
return Tag(
|
||||||
)
|
)
|
||||||
"""
|
"""
|
||||||
|
@ -3,20 +3,22 @@
|
|||||||
"""
|
"""
|
||||||
Echo Server API
|
Echo Server API
|
||||||
|
|
||||||
Echo Server API
|
Echo Server API # noqa: E501
|
||||||
|
|
||||||
The version of the OpenAPI document: 0.1.0
|
The version of the OpenAPI document: 0.1.0
|
||||||
Contact: team@openapitools.org
|
Contact: team@openapitools.org
|
||||||
Generated by OpenAPI Generator (https://openapi-generator.tech)
|
Generated by: https://openapi-generator.tech
|
||||||
|
"""
|
||||||
|
|
||||||
Do not edit the class manually.
|
|
||||||
""" # noqa: E501
|
|
||||||
|
|
||||||
|
from __future__ import absolute_import
|
||||||
|
|
||||||
import unittest
|
import unittest
|
||||||
import datetime
|
import datetime
|
||||||
|
|
||||||
|
import openapi_client
|
||||||
from openapi_client.models.test_query_style_deep_object_explode_true_object_all_of_query_object_parameter import TestQueryStyleDeepObjectExplodeTrueObjectAllOfQueryObjectParameter # noqa: E501
|
from openapi_client.models.test_query_style_deep_object_explode_true_object_all_of_query_object_parameter import TestQueryStyleDeepObjectExplodeTrueObjectAllOfQueryObjectParameter # noqa: E501
|
||||||
|
from openapi_client.rest import ApiException
|
||||||
|
|
||||||
class TestTestQueryStyleDeepObjectExplodeTrueObjectAllOfQueryObjectParameter(unittest.TestCase):
|
class TestTestQueryStyleDeepObjectExplodeTrueObjectAllOfQueryObjectParameter(unittest.TestCase):
|
||||||
"""TestQueryStyleDeepObjectExplodeTrueObjectAllOfQueryObjectParameter unit test stubs"""
|
"""TestQueryStyleDeepObjectExplodeTrueObjectAllOfQueryObjectParameter unit test stubs"""
|
||||||
@ -27,22 +29,22 @@ class TestTestQueryStyleDeepObjectExplodeTrueObjectAllOfQueryObjectParameter(uni
|
|||||||
def tearDown(self):
|
def tearDown(self):
|
||||||
pass
|
pass
|
||||||
|
|
||||||
def make_instance(self, include_optional) -> TestQueryStyleDeepObjectExplodeTrueObjectAllOfQueryObjectParameter:
|
def make_instance(self, include_optional):
|
||||||
"""Test TestQueryStyleDeepObjectExplodeTrueObjectAllOfQueryObjectParameter
|
"""Test TestQueryStyleDeepObjectExplodeTrueObjectAllOfQueryObjectParameter
|
||||||
include_option is a boolean, when False only required
|
include_option is a boolean, when False only required
|
||||||
params are included, when True both required and
|
params are included, when True both required and
|
||||||
optional params are included """
|
optional params are included """
|
||||||
# uncomment below to create an instance of `TestQueryStyleDeepObjectExplodeTrueObjectAllOfQueryObjectParameter`
|
# uncomment below to create an instance of `TestQueryStyleDeepObjectExplodeTrueObjectAllOfQueryObjectParameter`
|
||||||
"""
|
"""
|
||||||
model = TestQueryStyleDeepObjectExplodeTrueObjectAllOfQueryObjectParameter() # noqa: E501
|
model = openapi_client.models.test_query_style_deep_object_explode_true_object_all_of_query_object_parameter.TestQueryStyleDeepObjectExplodeTrueObjectAllOfQueryObjectParameter() # noqa: E501
|
||||||
if include_optional:
|
if include_optional :
|
||||||
return TestQueryStyleDeepObjectExplodeTrueObjectAllOfQueryObjectParameter(
|
return TestQueryStyleDeepObjectExplodeTrueObjectAllOfQueryObjectParameter(
|
||||||
size = '',
|
size = '',
|
||||||
color = '',
|
color = '',
|
||||||
id = 1,
|
id = 1,
|
||||||
name = 'Dogs'
|
name = 'Dogs'
|
||||||
)
|
)
|
||||||
else:
|
else :
|
||||||
return TestQueryStyleDeepObjectExplodeTrueObjectAllOfQueryObjectParameter(
|
return TestQueryStyleDeepObjectExplodeTrueObjectAllOfQueryObjectParameter(
|
||||||
)
|
)
|
||||||
"""
|
"""
|
||||||
|
@ -3,20 +3,22 @@
|
|||||||
"""
|
"""
|
||||||
Echo Server API
|
Echo Server API
|
||||||
|
|
||||||
Echo Server API
|
Echo Server API # noqa: E501
|
||||||
|
|
||||||
The version of the OpenAPI document: 0.1.0
|
The version of the OpenAPI document: 0.1.0
|
||||||
Contact: team@openapitools.org
|
Contact: team@openapitools.org
|
||||||
Generated by OpenAPI Generator (https://openapi-generator.tech)
|
Generated by: https://openapi-generator.tech
|
||||||
|
"""
|
||||||
|
|
||||||
Do not edit the class manually.
|
|
||||||
""" # noqa: E501
|
|
||||||
|
|
||||||
|
from __future__ import absolute_import
|
||||||
|
|
||||||
import unittest
|
import unittest
|
||||||
import datetime
|
import datetime
|
||||||
|
|
||||||
|
import openapi_client
|
||||||
from openapi_client.models.test_query_style_form_explode_true_array_string_query_object_parameter import TestQueryStyleFormExplodeTrueArrayStringQueryObjectParameter # noqa: E501
|
from openapi_client.models.test_query_style_form_explode_true_array_string_query_object_parameter import TestQueryStyleFormExplodeTrueArrayStringQueryObjectParameter # noqa: E501
|
||||||
|
from openapi_client.rest import ApiException
|
||||||
|
|
||||||
class TestTestQueryStyleFormExplodeTrueArrayStringQueryObjectParameter(unittest.TestCase):
|
class TestTestQueryStyleFormExplodeTrueArrayStringQueryObjectParameter(unittest.TestCase):
|
||||||
"""TestQueryStyleFormExplodeTrueArrayStringQueryObjectParameter unit test stubs"""
|
"""TestQueryStyleFormExplodeTrueArrayStringQueryObjectParameter unit test stubs"""
|
||||||
@ -27,21 +29,21 @@ class TestTestQueryStyleFormExplodeTrueArrayStringQueryObjectParameter(unittest.
|
|||||||
def tearDown(self):
|
def tearDown(self):
|
||||||
pass
|
pass
|
||||||
|
|
||||||
def make_instance(self, include_optional) -> TestQueryStyleFormExplodeTrueArrayStringQueryObjectParameter:
|
def make_instance(self, include_optional):
|
||||||
"""Test TestQueryStyleFormExplodeTrueArrayStringQueryObjectParameter
|
"""Test TestQueryStyleFormExplodeTrueArrayStringQueryObjectParameter
|
||||||
include_option is a boolean, when False only required
|
include_option is a boolean, when False only required
|
||||||
params are included, when True both required and
|
params are included, when True both required and
|
||||||
optional params are included """
|
optional params are included """
|
||||||
# uncomment below to create an instance of `TestQueryStyleFormExplodeTrueArrayStringQueryObjectParameter`
|
# uncomment below to create an instance of `TestQueryStyleFormExplodeTrueArrayStringQueryObjectParameter`
|
||||||
"""
|
"""
|
||||||
model = TestQueryStyleFormExplodeTrueArrayStringQueryObjectParameter() # noqa: E501
|
model = openapi_client.models.test_query_style_form_explode_true_array_string_query_object_parameter.TestQueryStyleFormExplodeTrueArrayStringQueryObjectParameter() # noqa: E501
|
||||||
if include_optional:
|
if include_optional :
|
||||||
return TestQueryStyleFormExplodeTrueArrayStringQueryObjectParameter(
|
return TestQueryStyleFormExplodeTrueArrayStringQueryObjectParameter(
|
||||||
values = [
|
values = [
|
||||||
''
|
''
|
||||||
]
|
]
|
||||||
)
|
)
|
||||||
else:
|
else :
|
||||||
return TestQueryStyleFormExplodeTrueArrayStringQueryObjectParameter(
|
return TestQueryStyleFormExplodeTrueArrayStringQueryObjectParameter(
|
||||||
)
|
)
|
||||||
"""
|
"""
|
||||||
|
BIN
samples/client/echo_api/python-pydantic-v1/testfiles/test.gif
Normal file
BIN
samples/client/echo_api/python-pydantic-v1/testfiles/test.gif
Normal file
Binary file not shown.
After Width: | Height: | Size: 43 B |
@ -5,7 +5,7 @@ This Python package is automatically generated by the [OpenAPI Generator](https:
|
|||||||
|
|
||||||
- API version: 1.0.0
|
- API version: 1.0.0
|
||||||
- Package version: 1.0.0
|
- Package version: 1.0.0
|
||||||
- Build package: org.openapitools.codegen.languages.PythonClientPydanticV1Codegen
|
- Build package: org.openapitools.codegen.languages.PythonPydanticV1ClientCodegen
|
||||||
|
|
||||||
## Requirements.
|
## Requirements.
|
||||||
|
|
||||||
|
@ -0,0 +1,2 @@
|
|||||||
|
tox
|
||||||
|
flake8
|
46
samples/openapi3/client/petstore/python-pydantic-v1-aiohttp/pom.xml
Executable file
46
samples/openapi3/client/petstore/python-pydantic-v1-aiohttp/pom.xml
Executable file
@ -0,0 +1,46 @@
|
|||||||
|
<project>
|
||||||
|
<modelVersion>4.0.0</modelVersion>
|
||||||
|
<groupId>org.openapitools</groupId>
|
||||||
|
<artifactId>PythonPydanaticV1ioHttpPetstoreTests</artifactId>
|
||||||
|
<packaging>pom</packaging>
|
||||||
|
<version>1.0-SNAPSHOT</version>
|
||||||
|
<name>Python OpenAPI3 Petstore Client</name>
|
||||||
|
<build>
|
||||||
|
<plugins>
|
||||||
|
<plugin>
|
||||||
|
<artifactId>maven-dependency-plugin</artifactId>
|
||||||
|
<executions>
|
||||||
|
<execution>
|
||||||
|
<phase>package</phase>
|
||||||
|
<goals>
|
||||||
|
<goal>copy-dependencies</goal>
|
||||||
|
</goals>
|
||||||
|
<configuration>
|
||||||
|
<outputDirectory>${project.build.directory}</outputDirectory>
|
||||||
|
</configuration>
|
||||||
|
</execution>
|
||||||
|
</executions>
|
||||||
|
</plugin>
|
||||||
|
<plugin>
|
||||||
|
<groupId>org.codehaus.mojo</groupId>
|
||||||
|
<artifactId>exec-maven-plugin</artifactId>
|
||||||
|
<version>1.2.1</version>
|
||||||
|
<executions>
|
||||||
|
<execution>
|
||||||
|
<id>test</id>
|
||||||
|
<phase>integration-test</phase>
|
||||||
|
<goals>
|
||||||
|
<goal>exec</goal>
|
||||||
|
</goals>
|
||||||
|
<configuration>
|
||||||
|
<executable>bash</executable>
|
||||||
|
<arguments>
|
||||||
|
<argument>test_python3.sh</argument>
|
||||||
|
</arguments>
|
||||||
|
</configuration>
|
||||||
|
</execution>
|
||||||
|
</executions>
|
||||||
|
</plugin>
|
||||||
|
</plugins>
|
||||||
|
</build>
|
||||||
|
</project>
|
@ -3,19 +3,21 @@
|
|||||||
"""
|
"""
|
||||||
OpenAPI Petstore
|
OpenAPI Petstore
|
||||||
|
|
||||||
This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\
|
This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501
|
||||||
|
|
||||||
The version of the OpenAPI document: 1.0.0
|
The version of the OpenAPI document: 1.0.0
|
||||||
Generated by OpenAPI Generator (https://openapi-generator.tech)
|
Generated by OpenAPI Generator (https://openapi-generator.tech)
|
||||||
|
|
||||||
Do not edit the class manually.
|
Do not edit the class manually.
|
||||||
""" # noqa: E501
|
"""
|
||||||
|
|
||||||
|
|
||||||
import unittest
|
import unittest
|
||||||
import datetime
|
import datetime
|
||||||
|
|
||||||
|
import petstore_api
|
||||||
from petstore_api.models.additional_properties_any_type import AdditionalPropertiesAnyType # noqa: E501
|
from petstore_api.models.additional_properties_any_type import AdditionalPropertiesAnyType # noqa: E501
|
||||||
|
from petstore_api.rest import ApiException
|
||||||
|
|
||||||
class TestAdditionalPropertiesAnyType(unittest.TestCase):
|
class TestAdditionalPropertiesAnyType(unittest.TestCase):
|
||||||
"""AdditionalPropertiesAnyType unit test stubs"""
|
"""AdditionalPropertiesAnyType unit test stubs"""
|
||||||
@ -26,19 +28,19 @@ class TestAdditionalPropertiesAnyType(unittest.TestCase):
|
|||||||
def tearDown(self):
|
def tearDown(self):
|
||||||
pass
|
pass
|
||||||
|
|
||||||
def make_instance(self, include_optional) -> AdditionalPropertiesAnyType:
|
def make_instance(self, include_optional):
|
||||||
"""Test AdditionalPropertiesAnyType
|
"""Test AdditionalPropertiesAnyType
|
||||||
include_option is a boolean, when False only required
|
include_option is a boolean, when False only required
|
||||||
params are included, when True both required and
|
params are included, when True both required and
|
||||||
optional params are included """
|
optional params are included """
|
||||||
# uncomment below to create an instance of `AdditionalPropertiesAnyType`
|
# uncomment below to create an instance of `AdditionalPropertiesAnyType`
|
||||||
"""
|
"""
|
||||||
model = AdditionalPropertiesAnyType() # noqa: E501
|
model = petstore_api.models.additional_properties_any_type.AdditionalPropertiesAnyType() # noqa: E501
|
||||||
if include_optional:
|
if include_optional :
|
||||||
return AdditionalPropertiesAnyType(
|
return AdditionalPropertiesAnyType(
|
||||||
name = ''
|
name = ''
|
||||||
)
|
)
|
||||||
else:
|
else :
|
||||||
return AdditionalPropertiesAnyType(
|
return AdditionalPropertiesAnyType(
|
||||||
)
|
)
|
||||||
"""
|
"""
|
||||||
|
@ -3,19 +3,21 @@
|
|||||||
"""
|
"""
|
||||||
OpenAPI Petstore
|
OpenAPI Petstore
|
||||||
|
|
||||||
This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\
|
This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501
|
||||||
|
|
||||||
The version of the OpenAPI document: 1.0.0
|
The version of the OpenAPI document: 1.0.0
|
||||||
Generated by OpenAPI Generator (https://openapi-generator.tech)
|
Generated by OpenAPI Generator (https://openapi-generator.tech)
|
||||||
|
|
||||||
Do not edit the class manually.
|
Do not edit the class manually.
|
||||||
""" # noqa: E501
|
"""
|
||||||
|
|
||||||
|
|
||||||
import unittest
|
import unittest
|
||||||
import datetime
|
import datetime
|
||||||
|
|
||||||
|
import petstore_api
|
||||||
from petstore_api.models.additional_properties_class import AdditionalPropertiesClass # noqa: E501
|
from petstore_api.models.additional_properties_class import AdditionalPropertiesClass # noqa: E501
|
||||||
|
from petstore_api.rest import ApiException
|
||||||
|
|
||||||
class TestAdditionalPropertiesClass(unittest.TestCase):
|
class TestAdditionalPropertiesClass(unittest.TestCase):
|
||||||
"""AdditionalPropertiesClass unit test stubs"""
|
"""AdditionalPropertiesClass unit test stubs"""
|
||||||
@ -26,15 +28,15 @@ class TestAdditionalPropertiesClass(unittest.TestCase):
|
|||||||
def tearDown(self):
|
def tearDown(self):
|
||||||
pass
|
pass
|
||||||
|
|
||||||
def make_instance(self, include_optional) -> AdditionalPropertiesClass:
|
def make_instance(self, include_optional):
|
||||||
"""Test AdditionalPropertiesClass
|
"""Test AdditionalPropertiesClass
|
||||||
include_option is a boolean, when False only required
|
include_option is a boolean, when False only required
|
||||||
params are included, when True both required and
|
params are included, when True both required and
|
||||||
optional params are included """
|
optional params are included """
|
||||||
# uncomment below to create an instance of `AdditionalPropertiesClass`
|
# uncomment below to create an instance of `AdditionalPropertiesClass`
|
||||||
"""
|
"""
|
||||||
model = AdditionalPropertiesClass() # noqa: E501
|
model = petstore_api.models.additional_properties_class.AdditionalPropertiesClass() # noqa: E501
|
||||||
if include_optional:
|
if include_optional :
|
||||||
return AdditionalPropertiesClass(
|
return AdditionalPropertiesClass(
|
||||||
map_property = {
|
map_property = {
|
||||||
'key' : ''
|
'key' : ''
|
||||||
@ -45,7 +47,7 @@ class TestAdditionalPropertiesClass(unittest.TestCase):
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
)
|
)
|
||||||
else:
|
else :
|
||||||
return AdditionalPropertiesClass(
|
return AdditionalPropertiesClass(
|
||||||
)
|
)
|
||||||
"""
|
"""
|
||||||
|
@ -3,19 +3,21 @@
|
|||||||
"""
|
"""
|
||||||
OpenAPI Petstore
|
OpenAPI Petstore
|
||||||
|
|
||||||
This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\
|
This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501
|
||||||
|
|
||||||
The version of the OpenAPI document: 1.0.0
|
The version of the OpenAPI document: 1.0.0
|
||||||
Generated by OpenAPI Generator (https://openapi-generator.tech)
|
Generated by OpenAPI Generator (https://openapi-generator.tech)
|
||||||
|
|
||||||
Do not edit the class manually.
|
Do not edit the class manually.
|
||||||
""" # noqa: E501
|
"""
|
||||||
|
|
||||||
|
|
||||||
import unittest
|
import unittest
|
||||||
import datetime
|
import datetime
|
||||||
|
|
||||||
|
import petstore_api
|
||||||
from petstore_api.models.additional_properties_object import AdditionalPropertiesObject # noqa: E501
|
from petstore_api.models.additional_properties_object import AdditionalPropertiesObject # noqa: E501
|
||||||
|
from petstore_api.rest import ApiException
|
||||||
|
|
||||||
class TestAdditionalPropertiesObject(unittest.TestCase):
|
class TestAdditionalPropertiesObject(unittest.TestCase):
|
||||||
"""AdditionalPropertiesObject unit test stubs"""
|
"""AdditionalPropertiesObject unit test stubs"""
|
||||||
@ -26,19 +28,19 @@ class TestAdditionalPropertiesObject(unittest.TestCase):
|
|||||||
def tearDown(self):
|
def tearDown(self):
|
||||||
pass
|
pass
|
||||||
|
|
||||||
def make_instance(self, include_optional) -> AdditionalPropertiesObject:
|
def make_instance(self, include_optional):
|
||||||
"""Test AdditionalPropertiesObject
|
"""Test AdditionalPropertiesObject
|
||||||
include_option is a boolean, when False only required
|
include_option is a boolean, when False only required
|
||||||
params are included, when True both required and
|
params are included, when True both required and
|
||||||
optional params are included """
|
optional params are included """
|
||||||
# uncomment below to create an instance of `AdditionalPropertiesObject`
|
# uncomment below to create an instance of `AdditionalPropertiesObject`
|
||||||
"""
|
"""
|
||||||
model = AdditionalPropertiesObject() # noqa: E501
|
model = petstore_api.models.additional_properties_object.AdditionalPropertiesObject() # noqa: E501
|
||||||
if include_optional:
|
if include_optional :
|
||||||
return AdditionalPropertiesObject(
|
return AdditionalPropertiesObject(
|
||||||
name = ''
|
name = ''
|
||||||
)
|
)
|
||||||
else:
|
else :
|
||||||
return AdditionalPropertiesObject(
|
return AdditionalPropertiesObject(
|
||||||
)
|
)
|
||||||
"""
|
"""
|
||||||
|
@ -3,19 +3,21 @@
|
|||||||
"""
|
"""
|
||||||
OpenAPI Petstore
|
OpenAPI Petstore
|
||||||
|
|
||||||
This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\
|
This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501
|
||||||
|
|
||||||
The version of the OpenAPI document: 1.0.0
|
The version of the OpenAPI document: 1.0.0
|
||||||
Generated by OpenAPI Generator (https://openapi-generator.tech)
|
Generated by OpenAPI Generator (https://openapi-generator.tech)
|
||||||
|
|
||||||
Do not edit the class manually.
|
Do not edit the class manually.
|
||||||
""" # noqa: E501
|
"""
|
||||||
|
|
||||||
|
|
||||||
import unittest
|
import unittest
|
||||||
import datetime
|
import datetime
|
||||||
|
|
||||||
|
import petstore_api
|
||||||
from petstore_api.models.additional_properties_with_description_only import AdditionalPropertiesWithDescriptionOnly # noqa: E501
|
from petstore_api.models.additional_properties_with_description_only import AdditionalPropertiesWithDescriptionOnly # noqa: E501
|
||||||
|
from petstore_api.rest import ApiException
|
||||||
|
|
||||||
class TestAdditionalPropertiesWithDescriptionOnly(unittest.TestCase):
|
class TestAdditionalPropertiesWithDescriptionOnly(unittest.TestCase):
|
||||||
"""AdditionalPropertiesWithDescriptionOnly unit test stubs"""
|
"""AdditionalPropertiesWithDescriptionOnly unit test stubs"""
|
||||||
@ -26,19 +28,19 @@ class TestAdditionalPropertiesWithDescriptionOnly(unittest.TestCase):
|
|||||||
def tearDown(self):
|
def tearDown(self):
|
||||||
pass
|
pass
|
||||||
|
|
||||||
def make_instance(self, include_optional) -> AdditionalPropertiesWithDescriptionOnly:
|
def make_instance(self, include_optional):
|
||||||
"""Test AdditionalPropertiesWithDescriptionOnly
|
"""Test AdditionalPropertiesWithDescriptionOnly
|
||||||
include_option is a boolean, when False only required
|
include_option is a boolean, when False only required
|
||||||
params are included, when True both required and
|
params are included, when True both required and
|
||||||
optional params are included """
|
optional params are included """
|
||||||
# uncomment below to create an instance of `AdditionalPropertiesWithDescriptionOnly`
|
# uncomment below to create an instance of `AdditionalPropertiesWithDescriptionOnly`
|
||||||
"""
|
"""
|
||||||
model = AdditionalPropertiesWithDescriptionOnly() # noqa: E501
|
model = petstore_api.models.additional_properties_with_description_only.AdditionalPropertiesWithDescriptionOnly() # noqa: E501
|
||||||
if include_optional:
|
if include_optional :
|
||||||
return AdditionalPropertiesWithDescriptionOnly(
|
return AdditionalPropertiesWithDescriptionOnly(
|
||||||
name = ''
|
name = ''
|
||||||
)
|
)
|
||||||
else:
|
else :
|
||||||
return AdditionalPropertiesWithDescriptionOnly(
|
return AdditionalPropertiesWithDescriptionOnly(
|
||||||
)
|
)
|
||||||
"""
|
"""
|
||||||
|
@ -3,19 +3,21 @@
|
|||||||
"""
|
"""
|
||||||
OpenAPI Petstore
|
OpenAPI Petstore
|
||||||
|
|
||||||
This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\
|
This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501
|
||||||
|
|
||||||
The version of the OpenAPI document: 1.0.0
|
The version of the OpenAPI document: 1.0.0
|
||||||
Generated by OpenAPI Generator (https://openapi-generator.tech)
|
Generated by: https://openapi-generator.tech
|
||||||
|
"""
|
||||||
|
|
||||||
Do not edit the class manually.
|
|
||||||
""" # noqa: E501
|
|
||||||
|
|
||||||
|
from __future__ import absolute_import
|
||||||
|
|
||||||
import unittest
|
import unittest
|
||||||
import datetime
|
import datetime
|
||||||
|
|
||||||
|
import petstore_api
|
||||||
from petstore_api.models.all_of_with_single_ref import AllOfWithSingleRef # noqa: E501
|
from petstore_api.models.all_of_with_single_ref import AllOfWithSingleRef # noqa: E501
|
||||||
|
from petstore_api.rest import ApiException
|
||||||
|
|
||||||
class TestAllOfWithSingleRef(unittest.TestCase):
|
class TestAllOfWithSingleRef(unittest.TestCase):
|
||||||
"""AllOfWithSingleRef unit test stubs"""
|
"""AllOfWithSingleRef unit test stubs"""
|
||||||
@ -26,23 +28,20 @@ class TestAllOfWithSingleRef(unittest.TestCase):
|
|||||||
def tearDown(self):
|
def tearDown(self):
|
||||||
pass
|
pass
|
||||||
|
|
||||||
def make_instance(self, include_optional) -> AllOfWithSingleRef:
|
def make_instance(self, include_optional):
|
||||||
"""Test AllOfWithSingleRef
|
"""Test AllOfWithSingleRef
|
||||||
include_option is a boolean, when False only required
|
include_option is a boolean, when False only required
|
||||||
params are included, when True both required and
|
params are included, when True both required and
|
||||||
optional params are included """
|
optional params are included """
|
||||||
# uncomment below to create an instance of `AllOfWithSingleRef`
|
# model = petstore_api.models.all_of_with_single_ref.AllOfWithSingleRef() # noqa: E501
|
||||||
"""
|
if include_optional :
|
||||||
model = AllOfWithSingleRef() # noqa: E501
|
|
||||||
if include_optional:
|
|
||||||
return AllOfWithSingleRef(
|
return AllOfWithSingleRef(
|
||||||
username = '',
|
username = '',
|
||||||
single_ref_type = 'admin'
|
single_ref_type = None
|
||||||
)
|
)
|
||||||
else:
|
else :
|
||||||
return AllOfWithSingleRef(
|
return AllOfWithSingleRef(
|
||||||
)
|
)
|
||||||
"""
|
|
||||||
|
|
||||||
def testAllOfWithSingleRef(self):
|
def testAllOfWithSingleRef(self):
|
||||||
"""Test AllOfWithSingleRef"""
|
"""Test AllOfWithSingleRef"""
|
||||||
|
@ -3,19 +3,21 @@
|
|||||||
"""
|
"""
|
||||||
OpenAPI Petstore
|
OpenAPI Petstore
|
||||||
|
|
||||||
This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\
|
This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501
|
||||||
|
|
||||||
The version of the OpenAPI document: 1.0.0
|
The version of the OpenAPI document: 1.0.0
|
||||||
Generated by OpenAPI Generator (https://openapi-generator.tech)
|
Generated by: https://openapi-generator.tech
|
||||||
|
"""
|
||||||
|
|
||||||
Do not edit the class manually.
|
|
||||||
""" # noqa: E501
|
|
||||||
|
|
||||||
|
from __future__ import absolute_import
|
||||||
|
|
||||||
import unittest
|
import unittest
|
||||||
import datetime
|
import datetime
|
||||||
|
|
||||||
|
import petstore_api
|
||||||
from petstore_api.models.animal import Animal # noqa: E501
|
from petstore_api.models.animal import Animal # noqa: E501
|
||||||
|
from petstore_api.rest import ApiException
|
||||||
|
|
||||||
class TestAnimal(unittest.TestCase):
|
class TestAnimal(unittest.TestCase):
|
||||||
"""Animal unit test stubs"""
|
"""Animal unit test stubs"""
|
||||||
@ -26,24 +28,21 @@ class TestAnimal(unittest.TestCase):
|
|||||||
def tearDown(self):
|
def tearDown(self):
|
||||||
pass
|
pass
|
||||||
|
|
||||||
def make_instance(self, include_optional) -> Animal:
|
def make_instance(self, include_optional):
|
||||||
"""Test Animal
|
"""Test Animal
|
||||||
include_option is a boolean, when False only required
|
include_option is a boolean, when False only required
|
||||||
params are included, when True both required and
|
params are included, when True both required and
|
||||||
optional params are included """
|
optional params are included """
|
||||||
# uncomment below to create an instance of `Animal`
|
# model = petstore_api.models.animal.Animal() # noqa: E501
|
||||||
"""
|
if include_optional :
|
||||||
model = Animal() # noqa: E501
|
|
||||||
if include_optional:
|
|
||||||
return Animal(
|
return Animal(
|
||||||
class_name = '',
|
class_name = '',
|
||||||
color = 'red'
|
color = 'red'
|
||||||
)
|
)
|
||||||
else:
|
else :
|
||||||
return Animal(
|
return Animal(
|
||||||
class_name = '',
|
class_name = '',
|
||||||
)
|
)
|
||||||
"""
|
|
||||||
|
|
||||||
def testAnimal(self):
|
def testAnimal(self):
|
||||||
"""Test Animal"""
|
"""Test Animal"""
|
||||||
|
@ -3,30 +3,32 @@
|
|||||||
"""
|
"""
|
||||||
OpenAPI Petstore
|
OpenAPI Petstore
|
||||||
|
|
||||||
This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\
|
This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501
|
||||||
|
|
||||||
The version of the OpenAPI document: 1.0.0
|
The version of the OpenAPI document: 1.0.0
|
||||||
Generated by OpenAPI Generator (https://openapi-generator.tech)
|
Generated by: https://openapi-generator.tech
|
||||||
|
"""
|
||||||
|
|
||||||
Do not edit the class manually.
|
|
||||||
""" # noqa: E501
|
|
||||||
|
|
||||||
|
from __future__ import absolute_import
|
||||||
|
|
||||||
import unittest
|
import unittest
|
||||||
|
|
||||||
|
import petstore_api
|
||||||
from petstore_api.api.another_fake_api import AnotherFakeApi # noqa: E501
|
from petstore_api.api.another_fake_api import AnotherFakeApi # noqa: E501
|
||||||
|
from petstore_api.rest import ApiException
|
||||||
|
|
||||||
|
|
||||||
class TestAnotherFakeApi(unittest.TestCase):
|
class TestAnotherFakeApi(unittest.TestCase):
|
||||||
"""AnotherFakeApi unit test stubs"""
|
"""AnotherFakeApi unit test stubs"""
|
||||||
|
|
||||||
def setUp(self) -> None:
|
def setUp(self):
|
||||||
self.api = AnotherFakeApi() # noqa: E501
|
self.api = petstore_api.api.another_fake_api.AnotherFakeApi() # noqa: E501
|
||||||
|
|
||||||
def tearDown(self) -> None:
|
def tearDown(self):
|
||||||
pass
|
pass
|
||||||
|
|
||||||
def test_call_123_test_special_tags(self) -> None:
|
def test_call_123_test_special_tags(self):
|
||||||
"""Test case for call_123_test_special_tags
|
"""Test case for call_123_test_special_tags
|
||||||
|
|
||||||
To test special tags # noqa: E501
|
To test special tags # noqa: E501
|
||||||
|
@ -3,19 +3,21 @@
|
|||||||
"""
|
"""
|
||||||
OpenAPI Petstore
|
OpenAPI Petstore
|
||||||
|
|
||||||
This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\
|
This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501
|
||||||
|
|
||||||
The version of the OpenAPI document: 1.0.0
|
The version of the OpenAPI document: 1.0.0
|
||||||
Generated by OpenAPI Generator (https://openapi-generator.tech)
|
Generated by: https://openapi-generator.tech
|
||||||
|
"""
|
||||||
|
|
||||||
Do not edit the class manually.
|
|
||||||
""" # noqa: E501
|
|
||||||
|
|
||||||
|
from __future__ import absolute_import
|
||||||
|
|
||||||
import unittest
|
import unittest
|
||||||
import datetime
|
import datetime
|
||||||
|
|
||||||
|
import petstore_api
|
||||||
from petstore_api.models.any_of_color import AnyOfColor # noqa: E501
|
from petstore_api.models.any_of_color import AnyOfColor # noqa: E501
|
||||||
|
from petstore_api.rest import ApiException
|
||||||
|
|
||||||
class TestAnyOfColor(unittest.TestCase):
|
class TestAnyOfColor(unittest.TestCase):
|
||||||
"""AnyOfColor unit test stubs"""
|
"""AnyOfColor unit test stubs"""
|
||||||
@ -26,18 +28,18 @@ class TestAnyOfColor(unittest.TestCase):
|
|||||||
def tearDown(self):
|
def tearDown(self):
|
||||||
pass
|
pass
|
||||||
|
|
||||||
def make_instance(self, include_optional) -> AnyOfColor:
|
def make_instance(self, include_optional):
|
||||||
"""Test AnyOfColor
|
"""Test AnyOfColor
|
||||||
include_option is a boolean, when False only required
|
include_option is a boolean, when False only required
|
||||||
params are included, when True both required and
|
params are included, when True both required and
|
||||||
optional params are included """
|
optional params are included """
|
||||||
# uncomment below to create an instance of `AnyOfColor`
|
# uncomment below to create an instance of `AnyOfColor`
|
||||||
"""
|
"""
|
||||||
model = AnyOfColor() # noqa: E501
|
model = petstore_api.models.any_of_color.AnyOfColor() # noqa: E501
|
||||||
if include_optional:
|
if include_optional :
|
||||||
return AnyOfColor(
|
return AnyOfColor(
|
||||||
)
|
)
|
||||||
else:
|
else :
|
||||||
return AnyOfColor(
|
return AnyOfColor(
|
||||||
)
|
)
|
||||||
"""
|
"""
|
||||||
|
@ -3,19 +3,21 @@
|
|||||||
"""
|
"""
|
||||||
OpenAPI Petstore
|
OpenAPI Petstore
|
||||||
|
|
||||||
This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\
|
This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501
|
||||||
|
|
||||||
The version of the OpenAPI document: 1.0.0
|
The version of the OpenAPI document: 1.0.0
|
||||||
Generated by OpenAPI Generator (https://openapi-generator.tech)
|
Generated by: https://openapi-generator.tech
|
||||||
|
"""
|
||||||
|
|
||||||
Do not edit the class manually.
|
|
||||||
""" # noqa: E501
|
|
||||||
|
|
||||||
|
from __future__ import absolute_import
|
||||||
|
|
||||||
import unittest
|
import unittest
|
||||||
import datetime
|
import datetime
|
||||||
|
|
||||||
|
import petstore_api
|
||||||
from petstore_api.models.any_of_pig import AnyOfPig # noqa: E501
|
from petstore_api.models.any_of_pig import AnyOfPig # noqa: E501
|
||||||
|
from petstore_api.rest import ApiException
|
||||||
|
|
||||||
class TestAnyOfPig(unittest.TestCase):
|
class TestAnyOfPig(unittest.TestCase):
|
||||||
"""AnyOfPig unit test stubs"""
|
"""AnyOfPig unit test stubs"""
|
||||||
@ -26,27 +28,24 @@ class TestAnyOfPig(unittest.TestCase):
|
|||||||
def tearDown(self):
|
def tearDown(self):
|
||||||
pass
|
pass
|
||||||
|
|
||||||
def make_instance(self, include_optional) -> AnyOfPig:
|
def make_instance(self, include_optional):
|
||||||
"""Test AnyOfPig
|
"""Test AnyOfPig
|
||||||
include_option is a boolean, when False only required
|
include_option is a boolean, when False only required
|
||||||
params are included, when True both required and
|
params are included, when True both required and
|
||||||
optional params are included """
|
optional params are included """
|
||||||
# uncomment below to create an instance of `AnyOfPig`
|
# model = petstore_api.models.any_of_pig.AnyOfPig() # noqa: E501
|
||||||
"""
|
if include_optional :
|
||||||
model = AnyOfPig() # noqa: E501
|
|
||||||
if include_optional:
|
|
||||||
return AnyOfPig(
|
return AnyOfPig(
|
||||||
class_name = '',
|
class_name = '',
|
||||||
color = '',
|
color = '',
|
||||||
size = 56
|
size = 56
|
||||||
)
|
)
|
||||||
else:
|
else :
|
||||||
return AnyOfPig(
|
return AnyOfPig(
|
||||||
class_name = '',
|
class_name = '',
|
||||||
color = '',
|
color = '',
|
||||||
size = 56,
|
size = 56,
|
||||||
)
|
)
|
||||||
"""
|
|
||||||
|
|
||||||
def testAnyOfPig(self):
|
def testAnyOfPig(self):
|
||||||
"""Test AnyOfPig"""
|
"""Test AnyOfPig"""
|
||||||
|
@ -3,19 +3,21 @@
|
|||||||
"""
|
"""
|
||||||
OpenAPI Petstore
|
OpenAPI Petstore
|
||||||
|
|
||||||
This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\
|
This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501
|
||||||
|
|
||||||
The version of the OpenAPI document: 1.0.0
|
The version of the OpenAPI document: 1.0.0
|
||||||
Generated by OpenAPI Generator (https://openapi-generator.tech)
|
Generated by: https://openapi-generator.tech
|
||||||
|
"""
|
||||||
|
|
||||||
Do not edit the class manually.
|
|
||||||
""" # noqa: E501
|
|
||||||
|
|
||||||
|
from __future__ import absolute_import
|
||||||
|
|
||||||
import unittest
|
import unittest
|
||||||
import datetime
|
import datetime
|
||||||
|
|
||||||
|
import petstore_api
|
||||||
from petstore_api.models.api_response import ApiResponse # noqa: E501
|
from petstore_api.models.api_response import ApiResponse # noqa: E501
|
||||||
|
from petstore_api.rest import ApiException
|
||||||
|
|
||||||
class TestApiResponse(unittest.TestCase):
|
class TestApiResponse(unittest.TestCase):
|
||||||
"""ApiResponse unit test stubs"""
|
"""ApiResponse unit test stubs"""
|
||||||
@ -26,24 +28,21 @@ class TestApiResponse(unittest.TestCase):
|
|||||||
def tearDown(self):
|
def tearDown(self):
|
||||||
pass
|
pass
|
||||||
|
|
||||||
def make_instance(self, include_optional) -> ApiResponse:
|
def make_instance(self, include_optional):
|
||||||
"""Test ApiResponse
|
"""Test ApiResponse
|
||||||
include_option is a boolean, when False only required
|
include_option is a boolean, when False only required
|
||||||
params are included, when True both required and
|
params are included, when True both required and
|
||||||
optional params are included """
|
optional params are included """
|
||||||
# uncomment below to create an instance of `ApiResponse`
|
# model = petstore_api.models.api_response.ApiResponse() # noqa: E501
|
||||||
"""
|
if include_optional :
|
||||||
model = ApiResponse() # noqa: E501
|
|
||||||
if include_optional:
|
|
||||||
return ApiResponse(
|
return ApiResponse(
|
||||||
code = 56,
|
code = 56,
|
||||||
type = '',
|
type = '',
|
||||||
message = ''
|
message = ''
|
||||||
)
|
)
|
||||||
else:
|
else :
|
||||||
return ApiResponse(
|
return ApiResponse(
|
||||||
)
|
)
|
||||||
"""
|
|
||||||
|
|
||||||
def testApiResponse(self):
|
def testApiResponse(self):
|
||||||
"""Test ApiResponse"""
|
"""Test ApiResponse"""
|
||||||
|
@ -3,19 +3,21 @@
|
|||||||
"""
|
"""
|
||||||
OpenAPI Petstore
|
OpenAPI Petstore
|
||||||
|
|
||||||
This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\
|
This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501
|
||||||
|
|
||||||
The version of the OpenAPI document: 1.0.0
|
The version of the OpenAPI document: 1.0.0
|
||||||
Generated by OpenAPI Generator (https://openapi-generator.tech)
|
Generated by OpenAPI Generator (https://openapi-generator.tech)
|
||||||
|
|
||||||
Do not edit the class manually.
|
Do not edit the class manually.
|
||||||
""" # noqa: E501
|
"""
|
||||||
|
|
||||||
|
|
||||||
import unittest
|
import unittest
|
||||||
import datetime
|
import datetime
|
||||||
|
|
||||||
|
import petstore_api
|
||||||
from petstore_api.models.array_of_array_of_model import ArrayOfArrayOfModel # noqa: E501
|
from petstore_api.models.array_of_array_of_model import ArrayOfArrayOfModel # noqa: E501
|
||||||
|
from petstore_api.rest import ApiException
|
||||||
|
|
||||||
class TestArrayOfArrayOfModel(unittest.TestCase):
|
class TestArrayOfArrayOfModel(unittest.TestCase):
|
||||||
"""ArrayOfArrayOfModel unit test stubs"""
|
"""ArrayOfArrayOfModel unit test stubs"""
|
||||||
@ -26,15 +28,15 @@ class TestArrayOfArrayOfModel(unittest.TestCase):
|
|||||||
def tearDown(self):
|
def tearDown(self):
|
||||||
pass
|
pass
|
||||||
|
|
||||||
def make_instance(self, include_optional) -> ArrayOfArrayOfModel:
|
def make_instance(self, include_optional):
|
||||||
"""Test ArrayOfArrayOfModel
|
"""Test ArrayOfArrayOfModel
|
||||||
include_option is a boolean, when False only required
|
include_option is a boolean, when False only required
|
||||||
params are included, when True both required and
|
params are included, when True both required and
|
||||||
optional params are included """
|
optional params are included """
|
||||||
# uncomment below to create an instance of `ArrayOfArrayOfModel`
|
# uncomment below to create an instance of `ArrayOfArrayOfModel`
|
||||||
"""
|
"""
|
||||||
model = ArrayOfArrayOfModel() # noqa: E501
|
model = petstore_api.models.array_of_array_of_model.ArrayOfArrayOfModel() # noqa: E501
|
||||||
if include_optional:
|
if include_optional :
|
||||||
return ArrayOfArrayOfModel(
|
return ArrayOfArrayOfModel(
|
||||||
another_property = [
|
another_property = [
|
||||||
[
|
[
|
||||||
@ -44,7 +46,7 @@ class TestArrayOfArrayOfModel(unittest.TestCase):
|
|||||||
]
|
]
|
||||||
]
|
]
|
||||||
)
|
)
|
||||||
else:
|
else :
|
||||||
return ArrayOfArrayOfModel(
|
return ArrayOfArrayOfModel(
|
||||||
)
|
)
|
||||||
"""
|
"""
|
||||||
|
@ -3,19 +3,21 @@
|
|||||||
"""
|
"""
|
||||||
OpenAPI Petstore
|
OpenAPI Petstore
|
||||||
|
|
||||||
This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\
|
This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501
|
||||||
|
|
||||||
The version of the OpenAPI document: 1.0.0
|
The version of the OpenAPI document: 1.0.0
|
||||||
Generated by OpenAPI Generator (https://openapi-generator.tech)
|
Generated by: https://openapi-generator.tech
|
||||||
|
"""
|
||||||
|
|
||||||
Do not edit the class manually.
|
|
||||||
""" # noqa: E501
|
|
||||||
|
|
||||||
|
from __future__ import absolute_import
|
||||||
|
|
||||||
import unittest
|
import unittest
|
||||||
import datetime
|
import datetime
|
||||||
|
|
||||||
|
import petstore_api
|
||||||
from petstore_api.models.array_of_array_of_number_only import ArrayOfArrayOfNumberOnly # noqa: E501
|
from petstore_api.models.array_of_array_of_number_only import ArrayOfArrayOfNumberOnly # noqa: E501
|
||||||
|
from petstore_api.rest import ApiException
|
||||||
|
|
||||||
class TestArrayOfArrayOfNumberOnly(unittest.TestCase):
|
class TestArrayOfArrayOfNumberOnly(unittest.TestCase):
|
||||||
"""ArrayOfArrayOfNumberOnly unit test stubs"""
|
"""ArrayOfArrayOfNumberOnly unit test stubs"""
|
||||||
@ -26,15 +28,13 @@ class TestArrayOfArrayOfNumberOnly(unittest.TestCase):
|
|||||||
def tearDown(self):
|
def tearDown(self):
|
||||||
pass
|
pass
|
||||||
|
|
||||||
def make_instance(self, include_optional) -> ArrayOfArrayOfNumberOnly:
|
def make_instance(self, include_optional):
|
||||||
"""Test ArrayOfArrayOfNumberOnly
|
"""Test ArrayOfArrayOfNumberOnly
|
||||||
include_option is a boolean, when False only required
|
include_option is a boolean, when False only required
|
||||||
params are included, when True both required and
|
params are included, when True both required and
|
||||||
optional params are included """
|
optional params are included """
|
||||||
# uncomment below to create an instance of `ArrayOfArrayOfNumberOnly`
|
# model = petstore_api.models.array_of_array_of_number_only.ArrayOfArrayOfNumberOnly() # noqa: E501
|
||||||
"""
|
if include_optional :
|
||||||
model = ArrayOfArrayOfNumberOnly() # noqa: E501
|
|
||||||
if include_optional:
|
|
||||||
return ArrayOfArrayOfNumberOnly(
|
return ArrayOfArrayOfNumberOnly(
|
||||||
array_array_number = [
|
array_array_number = [
|
||||||
[
|
[
|
||||||
@ -42,10 +42,9 @@ class TestArrayOfArrayOfNumberOnly(unittest.TestCase):
|
|||||||
]
|
]
|
||||||
]
|
]
|
||||||
)
|
)
|
||||||
else:
|
else :
|
||||||
return ArrayOfArrayOfNumberOnly(
|
return ArrayOfArrayOfNumberOnly(
|
||||||
)
|
)
|
||||||
"""
|
|
||||||
|
|
||||||
def testArrayOfArrayOfNumberOnly(self):
|
def testArrayOfArrayOfNumberOnly(self):
|
||||||
"""Test ArrayOfArrayOfNumberOnly"""
|
"""Test ArrayOfArrayOfNumberOnly"""
|
||||||
|
@ -3,19 +3,21 @@
|
|||||||
"""
|
"""
|
||||||
OpenAPI Petstore
|
OpenAPI Petstore
|
||||||
|
|
||||||
This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\
|
This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501
|
||||||
|
|
||||||
The version of the OpenAPI document: 1.0.0
|
The version of the OpenAPI document: 1.0.0
|
||||||
Generated by OpenAPI Generator (https://openapi-generator.tech)
|
Generated by: https://openapi-generator.tech
|
||||||
|
"""
|
||||||
|
|
||||||
Do not edit the class manually.
|
|
||||||
""" # noqa: E501
|
|
||||||
|
|
||||||
|
from __future__ import absolute_import
|
||||||
|
|
||||||
import unittest
|
import unittest
|
||||||
import datetime
|
import datetime
|
||||||
|
|
||||||
|
import petstore_api
|
||||||
from petstore_api.models.array_of_number_only import ArrayOfNumberOnly # noqa: E501
|
from petstore_api.models.array_of_number_only import ArrayOfNumberOnly # noqa: E501
|
||||||
|
from petstore_api.rest import ApiException
|
||||||
|
|
||||||
class TestArrayOfNumberOnly(unittest.TestCase):
|
class TestArrayOfNumberOnly(unittest.TestCase):
|
||||||
"""ArrayOfNumberOnly unit test stubs"""
|
"""ArrayOfNumberOnly unit test stubs"""
|
||||||
@ -26,24 +28,21 @@ class TestArrayOfNumberOnly(unittest.TestCase):
|
|||||||
def tearDown(self):
|
def tearDown(self):
|
||||||
pass
|
pass
|
||||||
|
|
||||||
def make_instance(self, include_optional) -> ArrayOfNumberOnly:
|
def make_instance(self, include_optional):
|
||||||
"""Test ArrayOfNumberOnly
|
"""Test ArrayOfNumberOnly
|
||||||
include_option is a boolean, when False only required
|
include_option is a boolean, when False only required
|
||||||
params are included, when True both required and
|
params are included, when True both required and
|
||||||
optional params are included """
|
optional params are included """
|
||||||
# uncomment below to create an instance of `ArrayOfNumberOnly`
|
# model = petstore_api.models.array_of_number_only.ArrayOfNumberOnly() # noqa: E501
|
||||||
"""
|
if include_optional :
|
||||||
model = ArrayOfNumberOnly() # noqa: E501
|
|
||||||
if include_optional:
|
|
||||||
return ArrayOfNumberOnly(
|
return ArrayOfNumberOnly(
|
||||||
array_number = [
|
array_number = [
|
||||||
1.337
|
1.337
|
||||||
]
|
]
|
||||||
)
|
)
|
||||||
else:
|
else :
|
||||||
return ArrayOfNumberOnly(
|
return ArrayOfNumberOnly(
|
||||||
)
|
)
|
||||||
"""
|
|
||||||
|
|
||||||
def testArrayOfNumberOnly(self):
|
def testArrayOfNumberOnly(self):
|
||||||
"""Test ArrayOfNumberOnly"""
|
"""Test ArrayOfNumberOnly"""
|
||||||
|
@ -3,19 +3,21 @@
|
|||||||
"""
|
"""
|
||||||
OpenAPI Petstore
|
OpenAPI Petstore
|
||||||
|
|
||||||
This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\
|
This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501
|
||||||
|
|
||||||
The version of the OpenAPI document: 1.0.0
|
The version of the OpenAPI document: 1.0.0
|
||||||
Generated by OpenAPI Generator (https://openapi-generator.tech)
|
Generated by: https://openapi-generator.tech
|
||||||
|
"""
|
||||||
|
|
||||||
Do not edit the class manually.
|
|
||||||
""" # noqa: E501
|
|
||||||
|
|
||||||
|
from __future__ import absolute_import
|
||||||
|
|
||||||
import unittest
|
import unittest
|
||||||
import datetime
|
import datetime
|
||||||
|
|
||||||
|
import petstore_api
|
||||||
from petstore_api.models.array_test import ArrayTest # noqa: E501
|
from petstore_api.models.array_test import ArrayTest # noqa: E501
|
||||||
|
from petstore_api.rest import ApiException
|
||||||
|
|
||||||
class TestArrayTest(unittest.TestCase):
|
class TestArrayTest(unittest.TestCase):
|
||||||
"""ArrayTest unit test stubs"""
|
"""ArrayTest unit test stubs"""
|
||||||
@ -26,15 +28,13 @@ class TestArrayTest(unittest.TestCase):
|
|||||||
def tearDown(self):
|
def tearDown(self):
|
||||||
pass
|
pass
|
||||||
|
|
||||||
def make_instance(self, include_optional) -> ArrayTest:
|
def make_instance(self, include_optional):
|
||||||
"""Test ArrayTest
|
"""Test ArrayTest
|
||||||
include_option is a boolean, when False only required
|
include_option is a boolean, when False only required
|
||||||
params are included, when True both required and
|
params are included, when True both required and
|
||||||
optional params are included """
|
optional params are included """
|
||||||
# uncomment below to create an instance of `ArrayTest`
|
# model = petstore_api.models.array_test.ArrayTest() # noqa: E501
|
||||||
"""
|
if include_optional :
|
||||||
model = ArrayTest() # noqa: E501
|
|
||||||
if include_optional:
|
|
||||||
return ArrayTest(
|
return ArrayTest(
|
||||||
array_of_string = [
|
array_of_string = [
|
||||||
''
|
''
|
||||||
@ -52,10 +52,9 @@ class TestArrayTest(unittest.TestCase):
|
|||||||
]
|
]
|
||||||
]
|
]
|
||||||
)
|
)
|
||||||
else:
|
else :
|
||||||
return ArrayTest(
|
return ArrayTest(
|
||||||
)
|
)
|
||||||
"""
|
|
||||||
|
|
||||||
def testArrayTest(self):
|
def testArrayTest(self):
|
||||||
"""Test ArrayTest"""
|
"""Test ArrayTest"""
|
||||||
|
@ -3,19 +3,21 @@
|
|||||||
"""
|
"""
|
||||||
OpenAPI Petstore
|
OpenAPI Petstore
|
||||||
|
|
||||||
This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\
|
This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501
|
||||||
|
|
||||||
The version of the OpenAPI document: 1.0.0
|
The version of the OpenAPI document: 1.0.0
|
||||||
Generated by OpenAPI Generator (https://openapi-generator.tech)
|
Generated by: https://openapi-generator.tech
|
||||||
|
"""
|
||||||
|
|
||||||
Do not edit the class manually.
|
|
||||||
""" # noqa: E501
|
|
||||||
|
|
||||||
|
from __future__ import absolute_import
|
||||||
|
|
||||||
import unittest
|
import unittest
|
||||||
import datetime
|
import datetime
|
||||||
|
|
||||||
|
import petstore_api
|
||||||
from petstore_api.models.basque_pig import BasquePig # noqa: E501
|
from petstore_api.models.basque_pig import BasquePig # noqa: E501
|
||||||
|
from petstore_api.rest import ApiException
|
||||||
|
|
||||||
class TestBasquePig(unittest.TestCase):
|
class TestBasquePig(unittest.TestCase):
|
||||||
"""BasquePig unit test stubs"""
|
"""BasquePig unit test stubs"""
|
||||||
@ -26,25 +28,22 @@ class TestBasquePig(unittest.TestCase):
|
|||||||
def tearDown(self):
|
def tearDown(self):
|
||||||
pass
|
pass
|
||||||
|
|
||||||
def make_instance(self, include_optional) -> BasquePig:
|
def make_instance(self, include_optional):
|
||||||
"""Test BasquePig
|
"""Test BasquePig
|
||||||
include_option is a boolean, when False only required
|
include_option is a boolean, when False only required
|
||||||
params are included, when True both required and
|
params are included, when True both required and
|
||||||
optional params are included """
|
optional params are included """
|
||||||
# uncomment below to create an instance of `BasquePig`
|
# model = petstore_api.models.basque_pig.BasquePig() # noqa: E501
|
||||||
"""
|
if include_optional :
|
||||||
model = BasquePig() # noqa: E501
|
|
||||||
if include_optional:
|
|
||||||
return BasquePig(
|
return BasquePig(
|
||||||
class_name = '',
|
class_name = '',
|
||||||
color = ''
|
color = ''
|
||||||
)
|
)
|
||||||
else:
|
else :
|
||||||
return BasquePig(
|
return BasquePig(
|
||||||
class_name = '',
|
class_name = '',
|
||||||
color = '',
|
color = '',
|
||||||
)
|
)
|
||||||
"""
|
|
||||||
|
|
||||||
def testBasquePig(self):
|
def testBasquePig(self):
|
||||||
"""Test BasquePig"""
|
"""Test BasquePig"""
|
||||||
|
@ -3,19 +3,21 @@
|
|||||||
"""
|
"""
|
||||||
OpenAPI Petstore
|
OpenAPI Petstore
|
||||||
|
|
||||||
This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\
|
This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501
|
||||||
|
|
||||||
The version of the OpenAPI document: 1.0.0
|
The version of the OpenAPI document: 1.0.0
|
||||||
Generated by OpenAPI Generator (https://openapi-generator.tech)
|
Generated by: https://openapi-generator.tech
|
||||||
|
"""
|
||||||
|
|
||||||
Do not edit the class manually.
|
|
||||||
""" # noqa: E501
|
|
||||||
|
|
||||||
|
from __future__ import absolute_import
|
||||||
|
|
||||||
import unittest
|
import unittest
|
||||||
import datetime
|
import datetime
|
||||||
|
|
||||||
|
import petstore_api
|
||||||
from petstore_api.models.capitalization import Capitalization # noqa: E501
|
from petstore_api.models.capitalization import Capitalization # noqa: E501
|
||||||
|
from petstore_api.rest import ApiException
|
||||||
|
|
||||||
class TestCapitalization(unittest.TestCase):
|
class TestCapitalization(unittest.TestCase):
|
||||||
"""Capitalization unit test stubs"""
|
"""Capitalization unit test stubs"""
|
||||||
@ -26,15 +28,13 @@ class TestCapitalization(unittest.TestCase):
|
|||||||
def tearDown(self):
|
def tearDown(self):
|
||||||
pass
|
pass
|
||||||
|
|
||||||
def make_instance(self, include_optional) -> Capitalization:
|
def make_instance(self, include_optional):
|
||||||
"""Test Capitalization
|
"""Test Capitalization
|
||||||
include_option is a boolean, when False only required
|
include_option is a boolean, when False only required
|
||||||
params are included, when True both required and
|
params are included, when True both required and
|
||||||
optional params are included """
|
optional params are included """
|
||||||
# uncomment below to create an instance of `Capitalization`
|
# model = petstore_api.models.capitalization.Capitalization() # noqa: E501
|
||||||
"""
|
if include_optional :
|
||||||
model = Capitalization() # noqa: E501
|
|
||||||
if include_optional:
|
|
||||||
return Capitalization(
|
return Capitalization(
|
||||||
small_camel = '',
|
small_camel = '',
|
||||||
capital_camel = '',
|
capital_camel = '',
|
||||||
@ -43,10 +43,9 @@ class TestCapitalization(unittest.TestCase):
|
|||||||
sca_eth_flow_points = '',
|
sca_eth_flow_points = '',
|
||||||
att_name = ''
|
att_name = ''
|
||||||
)
|
)
|
||||||
else:
|
else :
|
||||||
return Capitalization(
|
return Capitalization(
|
||||||
)
|
)
|
||||||
"""
|
|
||||||
|
|
||||||
def testCapitalization(self):
|
def testCapitalization(self):
|
||||||
"""Test Capitalization"""
|
"""Test Capitalization"""
|
||||||
|
@ -3,19 +3,21 @@
|
|||||||
"""
|
"""
|
||||||
OpenAPI Petstore
|
OpenAPI Petstore
|
||||||
|
|
||||||
This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\
|
This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501
|
||||||
|
|
||||||
The version of the OpenAPI document: 1.0.0
|
The version of the OpenAPI document: 1.0.0
|
||||||
Generated by OpenAPI Generator (https://openapi-generator.tech)
|
Generated by: https://openapi-generator.tech
|
||||||
|
"""
|
||||||
|
|
||||||
Do not edit the class manually.
|
|
||||||
""" # noqa: E501
|
|
||||||
|
|
||||||
|
from __future__ import absolute_import
|
||||||
|
|
||||||
import unittest
|
import unittest
|
||||||
import datetime
|
import datetime
|
||||||
|
|
||||||
|
import petstore_api
|
||||||
from petstore_api.models.cat import Cat # noqa: E501
|
from petstore_api.models.cat import Cat # noqa: E501
|
||||||
|
from petstore_api.rest import ApiException
|
||||||
|
|
||||||
class TestCat(unittest.TestCase):
|
class TestCat(unittest.TestCase):
|
||||||
"""Cat unit test stubs"""
|
"""Cat unit test stubs"""
|
||||||
@ -26,22 +28,19 @@ class TestCat(unittest.TestCase):
|
|||||||
def tearDown(self):
|
def tearDown(self):
|
||||||
pass
|
pass
|
||||||
|
|
||||||
def make_instance(self, include_optional) -> Cat:
|
def make_instance(self, include_optional):
|
||||||
"""Test Cat
|
"""Test Cat
|
||||||
include_option is a boolean, when False only required
|
include_option is a boolean, when False only required
|
||||||
params are included, when True both required and
|
params are included, when True both required and
|
||||||
optional params are included """
|
optional params are included """
|
||||||
# uncomment below to create an instance of `Cat`
|
# model = petstore_api.models.cat.Cat() # noqa: E501
|
||||||
"""
|
if include_optional :
|
||||||
model = Cat() # noqa: E501
|
|
||||||
if include_optional:
|
|
||||||
return Cat(
|
return Cat(
|
||||||
declawed = True
|
declawed = True
|
||||||
)
|
)
|
||||||
else:
|
else :
|
||||||
return Cat(
|
return Cat(
|
||||||
)
|
)
|
||||||
"""
|
|
||||||
|
|
||||||
def testCat(self):
|
def testCat(self):
|
||||||
"""Test Cat"""
|
"""Test Cat"""
|
||||||
|
@ -3,19 +3,21 @@
|
|||||||
"""
|
"""
|
||||||
OpenAPI Petstore
|
OpenAPI Petstore
|
||||||
|
|
||||||
This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\
|
This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501
|
||||||
|
|
||||||
The version of the OpenAPI document: 1.0.0
|
The version of the OpenAPI document: 1.0.0
|
||||||
Generated by OpenAPI Generator (https://openapi-generator.tech)
|
Generated by: https://openapi-generator.tech
|
||||||
|
"""
|
||||||
|
|
||||||
Do not edit the class manually.
|
|
||||||
""" # noqa: E501
|
|
||||||
|
|
||||||
|
from __future__ import absolute_import
|
||||||
|
|
||||||
import unittest
|
import unittest
|
||||||
import datetime
|
import datetime
|
||||||
|
|
||||||
|
import petstore_api
|
||||||
from petstore_api.models.category import Category # noqa: E501
|
from petstore_api.models.category import Category # noqa: E501
|
||||||
|
from petstore_api.rest import ApiException
|
||||||
|
|
||||||
class TestCategory(unittest.TestCase):
|
class TestCategory(unittest.TestCase):
|
||||||
"""Category unit test stubs"""
|
"""Category unit test stubs"""
|
||||||
@ -26,24 +28,21 @@ class TestCategory(unittest.TestCase):
|
|||||||
def tearDown(self):
|
def tearDown(self):
|
||||||
pass
|
pass
|
||||||
|
|
||||||
def make_instance(self, include_optional) -> Category:
|
def make_instance(self, include_optional):
|
||||||
"""Test Category
|
"""Test Category
|
||||||
include_option is a boolean, when False only required
|
include_option is a boolean, when False only required
|
||||||
params are included, when True both required and
|
params are included, when True both required and
|
||||||
optional params are included """
|
optional params are included """
|
||||||
# uncomment below to create an instance of `Category`
|
# model = petstore_api.models.category.Category() # noqa: E501
|
||||||
"""
|
if include_optional :
|
||||||
model = Category() # noqa: E501
|
|
||||||
if include_optional:
|
|
||||||
return Category(
|
return Category(
|
||||||
id = 56,
|
id = 56,
|
||||||
name = 'default-name'
|
name = 'default-name'
|
||||||
)
|
)
|
||||||
else:
|
else :
|
||||||
return Category(
|
return Category(
|
||||||
name = 'default-name',
|
name = 'default-name',
|
||||||
)
|
)
|
||||||
"""
|
|
||||||
|
|
||||||
def testCategory(self):
|
def testCategory(self):
|
||||||
"""Test Category"""
|
"""Test Category"""
|
||||||
|
@ -3,19 +3,23 @@
|
|||||||
"""
|
"""
|
||||||
OpenAPI Petstore
|
OpenAPI Petstore
|
||||||
|
|
||||||
This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\
|
This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501
|
||||||
|
|
||||||
The version of the OpenAPI document: 1.0.0
|
The version of the OpenAPI document: 1.0.0
|
||||||
Generated by OpenAPI Generator (https://openapi-generator.tech)
|
Generated by OpenAPI Generator (https://openapi-generator.tech)
|
||||||
|
|
||||||
Do not edit the class manually.
|
Do not edit the class manually.
|
||||||
""" # noqa: E501
|
"""
|
||||||
|
|
||||||
|
|
||||||
|
from __future__ import absolute_import
|
||||||
|
|
||||||
import unittest
|
import unittest
|
||||||
import datetime
|
import datetime
|
||||||
|
|
||||||
|
import petstore_api
|
||||||
from petstore_api.models.circular_reference_model import CircularReferenceModel # noqa: E501
|
from petstore_api.models.circular_reference_model import CircularReferenceModel # noqa: E501
|
||||||
|
from petstore_api.rest import ApiException
|
||||||
|
|
||||||
class TestCircularReferenceModel(unittest.TestCase):
|
class TestCircularReferenceModel(unittest.TestCase):
|
||||||
"""CircularReferenceModel unit test stubs"""
|
"""CircularReferenceModel unit test stubs"""
|
||||||
@ -26,15 +30,15 @@ class TestCircularReferenceModel(unittest.TestCase):
|
|||||||
def tearDown(self):
|
def tearDown(self):
|
||||||
pass
|
pass
|
||||||
|
|
||||||
def make_instance(self, include_optional) -> CircularReferenceModel:
|
def make_instance(self, include_optional):
|
||||||
"""Test CircularReferenceModel
|
"""Test CircularReferenceModel
|
||||||
include_option is a boolean, when False only required
|
include_option is a boolean, when False only required
|
||||||
params are included, when True both required and
|
params are included, when True both required and
|
||||||
optional params are included """
|
optional params are included """
|
||||||
# uncomment below to create an instance of `CircularReferenceModel`
|
# uncomment below to create an instance of `CircularReferenceModel`
|
||||||
"""
|
"""
|
||||||
model = CircularReferenceModel() # noqa: E501
|
model = petstore_api.models.circular_reference_model.CircularReferenceModel() # noqa: E501
|
||||||
if include_optional:
|
if include_optional :
|
||||||
return CircularReferenceModel(
|
return CircularReferenceModel(
|
||||||
size = 56,
|
size = 56,
|
||||||
nested = petstore_api.models.first_ref.FirstRef(
|
nested = petstore_api.models.first_ref.FirstRef(
|
||||||
@ -46,7 +50,7 @@ class TestCircularReferenceModel(unittest.TestCase):
|
|||||||
nested = petstore_api.models.first_ref.FirstRef(
|
nested = petstore_api.models.first_ref.FirstRef(
|
||||||
category = '', ), ), ), )
|
category = '', ), ), ), )
|
||||||
)
|
)
|
||||||
else:
|
else :
|
||||||
return CircularReferenceModel(
|
return CircularReferenceModel(
|
||||||
)
|
)
|
||||||
"""
|
"""
|
||||||
|
@ -3,19 +3,21 @@
|
|||||||
"""
|
"""
|
||||||
OpenAPI Petstore
|
OpenAPI Petstore
|
||||||
|
|
||||||
This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\
|
This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501
|
||||||
|
|
||||||
The version of the OpenAPI document: 1.0.0
|
The version of the OpenAPI document: 1.0.0
|
||||||
Generated by OpenAPI Generator (https://openapi-generator.tech)
|
Generated by: https://openapi-generator.tech
|
||||||
|
"""
|
||||||
|
|
||||||
Do not edit the class manually.
|
|
||||||
""" # noqa: E501
|
|
||||||
|
|
||||||
|
from __future__ import absolute_import
|
||||||
|
|
||||||
import unittest
|
import unittest
|
||||||
import datetime
|
import datetime
|
||||||
|
|
||||||
|
import petstore_api
|
||||||
from petstore_api.models.class_model import ClassModel # noqa: E501
|
from petstore_api.models.class_model import ClassModel # noqa: E501
|
||||||
|
from petstore_api.rest import ApiException
|
||||||
|
|
||||||
class TestClassModel(unittest.TestCase):
|
class TestClassModel(unittest.TestCase):
|
||||||
"""ClassModel unit test stubs"""
|
"""ClassModel unit test stubs"""
|
||||||
@ -26,22 +28,19 @@ class TestClassModel(unittest.TestCase):
|
|||||||
def tearDown(self):
|
def tearDown(self):
|
||||||
pass
|
pass
|
||||||
|
|
||||||
def make_instance(self, include_optional) -> ClassModel:
|
def make_instance(self, include_optional):
|
||||||
"""Test ClassModel
|
"""Test ClassModel
|
||||||
include_option is a boolean, when False only required
|
include_option is a boolean, when False only required
|
||||||
params are included, when True both required and
|
params are included, when True both required and
|
||||||
optional params are included """
|
optional params are included """
|
||||||
# uncomment below to create an instance of `ClassModel`
|
# model = petstore_api.models.class_model.ClassModel() # noqa: E501
|
||||||
"""
|
if include_optional :
|
||||||
model = ClassModel() # noqa: E501
|
|
||||||
if include_optional:
|
|
||||||
return ClassModel(
|
return ClassModel(
|
||||||
var_class = ''
|
_class = ''
|
||||||
)
|
)
|
||||||
else:
|
else :
|
||||||
return ClassModel(
|
return ClassModel(
|
||||||
)
|
)
|
||||||
"""
|
|
||||||
|
|
||||||
def testClassModel(self):
|
def testClassModel(self):
|
||||||
"""Test ClassModel"""
|
"""Test ClassModel"""
|
||||||
|
@ -3,19 +3,21 @@
|
|||||||
"""
|
"""
|
||||||
OpenAPI Petstore
|
OpenAPI Petstore
|
||||||
|
|
||||||
This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\
|
This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501
|
||||||
|
|
||||||
The version of the OpenAPI document: 1.0.0
|
The version of the OpenAPI document: 1.0.0
|
||||||
Generated by OpenAPI Generator (https://openapi-generator.tech)
|
Generated by: https://openapi-generator.tech
|
||||||
|
"""
|
||||||
|
|
||||||
Do not edit the class manually.
|
|
||||||
""" # noqa: E501
|
|
||||||
|
|
||||||
|
from __future__ import absolute_import
|
||||||
|
|
||||||
import unittest
|
import unittest
|
||||||
import datetime
|
import datetime
|
||||||
|
|
||||||
|
import petstore_api
|
||||||
from petstore_api.models.client import Client # noqa: E501
|
from petstore_api.models.client import Client # noqa: E501
|
||||||
|
from petstore_api.rest import ApiException
|
||||||
|
|
||||||
class TestClient(unittest.TestCase):
|
class TestClient(unittest.TestCase):
|
||||||
"""Client unit test stubs"""
|
"""Client unit test stubs"""
|
||||||
@ -26,22 +28,19 @@ class TestClient(unittest.TestCase):
|
|||||||
def tearDown(self):
|
def tearDown(self):
|
||||||
pass
|
pass
|
||||||
|
|
||||||
def make_instance(self, include_optional) -> Client:
|
def make_instance(self, include_optional):
|
||||||
"""Test Client
|
"""Test Client
|
||||||
include_option is a boolean, when False only required
|
include_option is a boolean, when False only required
|
||||||
params are included, when True both required and
|
params are included, when True both required and
|
||||||
optional params are included """
|
optional params are included """
|
||||||
# uncomment below to create an instance of `Client`
|
# model = petstore_api.models.client.Client() # noqa: E501
|
||||||
"""
|
if include_optional :
|
||||||
model = Client() # noqa: E501
|
|
||||||
if include_optional:
|
|
||||||
return Client(
|
return Client(
|
||||||
client = ''
|
client = ''
|
||||||
)
|
)
|
||||||
else:
|
else :
|
||||||
return Client(
|
return Client(
|
||||||
)
|
)
|
||||||
"""
|
|
||||||
|
|
||||||
def testClient(self):
|
def testClient(self):
|
||||||
"""Test Client"""
|
"""Test Client"""
|
||||||
|
@ -3,19 +3,21 @@
|
|||||||
"""
|
"""
|
||||||
OpenAPI Petstore
|
OpenAPI Petstore
|
||||||
|
|
||||||
This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\
|
This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501
|
||||||
|
|
||||||
The version of the OpenAPI document: 1.0.0
|
The version of the OpenAPI document: 1.0.0
|
||||||
Generated by OpenAPI Generator (https://openapi-generator.tech)
|
Generated by: https://openapi-generator.tech
|
||||||
|
"""
|
||||||
|
|
||||||
Do not edit the class manually.
|
|
||||||
""" # noqa: E501
|
|
||||||
|
|
||||||
|
from __future__ import absolute_import
|
||||||
|
|
||||||
import unittest
|
import unittest
|
||||||
import datetime
|
import datetime
|
||||||
|
|
||||||
|
import petstore_api
|
||||||
from petstore_api.models.color import Color # noqa: E501
|
from petstore_api.models.color import Color # noqa: E501
|
||||||
|
from petstore_api.rest import ApiException
|
||||||
|
|
||||||
class TestColor(unittest.TestCase):
|
class TestColor(unittest.TestCase):
|
||||||
"""Color unit test stubs"""
|
"""Color unit test stubs"""
|
||||||
@ -26,18 +28,18 @@ class TestColor(unittest.TestCase):
|
|||||||
def tearDown(self):
|
def tearDown(self):
|
||||||
pass
|
pass
|
||||||
|
|
||||||
def make_instance(self, include_optional) -> Color:
|
def make_instance(self, include_optional):
|
||||||
"""Test Color
|
"""Test Color
|
||||||
include_option is a boolean, when False only required
|
include_option is a boolean, when False only required
|
||||||
params are included, when True both required and
|
params are included, when True both required and
|
||||||
optional params are included """
|
optional params are included """
|
||||||
# uncomment below to create an instance of `Color`
|
# uncomment below to create an instance of `Color`
|
||||||
"""
|
"""
|
||||||
model = Color() # noqa: E501
|
model = petstore_api.models.color.Color() # noqa: E501
|
||||||
if include_optional:
|
if include_optional :
|
||||||
return Color(
|
return Color(
|
||||||
)
|
)
|
||||||
else:
|
else :
|
||||||
return Color(
|
return Color(
|
||||||
)
|
)
|
||||||
"""
|
"""
|
||||||
|
@ -3,19 +3,21 @@
|
|||||||
"""
|
"""
|
||||||
OpenAPI Petstore
|
OpenAPI Petstore
|
||||||
|
|
||||||
This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\
|
This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501
|
||||||
|
|
||||||
The version of the OpenAPI document: 1.0.0
|
The version of the OpenAPI document: 1.0.0
|
||||||
Generated by OpenAPI Generator (https://openapi-generator.tech)
|
Generated by OpenAPI Generator (https://openapi-generator.tech)
|
||||||
|
|
||||||
Do not edit the class manually.
|
Do not edit the class manually.
|
||||||
""" # noqa: E501
|
"""
|
||||||
|
|
||||||
|
|
||||||
import unittest
|
import unittest
|
||||||
import datetime
|
import datetime
|
||||||
|
|
||||||
|
import petstore_api
|
||||||
from petstore_api.models.creature import Creature # noqa: E501
|
from petstore_api.models.creature import Creature # noqa: E501
|
||||||
|
from petstore_api.rest import ApiException
|
||||||
|
|
||||||
class TestCreature(unittest.TestCase):
|
class TestCreature(unittest.TestCase):
|
||||||
"""Creature unit test stubs"""
|
"""Creature unit test stubs"""
|
||||||
@ -26,21 +28,21 @@ class TestCreature(unittest.TestCase):
|
|||||||
def tearDown(self):
|
def tearDown(self):
|
||||||
pass
|
pass
|
||||||
|
|
||||||
def make_instance(self, include_optional) -> Creature:
|
def make_instance(self, include_optional):
|
||||||
"""Test Creature
|
"""Test Creature
|
||||||
include_option is a boolean, when False only required
|
include_option is a boolean, when False only required
|
||||||
params are included, when True both required and
|
params are included, when True both required and
|
||||||
optional params are included """
|
optional params are included """
|
||||||
# uncomment below to create an instance of `Creature`
|
# uncomment below to create an instance of `Creature`
|
||||||
"""
|
"""
|
||||||
model = Creature() # noqa: E501
|
model = petstore_api.models.creature.Creature() # noqa: E501
|
||||||
if include_optional:
|
if include_optional :
|
||||||
return Creature(
|
return Creature(
|
||||||
info = petstore_api.models.creature_info.CreatureInfo(
|
info = petstore_api.models.creature_info.CreatureInfo(
|
||||||
name = '', ),
|
name = '', ),
|
||||||
type = ''
|
type = ''
|
||||||
)
|
)
|
||||||
else:
|
else :
|
||||||
return Creature(
|
return Creature(
|
||||||
info = petstore_api.models.creature_info.CreatureInfo(
|
info = petstore_api.models.creature_info.CreatureInfo(
|
||||||
name = '', ),
|
name = '', ),
|
||||||
|
@ -3,19 +3,21 @@
|
|||||||
"""
|
"""
|
||||||
OpenAPI Petstore
|
OpenAPI Petstore
|
||||||
|
|
||||||
This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\
|
This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501
|
||||||
|
|
||||||
The version of the OpenAPI document: 1.0.0
|
The version of the OpenAPI document: 1.0.0
|
||||||
Generated by OpenAPI Generator (https://openapi-generator.tech)
|
Generated by OpenAPI Generator (https://openapi-generator.tech)
|
||||||
|
|
||||||
Do not edit the class manually.
|
Do not edit the class manually.
|
||||||
""" # noqa: E501
|
"""
|
||||||
|
|
||||||
|
|
||||||
import unittest
|
import unittest
|
||||||
import datetime
|
import datetime
|
||||||
|
|
||||||
|
import petstore_api
|
||||||
from petstore_api.models.creature_info import CreatureInfo # noqa: E501
|
from petstore_api.models.creature_info import CreatureInfo # noqa: E501
|
||||||
|
from petstore_api.rest import ApiException
|
||||||
|
|
||||||
class TestCreatureInfo(unittest.TestCase):
|
class TestCreatureInfo(unittest.TestCase):
|
||||||
"""CreatureInfo unit test stubs"""
|
"""CreatureInfo unit test stubs"""
|
||||||
@ -26,19 +28,19 @@ class TestCreatureInfo(unittest.TestCase):
|
|||||||
def tearDown(self):
|
def tearDown(self):
|
||||||
pass
|
pass
|
||||||
|
|
||||||
def make_instance(self, include_optional) -> CreatureInfo:
|
def make_instance(self, include_optional):
|
||||||
"""Test CreatureInfo
|
"""Test CreatureInfo
|
||||||
include_option is a boolean, when False only required
|
include_option is a boolean, when False only required
|
||||||
params are included, when True both required and
|
params are included, when True both required and
|
||||||
optional params are included """
|
optional params are included """
|
||||||
# uncomment below to create an instance of `CreatureInfo`
|
# uncomment below to create an instance of `CreatureInfo`
|
||||||
"""
|
"""
|
||||||
model = CreatureInfo() # noqa: E501
|
model = petstore_api.models.creature_info.CreatureInfo() # noqa: E501
|
||||||
if include_optional:
|
if include_optional :
|
||||||
return CreatureInfo(
|
return CreatureInfo(
|
||||||
name = ''
|
name = ''
|
||||||
)
|
)
|
||||||
else:
|
else :
|
||||||
return CreatureInfo(
|
return CreatureInfo(
|
||||||
name = '',
|
name = '',
|
||||||
)
|
)
|
||||||
|
@ -3,19 +3,21 @@
|
|||||||
"""
|
"""
|
||||||
OpenAPI Petstore
|
OpenAPI Petstore
|
||||||
|
|
||||||
This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\
|
This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501
|
||||||
|
|
||||||
The version of the OpenAPI document: 1.0.0
|
The version of the OpenAPI document: 1.0.0
|
||||||
Generated by OpenAPI Generator (https://openapi-generator.tech)
|
Generated by: https://openapi-generator.tech
|
||||||
|
"""
|
||||||
|
|
||||||
Do not edit the class manually.
|
|
||||||
""" # noqa: E501
|
|
||||||
|
|
||||||
|
from __future__ import absolute_import
|
||||||
|
|
||||||
import unittest
|
import unittest
|
||||||
import datetime
|
import datetime
|
||||||
|
|
||||||
|
import petstore_api
|
||||||
from petstore_api.models.danish_pig import DanishPig # noqa: E501
|
from petstore_api.models.danish_pig import DanishPig # noqa: E501
|
||||||
|
from petstore_api.rest import ApiException
|
||||||
|
|
||||||
class TestDanishPig(unittest.TestCase):
|
class TestDanishPig(unittest.TestCase):
|
||||||
"""DanishPig unit test stubs"""
|
"""DanishPig unit test stubs"""
|
||||||
@ -26,25 +28,22 @@ class TestDanishPig(unittest.TestCase):
|
|||||||
def tearDown(self):
|
def tearDown(self):
|
||||||
pass
|
pass
|
||||||
|
|
||||||
def make_instance(self, include_optional) -> DanishPig:
|
def make_instance(self, include_optional):
|
||||||
"""Test DanishPig
|
"""Test DanishPig
|
||||||
include_option is a boolean, when False only required
|
include_option is a boolean, when False only required
|
||||||
params are included, when True both required and
|
params are included, when True both required and
|
||||||
optional params are included """
|
optional params are included """
|
||||||
# uncomment below to create an instance of `DanishPig`
|
# model = petstore_api.models.danish_pig.DanishPig() # noqa: E501
|
||||||
"""
|
if include_optional :
|
||||||
model = DanishPig() # noqa: E501
|
|
||||||
if include_optional:
|
|
||||||
return DanishPig(
|
return DanishPig(
|
||||||
class_name = '',
|
class_name = '',
|
||||||
size = 56
|
size = 56
|
||||||
)
|
)
|
||||||
else:
|
else :
|
||||||
return DanishPig(
|
return DanishPig(
|
||||||
class_name = '',
|
class_name = '',
|
||||||
size = 56,
|
size = 56,
|
||||||
)
|
)
|
||||||
"""
|
|
||||||
|
|
||||||
def testDanishPig(self):
|
def testDanishPig(self):
|
||||||
"""Test DanishPig"""
|
"""Test DanishPig"""
|
||||||
|
@ -3,30 +3,32 @@
|
|||||||
"""
|
"""
|
||||||
OpenAPI Petstore
|
OpenAPI Petstore
|
||||||
|
|
||||||
This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\
|
This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501
|
||||||
|
|
||||||
The version of the OpenAPI document: 1.0.0
|
The version of the OpenAPI document: 1.0.0
|
||||||
Generated by OpenAPI Generator (https://openapi-generator.tech)
|
Generated by: https://openapi-generator.tech
|
||||||
|
"""
|
||||||
|
|
||||||
Do not edit the class manually.
|
|
||||||
""" # noqa: E501
|
|
||||||
|
|
||||||
|
from __future__ import absolute_import
|
||||||
|
|
||||||
import unittest
|
import unittest
|
||||||
|
|
||||||
|
import petstore_api
|
||||||
from petstore_api.api.default_api import DefaultApi # noqa: E501
|
from petstore_api.api.default_api import DefaultApi # noqa: E501
|
||||||
|
from petstore_api.rest import ApiException
|
||||||
|
|
||||||
|
|
||||||
class TestDefaultApi(unittest.TestCase):
|
class TestDefaultApi(unittest.TestCase):
|
||||||
"""DefaultApi unit test stubs"""
|
"""DefaultApi unit test stubs"""
|
||||||
|
|
||||||
def setUp(self) -> None:
|
def setUp(self):
|
||||||
self.api = DefaultApi() # noqa: E501
|
self.api = petstore_api.api.default_api.DefaultApi() # noqa: E501
|
||||||
|
|
||||||
def tearDown(self) -> None:
|
def tearDown(self):
|
||||||
pass
|
pass
|
||||||
|
|
||||||
def test_foo_get(self) -> None:
|
def test_foo_get(self):
|
||||||
"""Test case for foo_get
|
"""Test case for foo_get
|
||||||
|
|
||||||
"""
|
"""
|
||||||
|
@ -3,19 +3,21 @@
|
|||||||
"""
|
"""
|
||||||
OpenAPI Petstore
|
OpenAPI Petstore
|
||||||
|
|
||||||
This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\
|
This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501
|
||||||
|
|
||||||
The version of the OpenAPI document: 1.0.0
|
The version of the OpenAPI document: 1.0.0
|
||||||
Generated by OpenAPI Generator (https://openapi-generator.tech)
|
Generated by: https://openapi-generator.tech
|
||||||
|
"""
|
||||||
|
|
||||||
Do not edit the class manually.
|
|
||||||
""" # noqa: E501
|
|
||||||
|
|
||||||
|
from __future__ import absolute_import
|
||||||
|
|
||||||
import unittest
|
import unittest
|
||||||
import datetime
|
import datetime
|
||||||
|
|
||||||
|
import petstore_api
|
||||||
from petstore_api.models.deprecated_object import DeprecatedObject # noqa: E501
|
from petstore_api.models.deprecated_object import DeprecatedObject # noqa: E501
|
||||||
|
from petstore_api.rest import ApiException
|
||||||
|
|
||||||
class TestDeprecatedObject(unittest.TestCase):
|
class TestDeprecatedObject(unittest.TestCase):
|
||||||
"""DeprecatedObject unit test stubs"""
|
"""DeprecatedObject unit test stubs"""
|
||||||
@ -26,22 +28,19 @@ class TestDeprecatedObject(unittest.TestCase):
|
|||||||
def tearDown(self):
|
def tearDown(self):
|
||||||
pass
|
pass
|
||||||
|
|
||||||
def make_instance(self, include_optional) -> DeprecatedObject:
|
def make_instance(self, include_optional):
|
||||||
"""Test DeprecatedObject
|
"""Test DeprecatedObject
|
||||||
include_option is a boolean, when False only required
|
include_option is a boolean, when False only required
|
||||||
params are included, when True both required and
|
params are included, when True both required and
|
||||||
optional params are included """
|
optional params are included """
|
||||||
# uncomment below to create an instance of `DeprecatedObject`
|
# model = petstore_api.models.deprecated_object.DeprecatedObject() # noqa: E501
|
||||||
"""
|
if include_optional :
|
||||||
model = DeprecatedObject() # noqa: E501
|
|
||||||
if include_optional:
|
|
||||||
return DeprecatedObject(
|
return DeprecatedObject(
|
||||||
name = ''
|
name = ''
|
||||||
)
|
)
|
||||||
else:
|
else :
|
||||||
return DeprecatedObject(
|
return DeprecatedObject(
|
||||||
)
|
)
|
||||||
"""
|
|
||||||
|
|
||||||
def testDeprecatedObject(self):
|
def testDeprecatedObject(self):
|
||||||
"""Test DeprecatedObject"""
|
"""Test DeprecatedObject"""
|
||||||
|
@ -3,19 +3,21 @@
|
|||||||
"""
|
"""
|
||||||
OpenAPI Petstore
|
OpenAPI Petstore
|
||||||
|
|
||||||
This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\
|
This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501
|
||||||
|
|
||||||
The version of the OpenAPI document: 1.0.0
|
The version of the OpenAPI document: 1.0.0
|
||||||
Generated by OpenAPI Generator (https://openapi-generator.tech)
|
Generated by: https://openapi-generator.tech
|
||||||
|
"""
|
||||||
|
|
||||||
Do not edit the class manually.
|
|
||||||
""" # noqa: E501
|
|
||||||
|
|
||||||
|
from __future__ import absolute_import
|
||||||
|
|
||||||
import unittest
|
import unittest
|
||||||
import datetime
|
import datetime
|
||||||
|
|
||||||
|
import petstore_api
|
||||||
from petstore_api.models.dog import Dog # noqa: E501
|
from petstore_api.models.dog import Dog # noqa: E501
|
||||||
|
from petstore_api.rest import ApiException
|
||||||
|
|
||||||
class TestDog(unittest.TestCase):
|
class TestDog(unittest.TestCase):
|
||||||
"""Dog unit test stubs"""
|
"""Dog unit test stubs"""
|
||||||
@ -26,22 +28,19 @@ class TestDog(unittest.TestCase):
|
|||||||
def tearDown(self):
|
def tearDown(self):
|
||||||
pass
|
pass
|
||||||
|
|
||||||
def make_instance(self, include_optional) -> Dog:
|
def make_instance(self, include_optional):
|
||||||
"""Test Dog
|
"""Test Dog
|
||||||
include_option is a boolean, when False only required
|
include_option is a boolean, when False only required
|
||||||
params are included, when True both required and
|
params are included, when True both required and
|
||||||
optional params are included """
|
optional params are included """
|
||||||
# uncomment below to create an instance of `Dog`
|
# model = petstore_api.models.dog.Dog() # noqa: E501
|
||||||
"""
|
if include_optional :
|
||||||
model = Dog() # noqa: E501
|
|
||||||
if include_optional:
|
|
||||||
return Dog(
|
return Dog(
|
||||||
breed = ''
|
breed = ''
|
||||||
)
|
)
|
||||||
else:
|
else :
|
||||||
return Dog(
|
return Dog(
|
||||||
)
|
)
|
||||||
"""
|
|
||||||
|
|
||||||
def testDog(self):
|
def testDog(self):
|
||||||
"""Test Dog"""
|
"""Test Dog"""
|
||||||
|
@ -3,19 +3,21 @@
|
|||||||
"""
|
"""
|
||||||
OpenAPI Petstore
|
OpenAPI Petstore
|
||||||
|
|
||||||
This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\
|
This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501
|
||||||
|
|
||||||
The version of the OpenAPI document: 1.0.0
|
The version of the OpenAPI document: 1.0.0
|
||||||
Generated by OpenAPI Generator (https://openapi-generator.tech)
|
Generated by: https://openapi-generator.tech
|
||||||
|
"""
|
||||||
|
|
||||||
Do not edit the class manually.
|
|
||||||
""" # noqa: E501
|
|
||||||
|
|
||||||
|
from __future__ import absolute_import
|
||||||
|
|
||||||
import unittest
|
import unittest
|
||||||
import datetime
|
import datetime
|
||||||
|
|
||||||
|
import petstore_api
|
||||||
from petstore_api.models.dummy_model import DummyModel # noqa: E501
|
from petstore_api.models.dummy_model import DummyModel # noqa: E501
|
||||||
|
from petstore_api.rest import ApiException
|
||||||
|
|
||||||
class TestDummyModel(unittest.TestCase):
|
class TestDummyModel(unittest.TestCase):
|
||||||
"""DummyModel unit test stubs"""
|
"""DummyModel unit test stubs"""
|
||||||
@ -26,15 +28,15 @@ class TestDummyModel(unittest.TestCase):
|
|||||||
def tearDown(self):
|
def tearDown(self):
|
||||||
pass
|
pass
|
||||||
|
|
||||||
def make_instance(self, include_optional) -> DummyModel:
|
def make_instance(self, include_optional):
|
||||||
"""Test DummyModel
|
"""Test DummyModel
|
||||||
include_option is a boolean, when False only required
|
include_option is a boolean, when False only required
|
||||||
params are included, when True both required and
|
params are included, when True both required and
|
||||||
optional params are included """
|
optional params are included """
|
||||||
# uncomment below to create an instance of `DummyModel`
|
# uncomment below to create an instance of `DummyModel`
|
||||||
"""
|
"""
|
||||||
model = DummyModel() # noqa: E501
|
model = petstore_api.models.dummy_model.DummyModel() # noqa: E501
|
||||||
if include_optional:
|
if include_optional :
|
||||||
return DummyModel(
|
return DummyModel(
|
||||||
category = '',
|
category = '',
|
||||||
self_ref = petstore_api.models.self_reference_model.Self-Reference-Model(
|
self_ref = petstore_api.models.self_reference_model.Self-Reference-Model(
|
||||||
@ -42,7 +44,7 @@ class TestDummyModel(unittest.TestCase):
|
|||||||
nested = petstore_api.models.dummy_model.Dummy-Model(
|
nested = petstore_api.models.dummy_model.Dummy-Model(
|
||||||
category = '', ), )
|
category = '', ), )
|
||||||
)
|
)
|
||||||
else:
|
else :
|
||||||
return DummyModel(
|
return DummyModel(
|
||||||
)
|
)
|
||||||
"""
|
"""
|
||||||
|
@ -3,19 +3,21 @@
|
|||||||
"""
|
"""
|
||||||
OpenAPI Petstore
|
OpenAPI Petstore
|
||||||
|
|
||||||
This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\
|
This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501
|
||||||
|
|
||||||
The version of the OpenAPI document: 1.0.0
|
The version of the OpenAPI document: 1.0.0
|
||||||
Generated by OpenAPI Generator (https://openapi-generator.tech)
|
Generated by: https://openapi-generator.tech
|
||||||
|
"""
|
||||||
|
|
||||||
Do not edit the class manually.
|
|
||||||
""" # noqa: E501
|
|
||||||
|
|
||||||
|
from __future__ import absolute_import
|
||||||
|
|
||||||
import unittest
|
import unittest
|
||||||
import datetime
|
import datetime
|
||||||
|
|
||||||
|
import petstore_api
|
||||||
from petstore_api.models.enum_arrays import EnumArrays # noqa: E501
|
from petstore_api.models.enum_arrays import EnumArrays # noqa: E501
|
||||||
|
from petstore_api.rest import ApiException
|
||||||
|
|
||||||
class TestEnumArrays(unittest.TestCase):
|
class TestEnumArrays(unittest.TestCase):
|
||||||
"""EnumArrays unit test stubs"""
|
"""EnumArrays unit test stubs"""
|
||||||
@ -26,25 +28,22 @@ class TestEnumArrays(unittest.TestCase):
|
|||||||
def tearDown(self):
|
def tearDown(self):
|
||||||
pass
|
pass
|
||||||
|
|
||||||
def make_instance(self, include_optional) -> EnumArrays:
|
def make_instance(self, include_optional):
|
||||||
"""Test EnumArrays
|
"""Test EnumArrays
|
||||||
include_option is a boolean, when False only required
|
include_option is a boolean, when False only required
|
||||||
params are included, when True both required and
|
params are included, when True both required and
|
||||||
optional params are included """
|
optional params are included """
|
||||||
# uncomment below to create an instance of `EnumArrays`
|
# model = petstore_api.models.enum_arrays.EnumArrays() # noqa: E501
|
||||||
"""
|
if include_optional :
|
||||||
model = EnumArrays() # noqa: E501
|
|
||||||
if include_optional:
|
|
||||||
return EnumArrays(
|
return EnumArrays(
|
||||||
just_symbol = '>=',
|
just_symbol = '>=',
|
||||||
array_enum = [
|
array_enum = [
|
||||||
'fish'
|
'fish'
|
||||||
]
|
]
|
||||||
)
|
)
|
||||||
else:
|
else :
|
||||||
return EnumArrays(
|
return EnumArrays(
|
||||||
)
|
)
|
||||||
"""
|
|
||||||
|
|
||||||
def testEnumArrays(self):
|
def testEnumArrays(self):
|
||||||
"""Test EnumArrays"""
|
"""Test EnumArrays"""
|
||||||
|
@ -3,19 +3,21 @@
|
|||||||
"""
|
"""
|
||||||
OpenAPI Petstore
|
OpenAPI Petstore
|
||||||
|
|
||||||
This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\
|
This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501
|
||||||
|
|
||||||
The version of the OpenAPI document: 1.0.0
|
The version of the OpenAPI document: 1.0.0
|
||||||
Generated by OpenAPI Generator (https://openapi-generator.tech)
|
Generated by: https://openapi-generator.tech
|
||||||
|
"""
|
||||||
|
|
||||||
Do not edit the class manually.
|
|
||||||
""" # noqa: E501
|
|
||||||
|
|
||||||
|
from __future__ import absolute_import
|
||||||
|
|
||||||
import unittest
|
import unittest
|
||||||
import datetime
|
import datetime
|
||||||
|
|
||||||
|
import petstore_api
|
||||||
from petstore_api.models.enum_class import EnumClass # noqa: E501
|
from petstore_api.models.enum_class import EnumClass # noqa: E501
|
||||||
|
from petstore_api.rest import ApiException
|
||||||
|
|
||||||
class TestEnumClass(unittest.TestCase):
|
class TestEnumClass(unittest.TestCase):
|
||||||
"""EnumClass unit test stubs"""
|
"""EnumClass unit test stubs"""
|
||||||
|
@ -3,19 +3,21 @@
|
|||||||
"""
|
"""
|
||||||
OpenAPI Petstore
|
OpenAPI Petstore
|
||||||
|
|
||||||
This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\
|
This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501
|
||||||
|
|
||||||
The version of the OpenAPI document: 1.0.0
|
The version of the OpenAPI document: 1.0.0
|
||||||
Generated by OpenAPI Generator (https://openapi-generator.tech)
|
Generated by OpenAPI Generator (https://openapi-generator.tech)
|
||||||
|
|
||||||
Do not edit the class manually.
|
Do not edit the class manually.
|
||||||
""" # noqa: E501
|
"""
|
||||||
|
|
||||||
|
|
||||||
import unittest
|
import unittest
|
||||||
import datetime
|
import datetime
|
||||||
|
|
||||||
|
import petstore_api
|
||||||
from petstore_api.models.enum_string1 import EnumString1 # noqa: E501
|
from petstore_api.models.enum_string1 import EnumString1 # noqa: E501
|
||||||
|
from petstore_api.rest import ApiException
|
||||||
|
|
||||||
class TestEnumString1(unittest.TestCase):
|
class TestEnumString1(unittest.TestCase):
|
||||||
"""EnumString1 unit test stubs"""
|
"""EnumString1 unit test stubs"""
|
||||||
|
@ -3,19 +3,21 @@
|
|||||||
"""
|
"""
|
||||||
OpenAPI Petstore
|
OpenAPI Petstore
|
||||||
|
|
||||||
This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\
|
This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501
|
||||||
|
|
||||||
The version of the OpenAPI document: 1.0.0
|
The version of the OpenAPI document: 1.0.0
|
||||||
Generated by OpenAPI Generator (https://openapi-generator.tech)
|
Generated by OpenAPI Generator (https://openapi-generator.tech)
|
||||||
|
|
||||||
Do not edit the class manually.
|
Do not edit the class manually.
|
||||||
""" # noqa: E501
|
"""
|
||||||
|
|
||||||
|
|
||||||
import unittest
|
import unittest
|
||||||
import datetime
|
import datetime
|
||||||
|
|
||||||
|
import petstore_api
|
||||||
from petstore_api.models.enum_string2 import EnumString2 # noqa: E501
|
from petstore_api.models.enum_string2 import EnumString2 # noqa: E501
|
||||||
|
from petstore_api.rest import ApiException
|
||||||
|
|
||||||
class TestEnumString2(unittest.TestCase):
|
class TestEnumString2(unittest.TestCase):
|
||||||
"""EnumString2 unit test stubs"""
|
"""EnumString2 unit test stubs"""
|
||||||
|
@ -3,19 +3,21 @@
|
|||||||
"""
|
"""
|
||||||
OpenAPI Petstore
|
OpenAPI Petstore
|
||||||
|
|
||||||
This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\
|
This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501
|
||||||
|
|
||||||
The version of the OpenAPI document: 1.0.0
|
The version of the OpenAPI document: 1.0.0
|
||||||
Generated by OpenAPI Generator (https://openapi-generator.tech)
|
Generated by: https://openapi-generator.tech
|
||||||
|
"""
|
||||||
|
|
||||||
Do not edit the class manually.
|
|
||||||
""" # noqa: E501
|
|
||||||
|
|
||||||
|
from __future__ import absolute_import
|
||||||
|
|
||||||
import unittest
|
import unittest
|
||||||
import datetime
|
import datetime
|
||||||
|
|
||||||
|
import petstore_api
|
||||||
from petstore_api.models.enum_test import EnumTest # noqa: E501
|
from petstore_api.models.enum_test import EnumTest # noqa: E501
|
||||||
|
from petstore_api.rest import ApiException
|
||||||
|
|
||||||
class TestEnumTest(unittest.TestCase):
|
class TestEnumTest(unittest.TestCase):
|
||||||
"""EnumTest unit test stubs"""
|
"""EnumTest unit test stubs"""
|
||||||
@ -26,31 +28,23 @@ class TestEnumTest(unittest.TestCase):
|
|||||||
def tearDown(self):
|
def tearDown(self):
|
||||||
pass
|
pass
|
||||||
|
|
||||||
def make_instance(self, include_optional) -> EnumTest:
|
def make_instance(self, include_optional):
|
||||||
"""Test EnumTest
|
"""Test EnumTest
|
||||||
include_option is a boolean, when False only required
|
include_option is a boolean, when False only required
|
||||||
params are included, when True both required and
|
params are included, when True both required and
|
||||||
optional params are included """
|
optional params are included """
|
||||||
# uncomment below to create an instance of `EnumTest`
|
# model = petstore_api.models.enum_test.EnumTest() # noqa: E501
|
||||||
"""
|
if include_optional :
|
||||||
model = EnumTest() # noqa: E501
|
|
||||||
if include_optional:
|
|
||||||
return EnumTest(
|
return EnumTest(
|
||||||
enum_string = 'UPPER',
|
enum_string = 'UPPER',
|
||||||
enum_string_required = 'UPPER',
|
enum_string_required = 'UPPER',
|
||||||
enum_integer_default = 1,
|
|
||||||
enum_integer = 1,
|
enum_integer = 1,
|
||||||
enum_number = 1.1,
|
enum_number = 1.1
|
||||||
outer_enum = 'placed',
|
|
||||||
outer_enum_integer = 2,
|
|
||||||
outer_enum_default_value = 'placed',
|
|
||||||
outer_enum_integer_default_value = -1
|
|
||||||
)
|
)
|
||||||
else:
|
else :
|
||||||
return EnumTest(
|
return EnumTest(
|
||||||
enum_string_required = 'UPPER',
|
enum_string_required = 'UPPER',
|
||||||
)
|
)
|
||||||
"""
|
|
||||||
|
|
||||||
def testEnumTest(self):
|
def testEnumTest(self):
|
||||||
"""Test EnumTest"""
|
"""Test EnumTest"""
|
||||||
|
@ -3,168 +3,129 @@
|
|||||||
"""
|
"""
|
||||||
OpenAPI Petstore
|
OpenAPI Petstore
|
||||||
|
|
||||||
This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\
|
This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501
|
||||||
|
|
||||||
The version of the OpenAPI document: 1.0.0
|
The version of the OpenAPI document: 1.0.0
|
||||||
Generated by OpenAPI Generator (https://openapi-generator.tech)
|
Generated by: https://openapi-generator.tech
|
||||||
|
"""
|
||||||
|
|
||||||
Do not edit the class manually.
|
|
||||||
""" # noqa: E501
|
|
||||||
|
|
||||||
|
from __future__ import absolute_import
|
||||||
|
|
||||||
import unittest
|
import unittest
|
||||||
|
|
||||||
|
import petstore_api
|
||||||
from petstore_api.api.fake_api import FakeApi # noqa: E501
|
from petstore_api.api.fake_api import FakeApi # noqa: E501
|
||||||
|
from petstore_api.rest import ApiException
|
||||||
|
|
||||||
|
|
||||||
class TestFakeApi(unittest.TestCase):
|
class TestFakeApi(unittest.TestCase):
|
||||||
"""FakeApi unit test stubs"""
|
"""FakeApi unit test stubs"""
|
||||||
|
|
||||||
def setUp(self) -> None:
|
def setUp(self):
|
||||||
self.api = FakeApi() # noqa: E501
|
self.api = petstore_api.api.fake_api.FakeApi() # noqa: E501
|
||||||
|
|
||||||
def tearDown(self) -> None:
|
def tearDown(self):
|
||||||
pass
|
pass
|
||||||
|
|
||||||
def test_fake_any_type_request_body(self) -> None:
|
def test_fake_health_get(self):
|
||||||
"""Test case for fake_any_type_request_body
|
|
||||||
|
|
||||||
test any type request body # noqa: E501
|
|
||||||
"""
|
|
||||||
pass
|
|
||||||
|
|
||||||
def test_fake_enum_ref_query_parameter(self) -> None:
|
|
||||||
"""Test case for fake_enum_ref_query_parameter
|
|
||||||
|
|
||||||
test enum reference query parameter # noqa: E501
|
|
||||||
"""
|
|
||||||
pass
|
|
||||||
|
|
||||||
def test_fake_health_get(self) -> None:
|
|
||||||
"""Test case for fake_health_get
|
"""Test case for fake_health_get
|
||||||
|
|
||||||
Health check endpoint # noqa: E501
|
Health check endpoint # noqa: E501
|
||||||
"""
|
"""
|
||||||
pass
|
pass
|
||||||
|
|
||||||
def test_fake_http_signature_test(self) -> None:
|
def test_fake_http_signature_test(self):
|
||||||
"""Test case for fake_http_signature_test
|
"""Test case for fake_http_signature_test
|
||||||
|
|
||||||
test http signature authentication # noqa: E501
|
test http signature authentication # noqa: E501
|
||||||
"""
|
"""
|
||||||
pass
|
pass
|
||||||
|
|
||||||
def test_fake_outer_boolean_serialize(self) -> None:
|
def test_fake_outer_boolean_serialize(self):
|
||||||
"""Test case for fake_outer_boolean_serialize
|
"""Test case for fake_outer_boolean_serialize
|
||||||
|
|
||||||
"""
|
"""
|
||||||
pass
|
pass
|
||||||
|
|
||||||
def test_fake_outer_composite_serialize(self) -> None:
|
def test_fake_outer_composite_serialize(self):
|
||||||
"""Test case for fake_outer_composite_serialize
|
"""Test case for fake_outer_composite_serialize
|
||||||
|
|
||||||
"""
|
"""
|
||||||
pass
|
pass
|
||||||
|
|
||||||
def test_fake_outer_number_serialize(self) -> None:
|
def test_fake_outer_number_serialize(self):
|
||||||
"""Test case for fake_outer_number_serialize
|
"""Test case for fake_outer_number_serialize
|
||||||
|
|
||||||
"""
|
"""
|
||||||
pass
|
pass
|
||||||
|
|
||||||
def test_fake_outer_string_serialize(self) -> None:
|
def test_fake_outer_string_serialize(self):
|
||||||
"""Test case for fake_outer_string_serialize
|
"""Test case for fake_outer_string_serialize
|
||||||
|
|
||||||
"""
|
"""
|
||||||
pass
|
pass
|
||||||
|
|
||||||
def test_fake_property_enum_integer_serialize(self) -> None:
|
def test_fake_property_enum_integer_serialize(self):
|
||||||
"""Test case for fake_property_enum_integer_serialize
|
"""Test case for fake_property_enum_integer_serialize
|
||||||
|
|
||||||
"""
|
"""
|
||||||
pass
|
pass
|
||||||
|
|
||||||
def test_fake_return_list_of_objects(self) -> None:
|
def test_test_body_with_binary(self):
|
||||||
"""Test case for fake_return_list_of_objects
|
|
||||||
|
|
||||||
test returning list of objects # noqa: E501
|
|
||||||
"""
|
|
||||||
pass
|
|
||||||
|
|
||||||
def test_fake_uuid_example(self) -> None:
|
|
||||||
"""Test case for fake_uuid_example
|
|
||||||
|
|
||||||
test uuid example # noqa: E501
|
|
||||||
"""
|
|
||||||
pass
|
|
||||||
|
|
||||||
def test_test_body_with_binary(self) -> None:
|
|
||||||
"""Test case for test_body_with_binary
|
"""Test case for test_body_with_binary
|
||||||
|
|
||||||
"""
|
"""
|
||||||
pass
|
pass
|
||||||
|
|
||||||
def test_test_body_with_file_schema(self) -> None:
|
def test_test_body_with_file_schema(self):
|
||||||
"""Test case for test_body_with_file_schema
|
"""Test case for test_body_with_file_schema
|
||||||
|
|
||||||
"""
|
"""
|
||||||
pass
|
pass
|
||||||
|
|
||||||
def test_test_body_with_query_params(self) -> None:
|
def test_test_body_with_query_params(self):
|
||||||
"""Test case for test_body_with_query_params
|
"""Test case for test_body_with_query_params
|
||||||
|
|
||||||
"""
|
"""
|
||||||
pass
|
pass
|
||||||
|
|
||||||
def test_test_client_model(self) -> None:
|
def test_test_client_model(self):
|
||||||
"""Test case for test_client_model
|
"""Test case for test_client_model
|
||||||
|
|
||||||
To test \"client\" model # noqa: E501
|
To test \"client\" model # noqa: E501
|
||||||
"""
|
"""
|
||||||
pass
|
pass
|
||||||
|
|
||||||
def test_test_date_time_query_parameter(self) -> None:
|
def test_test_endpoint_parameters(self):
|
||||||
"""Test case for test_date_time_query_parameter
|
|
||||||
|
|
||||||
"""
|
|
||||||
pass
|
|
||||||
|
|
||||||
def test_test_endpoint_parameters(self) -> None:
|
|
||||||
"""Test case for test_endpoint_parameters
|
"""Test case for test_endpoint_parameters
|
||||||
|
|
||||||
Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 # noqa: E501
|
Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 # noqa: E501
|
||||||
"""
|
"""
|
||||||
pass
|
pass
|
||||||
|
|
||||||
def test_test_group_parameters(self) -> None:
|
def test_test_group_parameters(self):
|
||||||
"""Test case for test_group_parameters
|
"""Test case for test_group_parameters
|
||||||
|
|
||||||
Fake endpoint to test group parameters (optional) # noqa: E501
|
Fake endpoint to test group parameters (optional) # noqa: E501
|
||||||
"""
|
"""
|
||||||
pass
|
pass
|
||||||
|
|
||||||
def test_test_inline_additional_properties(self) -> None:
|
def test_test_inline_additional_properties(self):
|
||||||
"""Test case for test_inline_additional_properties
|
"""Test case for test_inline_additional_properties
|
||||||
|
|
||||||
test inline additionalProperties # noqa: E501
|
test inline additionalProperties # noqa: E501
|
||||||
"""
|
"""
|
||||||
pass
|
pass
|
||||||
|
|
||||||
def test_test_inline_freeform_additional_properties(self) -> None:
|
def test_test_json_form_data(self):
|
||||||
"""Test case for test_inline_freeform_additional_properties
|
|
||||||
|
|
||||||
test inline free-form additionalProperties # noqa: E501
|
|
||||||
"""
|
|
||||||
pass
|
|
||||||
|
|
||||||
def test_test_json_form_data(self) -> None:
|
|
||||||
"""Test case for test_json_form_data
|
"""Test case for test_json_form_data
|
||||||
|
|
||||||
test json serialization of form data # noqa: E501
|
test json serialization of form data # noqa: E501
|
||||||
"""
|
"""
|
||||||
pass
|
pass
|
||||||
|
|
||||||
def test_test_query_parameter_collection_format(self) -> None:
|
def test_test_query_parameter_collection_format(self):
|
||||||
"""Test case for test_query_parameter_collection_format
|
"""Test case for test_query_parameter_collection_format
|
||||||
|
|
||||||
"""
|
"""
|
||||||
|
@ -3,30 +3,32 @@
|
|||||||
"""
|
"""
|
||||||
OpenAPI Petstore
|
OpenAPI Petstore
|
||||||
|
|
||||||
This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\
|
This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501
|
||||||
|
|
||||||
The version of the OpenAPI document: 1.0.0
|
The version of the OpenAPI document: 1.0.0
|
||||||
Generated by OpenAPI Generator (https://openapi-generator.tech)
|
Generated by: https://openapi-generator.tech
|
||||||
|
"""
|
||||||
|
|
||||||
Do not edit the class manually.
|
|
||||||
""" # noqa: E501
|
|
||||||
|
|
||||||
|
from __future__ import absolute_import
|
||||||
|
|
||||||
import unittest
|
import unittest
|
||||||
|
|
||||||
|
import petstore_api
|
||||||
from petstore_api.api.fake_classname_tags123_api import FakeClassnameTags123Api # noqa: E501
|
from petstore_api.api.fake_classname_tags123_api import FakeClassnameTags123Api # noqa: E501
|
||||||
|
from petstore_api.rest import ApiException
|
||||||
|
|
||||||
|
|
||||||
class TestFakeClassnameTags123Api(unittest.TestCase):
|
class TestFakeClassnameTags123Api(unittest.TestCase):
|
||||||
"""FakeClassnameTags123Api unit test stubs"""
|
"""FakeClassnameTags123Api unit test stubs"""
|
||||||
|
|
||||||
def setUp(self) -> None:
|
def setUp(self):
|
||||||
self.api = FakeClassnameTags123Api() # noqa: E501
|
self.api = petstore_api.api.fake_classname_tags123_api.FakeClassnameTags123Api() # noqa: E501
|
||||||
|
|
||||||
def tearDown(self) -> None:
|
def tearDown(self):
|
||||||
pass
|
pass
|
||||||
|
|
||||||
def test_test_classname(self) -> None:
|
def test_test_classname(self):
|
||||||
"""Test case for test_classname
|
"""Test case for test_classname
|
||||||
|
|
||||||
To test class name in snake case # noqa: E501
|
To test class name in snake case # noqa: E501
|
||||||
|
@ -3,19 +3,21 @@
|
|||||||
"""
|
"""
|
||||||
OpenAPI Petstore
|
OpenAPI Petstore
|
||||||
|
|
||||||
This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\
|
This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501
|
||||||
|
|
||||||
The version of the OpenAPI document: 1.0.0
|
The version of the OpenAPI document: 1.0.0
|
||||||
Generated by OpenAPI Generator (https://openapi-generator.tech)
|
Generated by: https://openapi-generator.tech
|
||||||
|
"""
|
||||||
|
|
||||||
Do not edit the class manually.
|
|
||||||
""" # noqa: E501
|
|
||||||
|
|
||||||
|
from __future__ import absolute_import
|
||||||
|
|
||||||
import unittest
|
import unittest
|
||||||
import datetime
|
import datetime
|
||||||
|
|
||||||
|
import petstore_api
|
||||||
from petstore_api.models.file import File # noqa: E501
|
from petstore_api.models.file import File # noqa: E501
|
||||||
|
from petstore_api.rest import ApiException
|
||||||
|
|
||||||
class TestFile(unittest.TestCase):
|
class TestFile(unittest.TestCase):
|
||||||
"""File unit test stubs"""
|
"""File unit test stubs"""
|
||||||
@ -26,22 +28,19 @@ class TestFile(unittest.TestCase):
|
|||||||
def tearDown(self):
|
def tearDown(self):
|
||||||
pass
|
pass
|
||||||
|
|
||||||
def make_instance(self, include_optional) -> File:
|
def make_instance(self, include_optional):
|
||||||
"""Test File
|
"""Test File
|
||||||
include_option is a boolean, when False only required
|
include_option is a boolean, when False only required
|
||||||
params are included, when True both required and
|
params are included, when True both required and
|
||||||
optional params are included """
|
optional params are included """
|
||||||
# uncomment below to create an instance of `File`
|
# model = petstore_api.models.file.File() # noqa: E501
|
||||||
"""
|
if include_optional :
|
||||||
model = File() # noqa: E501
|
|
||||||
if include_optional:
|
|
||||||
return File(
|
return File(
|
||||||
source_uri = ''
|
source_uri = ''
|
||||||
)
|
)
|
||||||
else:
|
else :
|
||||||
return File(
|
return File(
|
||||||
)
|
)
|
||||||
"""
|
|
||||||
|
|
||||||
def testFile(self):
|
def testFile(self):
|
||||||
"""Test File"""
|
"""Test File"""
|
||||||
|
@ -3,19 +3,21 @@
|
|||||||
"""
|
"""
|
||||||
OpenAPI Petstore
|
OpenAPI Petstore
|
||||||
|
|
||||||
This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\
|
This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501
|
||||||
|
|
||||||
The version of the OpenAPI document: 1.0.0
|
The version of the OpenAPI document: 1.0.0
|
||||||
Generated by OpenAPI Generator (https://openapi-generator.tech)
|
Generated by: https://openapi-generator.tech
|
||||||
|
"""
|
||||||
|
|
||||||
Do not edit the class manually.
|
|
||||||
""" # noqa: E501
|
|
||||||
|
|
||||||
|
from __future__ import absolute_import
|
||||||
|
|
||||||
import unittest
|
import unittest
|
||||||
import datetime
|
import datetime
|
||||||
|
|
||||||
|
import petstore_api
|
||||||
from petstore_api.models.file_schema_test_class import FileSchemaTestClass # noqa: E501
|
from petstore_api.models.file_schema_test_class import FileSchemaTestClass # noqa: E501
|
||||||
|
from petstore_api.rest import ApiException
|
||||||
|
|
||||||
class TestFileSchemaTestClass(unittest.TestCase):
|
class TestFileSchemaTestClass(unittest.TestCase):
|
||||||
"""FileSchemaTestClass unit test stubs"""
|
"""FileSchemaTestClass unit test stubs"""
|
||||||
@ -26,15 +28,13 @@ class TestFileSchemaTestClass(unittest.TestCase):
|
|||||||
def tearDown(self):
|
def tearDown(self):
|
||||||
pass
|
pass
|
||||||
|
|
||||||
def make_instance(self, include_optional) -> FileSchemaTestClass:
|
def make_instance(self, include_optional):
|
||||||
"""Test FileSchemaTestClass
|
"""Test FileSchemaTestClass
|
||||||
include_option is a boolean, when False only required
|
include_option is a boolean, when False only required
|
||||||
params are included, when True both required and
|
params are included, when True both required and
|
||||||
optional params are included """
|
optional params are included """
|
||||||
# uncomment below to create an instance of `FileSchemaTestClass`
|
# model = petstore_api.models.file_schema_test_class.FileSchemaTestClass() # noqa: E501
|
||||||
"""
|
if include_optional :
|
||||||
model = FileSchemaTestClass() # noqa: E501
|
|
||||||
if include_optional:
|
|
||||||
return FileSchemaTestClass(
|
return FileSchemaTestClass(
|
||||||
file = petstore_api.models.file.File(
|
file = petstore_api.models.file.File(
|
||||||
source_uri = '', ),
|
source_uri = '', ),
|
||||||
@ -43,10 +43,9 @@ class TestFileSchemaTestClass(unittest.TestCase):
|
|||||||
source_uri = '', )
|
source_uri = '', )
|
||||||
]
|
]
|
||||||
)
|
)
|
||||||
else:
|
else :
|
||||||
return FileSchemaTestClass(
|
return FileSchemaTestClass(
|
||||||
)
|
)
|
||||||
"""
|
|
||||||
|
|
||||||
def testFileSchemaTestClass(self):
|
def testFileSchemaTestClass(self):
|
||||||
"""Test FileSchemaTestClass"""
|
"""Test FileSchemaTestClass"""
|
||||||
|
@ -3,19 +3,23 @@
|
|||||||
"""
|
"""
|
||||||
OpenAPI Petstore
|
OpenAPI Petstore
|
||||||
|
|
||||||
This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\
|
This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501
|
||||||
|
|
||||||
The version of the OpenAPI document: 1.0.0
|
The version of the OpenAPI document: 1.0.0
|
||||||
Generated by OpenAPI Generator (https://openapi-generator.tech)
|
Generated by OpenAPI Generator (https://openapi-generator.tech)
|
||||||
|
|
||||||
Do not edit the class manually.
|
Do not edit the class manually.
|
||||||
""" # noqa: E501
|
"""
|
||||||
|
|
||||||
|
|
||||||
|
from __future__ import absolute_import
|
||||||
|
|
||||||
import unittest
|
import unittest
|
||||||
import datetime
|
import datetime
|
||||||
|
|
||||||
|
import petstore_api
|
||||||
from petstore_api.models.first_ref import FirstRef # noqa: E501
|
from petstore_api.models.first_ref import FirstRef # noqa: E501
|
||||||
|
from petstore_api.rest import ApiException
|
||||||
|
|
||||||
class TestFirstRef(unittest.TestCase):
|
class TestFirstRef(unittest.TestCase):
|
||||||
"""FirstRef unit test stubs"""
|
"""FirstRef unit test stubs"""
|
||||||
@ -26,15 +30,15 @@ class TestFirstRef(unittest.TestCase):
|
|||||||
def tearDown(self):
|
def tearDown(self):
|
||||||
pass
|
pass
|
||||||
|
|
||||||
def make_instance(self, include_optional) -> FirstRef:
|
def make_instance(self, include_optional):
|
||||||
"""Test FirstRef
|
"""Test FirstRef
|
||||||
include_option is a boolean, when False only required
|
include_option is a boolean, when False only required
|
||||||
params are included, when True both required and
|
params are included, when True both required and
|
||||||
optional params are included """
|
optional params are included """
|
||||||
# uncomment below to create an instance of `FirstRef`
|
# uncomment below to create an instance of `FirstRef`
|
||||||
"""
|
"""
|
||||||
model = FirstRef() # noqa: E501
|
model = petstore_api.models.first_ref.FirstRef() # noqa: E501
|
||||||
if include_optional:
|
if include_optional :
|
||||||
return FirstRef(
|
return FirstRef(
|
||||||
category = '',
|
category = '',
|
||||||
self_ref = petstore_api.models.second_ref.SecondRef(
|
self_ref = petstore_api.models.second_ref.SecondRef(
|
||||||
@ -44,7 +48,7 @@ class TestFirstRef(unittest.TestCase):
|
|||||||
nested = petstore_api.models.first_ref.FirstRef(
|
nested = petstore_api.models.first_ref.FirstRef(
|
||||||
category = '', ), ), )
|
category = '', ), ), )
|
||||||
)
|
)
|
||||||
else:
|
else :
|
||||||
return FirstRef(
|
return FirstRef(
|
||||||
)
|
)
|
||||||
"""
|
"""
|
||||||
|
@ -3,19 +3,21 @@
|
|||||||
"""
|
"""
|
||||||
OpenAPI Petstore
|
OpenAPI Petstore
|
||||||
|
|
||||||
This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\
|
This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501
|
||||||
|
|
||||||
The version of the OpenAPI document: 1.0.0
|
The version of the OpenAPI document: 1.0.0
|
||||||
Generated by OpenAPI Generator (https://openapi-generator.tech)
|
Generated by: https://openapi-generator.tech
|
||||||
|
"""
|
||||||
|
|
||||||
Do not edit the class manually.
|
|
||||||
""" # noqa: E501
|
|
||||||
|
|
||||||
|
from __future__ import absolute_import
|
||||||
|
|
||||||
import unittest
|
import unittest
|
||||||
import datetime
|
import datetime
|
||||||
|
|
||||||
|
import petstore_api
|
||||||
from petstore_api.models.foo import Foo # noqa: E501
|
from petstore_api.models.foo import Foo # noqa: E501
|
||||||
|
from petstore_api.rest import ApiException
|
||||||
|
|
||||||
class TestFoo(unittest.TestCase):
|
class TestFoo(unittest.TestCase):
|
||||||
"""Foo unit test stubs"""
|
"""Foo unit test stubs"""
|
||||||
@ -26,22 +28,19 @@ class TestFoo(unittest.TestCase):
|
|||||||
def tearDown(self):
|
def tearDown(self):
|
||||||
pass
|
pass
|
||||||
|
|
||||||
def make_instance(self, include_optional) -> Foo:
|
def make_instance(self, include_optional):
|
||||||
"""Test Foo
|
"""Test Foo
|
||||||
include_option is a boolean, when False only required
|
include_option is a boolean, when False only required
|
||||||
params are included, when True both required and
|
params are included, when True both required and
|
||||||
optional params are included """
|
optional params are included """
|
||||||
# uncomment below to create an instance of `Foo`
|
# model = petstore_api.models.foo.Foo() # noqa: E501
|
||||||
"""
|
if include_optional :
|
||||||
model = Foo() # noqa: E501
|
|
||||||
if include_optional:
|
|
||||||
return Foo(
|
return Foo(
|
||||||
bar = 'bar'
|
bar = 'bar'
|
||||||
)
|
)
|
||||||
else:
|
else :
|
||||||
return Foo(
|
return Foo(
|
||||||
)
|
)
|
||||||
"""
|
|
||||||
|
|
||||||
def testFoo(self):
|
def testFoo(self):
|
||||||
"""Test Foo"""
|
"""Test Foo"""
|
||||||
|
@ -3,19 +3,21 @@
|
|||||||
"""
|
"""
|
||||||
OpenAPI Petstore
|
OpenAPI Petstore
|
||||||
|
|
||||||
This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\
|
This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501
|
||||||
|
|
||||||
The version of the OpenAPI document: 1.0.0
|
The version of the OpenAPI document: 1.0.0
|
||||||
Generated by OpenAPI Generator (https://openapi-generator.tech)
|
Generated by: https://openapi-generator.tech
|
||||||
|
"""
|
||||||
|
|
||||||
Do not edit the class manually.
|
|
||||||
""" # noqa: E501
|
|
||||||
|
|
||||||
|
from __future__ import absolute_import
|
||||||
|
|
||||||
import unittest
|
import unittest
|
||||||
import datetime
|
import datetime
|
||||||
|
|
||||||
|
import petstore_api
|
||||||
from petstore_api.models.foo_get_default_response import FooGetDefaultResponse # noqa: E501
|
from petstore_api.models.foo_get_default_response import FooGetDefaultResponse # noqa: E501
|
||||||
|
from petstore_api.rest import ApiException
|
||||||
|
|
||||||
class TestFooGetDefaultResponse(unittest.TestCase):
|
class TestFooGetDefaultResponse(unittest.TestCase):
|
||||||
"""FooGetDefaultResponse unit test stubs"""
|
"""FooGetDefaultResponse unit test stubs"""
|
||||||
@ -26,23 +28,20 @@ class TestFooGetDefaultResponse(unittest.TestCase):
|
|||||||
def tearDown(self):
|
def tearDown(self):
|
||||||
pass
|
pass
|
||||||
|
|
||||||
def make_instance(self, include_optional) -> FooGetDefaultResponse:
|
def make_instance(self, include_optional):
|
||||||
"""Test FooGetDefaultResponse
|
"""Test FooGetDefaultResponse
|
||||||
include_option is a boolean, when False only required
|
include_option is a boolean, when False only required
|
||||||
params are included, when True both required and
|
params are included, when True both required and
|
||||||
optional params are included """
|
optional params are included """
|
||||||
# uncomment below to create an instance of `FooGetDefaultResponse`
|
# model = petstore_api.models.foo_get_default_response.FooGetDefaultResponse() # noqa: E501
|
||||||
"""
|
if include_optional :
|
||||||
model = FooGetDefaultResponse() # noqa: E501
|
|
||||||
if include_optional:
|
|
||||||
return FooGetDefaultResponse(
|
return FooGetDefaultResponse(
|
||||||
string = petstore_api.models.foo.Foo(
|
string = petstore_api.models.foo.Foo(
|
||||||
bar = 'bar', )
|
bar = 'bar', )
|
||||||
)
|
)
|
||||||
else:
|
else :
|
||||||
return FooGetDefaultResponse(
|
return FooGetDefaultResponse(
|
||||||
)
|
)
|
||||||
"""
|
|
||||||
|
|
||||||
def testFooGetDefaultResponse(self):
|
def testFooGetDefaultResponse(self):
|
||||||
"""Test FooGetDefaultResponse"""
|
"""Test FooGetDefaultResponse"""
|
||||||
|
@ -3,19 +3,21 @@
|
|||||||
"""
|
"""
|
||||||
OpenAPI Petstore
|
OpenAPI Petstore
|
||||||
|
|
||||||
This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\
|
This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501
|
||||||
|
|
||||||
The version of the OpenAPI document: 1.0.0
|
The version of the OpenAPI document: 1.0.0
|
||||||
Generated by OpenAPI Generator (https://openapi-generator.tech)
|
Generated by: https://openapi-generator.tech
|
||||||
|
"""
|
||||||
|
|
||||||
Do not edit the class manually.
|
|
||||||
""" # noqa: E501
|
|
||||||
|
|
||||||
|
from __future__ import absolute_import
|
||||||
|
|
||||||
import unittest
|
import unittest
|
||||||
import datetime
|
import datetime
|
||||||
|
|
||||||
|
import petstore_api
|
||||||
from petstore_api.models.format_test import FormatTest # noqa: E501
|
from petstore_api.models.format_test import FormatTest # noqa: E501
|
||||||
|
from petstore_api.rest import ApiException
|
||||||
|
|
||||||
class TestFormatTest(unittest.TestCase):
|
class TestFormatTest(unittest.TestCase):
|
||||||
"""FormatTest unit test stubs"""
|
"""FormatTest unit test stubs"""
|
||||||
@ -26,15 +28,13 @@ class TestFormatTest(unittest.TestCase):
|
|||||||
def tearDown(self):
|
def tearDown(self):
|
||||||
pass
|
pass
|
||||||
|
|
||||||
def make_instance(self, include_optional) -> FormatTest:
|
def make_instance(self, include_optional):
|
||||||
"""Test FormatTest
|
"""Test FormatTest
|
||||||
include_option is a boolean, when False only required
|
include_option is a boolean, when False only required
|
||||||
params are included, when True both required and
|
params are included, when True both required and
|
||||||
optional params are included """
|
optional params are included """
|
||||||
# uncomment below to create an instance of `FormatTest`
|
# model = petstore_api.models.format_test.FormatTest() # noqa: E501
|
||||||
"""
|
if include_optional :
|
||||||
model = FormatTest() # noqa: E501
|
|
||||||
if include_optional:
|
|
||||||
return FormatTest(
|
return FormatTest(
|
||||||
integer = 10,
|
integer = 10,
|
||||||
int32 = 20,
|
int32 = 20,
|
||||||
@ -42,25 +42,23 @@ class TestFormatTest(unittest.TestCase):
|
|||||||
number = 32.1,
|
number = 32.1,
|
||||||
float = 54.3,
|
float = 54.3,
|
||||||
double = 67.8,
|
double = 67.8,
|
||||||
decimal = 1,
|
|
||||||
string = 'a',
|
string = 'a',
|
||||||
string_with_double_quote_pattern = 'this is \"something\"',
|
|
||||||
byte = 'YQ==',
|
byte = 'YQ==',
|
||||||
binary = bytes(b'blah'),
|
binary = bytes(b'blah'),
|
||||||
var_date = datetime.datetime.strptime('1975-12-30', '%Y-%m-%d').date(),
|
_date = datetime.datetime.strptime('1975-12-30', '%Y-%m-%d').date(),
|
||||||
date_time = datetime.datetime.strptime('2013-10-20 19:20:30.00', '%Y-%m-%d %H:%M:%S.%f'),
|
date_time = datetime.datetime.strptime('2013-10-20 19:20:30.00', '%Y-%m-%d %H:%M:%S.%f'),
|
||||||
uuid = '72f98069-206d-4f12-9f12-3d1e525a8e84',
|
uuid = '72f98069-206d-4f12-9f12-3d1e525a8e84',
|
||||||
password = '0123456789',
|
password = '0123456789',
|
||||||
pattern_with_digits = '0480728880',
|
pattern_with_digits = '0480728880',
|
||||||
pattern_with_digits_and_delimiter = 'image_480'
|
pattern_with_digits_and_delimiter = 'image_480'
|
||||||
)
|
)
|
||||||
else:
|
else :
|
||||||
return FormatTest(
|
return FormatTest(
|
||||||
number = 32.1,
|
number = 32.1,
|
||||||
var_date = datetime.datetime.strptime('1975-12-30', '%Y-%m-%d').date(),
|
byte = 'YQ==',
|
||||||
|
_date = datetime.datetime.strptime('1975-12-30', '%Y-%m-%d').date(),
|
||||||
password = '0123456789',
|
password = '0123456789',
|
||||||
)
|
)
|
||||||
"""
|
|
||||||
|
|
||||||
def testFormatTest(self):
|
def testFormatTest(self):
|
||||||
"""Test FormatTest"""
|
"""Test FormatTest"""
|
||||||
|
@ -3,19 +3,21 @@
|
|||||||
"""
|
"""
|
||||||
OpenAPI Petstore
|
OpenAPI Petstore
|
||||||
|
|
||||||
This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\
|
This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501
|
||||||
|
|
||||||
The version of the OpenAPI document: 1.0.0
|
The version of the OpenAPI document: 1.0.0
|
||||||
Generated by OpenAPI Generator (https://openapi-generator.tech)
|
Generated by: https://openapi-generator.tech
|
||||||
|
"""
|
||||||
|
|
||||||
Do not edit the class manually.
|
|
||||||
""" # noqa: E501
|
|
||||||
|
|
||||||
|
from __future__ import absolute_import
|
||||||
|
|
||||||
import unittest
|
import unittest
|
||||||
import datetime
|
import datetime
|
||||||
|
|
||||||
|
import petstore_api
|
||||||
from petstore_api.models.has_only_read_only import HasOnlyReadOnly # noqa: E501
|
from petstore_api.models.has_only_read_only import HasOnlyReadOnly # noqa: E501
|
||||||
|
from petstore_api.rest import ApiException
|
||||||
|
|
||||||
class TestHasOnlyReadOnly(unittest.TestCase):
|
class TestHasOnlyReadOnly(unittest.TestCase):
|
||||||
"""HasOnlyReadOnly unit test stubs"""
|
"""HasOnlyReadOnly unit test stubs"""
|
||||||
@ -26,23 +28,20 @@ class TestHasOnlyReadOnly(unittest.TestCase):
|
|||||||
def tearDown(self):
|
def tearDown(self):
|
||||||
pass
|
pass
|
||||||
|
|
||||||
def make_instance(self, include_optional) -> HasOnlyReadOnly:
|
def make_instance(self, include_optional):
|
||||||
"""Test HasOnlyReadOnly
|
"""Test HasOnlyReadOnly
|
||||||
include_option is a boolean, when False only required
|
include_option is a boolean, when False only required
|
||||||
params are included, when True both required and
|
params are included, when True both required and
|
||||||
optional params are included """
|
optional params are included """
|
||||||
# uncomment below to create an instance of `HasOnlyReadOnly`
|
# model = petstore_api.models.has_only_read_only.HasOnlyReadOnly() # noqa: E501
|
||||||
"""
|
if include_optional :
|
||||||
model = HasOnlyReadOnly() # noqa: E501
|
|
||||||
if include_optional:
|
|
||||||
return HasOnlyReadOnly(
|
return HasOnlyReadOnly(
|
||||||
bar = '',
|
bar = '',
|
||||||
foo = ''
|
foo = ''
|
||||||
)
|
)
|
||||||
else:
|
else :
|
||||||
return HasOnlyReadOnly(
|
return HasOnlyReadOnly(
|
||||||
)
|
)
|
||||||
"""
|
|
||||||
|
|
||||||
def testHasOnlyReadOnly(self):
|
def testHasOnlyReadOnly(self):
|
||||||
"""Test HasOnlyReadOnly"""
|
"""Test HasOnlyReadOnly"""
|
||||||
|
@ -3,19 +3,21 @@
|
|||||||
"""
|
"""
|
||||||
OpenAPI Petstore
|
OpenAPI Petstore
|
||||||
|
|
||||||
This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\
|
This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501
|
||||||
|
|
||||||
The version of the OpenAPI document: 1.0.0
|
The version of the OpenAPI document: 1.0.0
|
||||||
Generated by OpenAPI Generator (https://openapi-generator.tech)
|
Generated by: https://openapi-generator.tech
|
||||||
|
"""
|
||||||
|
|
||||||
Do not edit the class manually.
|
|
||||||
""" # noqa: E501
|
|
||||||
|
|
||||||
|
from __future__ import absolute_import
|
||||||
|
|
||||||
import unittest
|
import unittest
|
||||||
import datetime
|
import datetime
|
||||||
|
|
||||||
|
import petstore_api
|
||||||
from petstore_api.models.health_check_result import HealthCheckResult # noqa: E501
|
from petstore_api.models.health_check_result import HealthCheckResult # noqa: E501
|
||||||
|
from petstore_api.rest import ApiException
|
||||||
|
|
||||||
class TestHealthCheckResult(unittest.TestCase):
|
class TestHealthCheckResult(unittest.TestCase):
|
||||||
"""HealthCheckResult unit test stubs"""
|
"""HealthCheckResult unit test stubs"""
|
||||||
@ -26,22 +28,19 @@ class TestHealthCheckResult(unittest.TestCase):
|
|||||||
def tearDown(self):
|
def tearDown(self):
|
||||||
pass
|
pass
|
||||||
|
|
||||||
def make_instance(self, include_optional) -> HealthCheckResult:
|
def make_instance(self, include_optional):
|
||||||
"""Test HealthCheckResult
|
"""Test HealthCheckResult
|
||||||
include_option is a boolean, when False only required
|
include_option is a boolean, when False only required
|
||||||
params are included, when True both required and
|
params are included, when True both required and
|
||||||
optional params are included """
|
optional params are included """
|
||||||
# uncomment below to create an instance of `HealthCheckResult`
|
# model = petstore_api.models.health_check_result.HealthCheckResult() # noqa: E501
|
||||||
"""
|
if include_optional :
|
||||||
model = HealthCheckResult() # noqa: E501
|
|
||||||
if include_optional:
|
|
||||||
return HealthCheckResult(
|
return HealthCheckResult(
|
||||||
nullable_message = ''
|
nullable_message = ''
|
||||||
)
|
)
|
||||||
else:
|
else :
|
||||||
return HealthCheckResult(
|
return HealthCheckResult(
|
||||||
)
|
)
|
||||||
"""
|
|
||||||
|
|
||||||
def testHealthCheckResult(self):
|
def testHealthCheckResult(self):
|
||||||
"""Test HealthCheckResult"""
|
"""Test HealthCheckResult"""
|
||||||
|
@ -3,19 +3,23 @@
|
|||||||
"""
|
"""
|
||||||
OpenAPI Petstore
|
OpenAPI Petstore
|
||||||
|
|
||||||
This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\
|
This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501
|
||||||
|
|
||||||
The version of the OpenAPI document: 1.0.0
|
The version of the OpenAPI document: 1.0.0
|
||||||
Generated by OpenAPI Generator (https://openapi-generator.tech)
|
Generated by OpenAPI Generator (https://openapi-generator.tech)
|
||||||
|
|
||||||
Do not edit the class manually.
|
Do not edit the class manually.
|
||||||
""" # noqa: E501
|
"""
|
||||||
|
|
||||||
|
|
||||||
|
from __future__ import absolute_import
|
||||||
|
|
||||||
import unittest
|
import unittest
|
||||||
import datetime
|
import datetime
|
||||||
|
|
||||||
|
import petstore_api
|
||||||
from petstore_api.models.inner_dict_with_property import InnerDictWithProperty # noqa: E501
|
from petstore_api.models.inner_dict_with_property import InnerDictWithProperty # noqa: E501
|
||||||
|
from petstore_api.rest import ApiException
|
||||||
|
|
||||||
class TestInnerDictWithProperty(unittest.TestCase):
|
class TestInnerDictWithProperty(unittest.TestCase):
|
||||||
"""InnerDictWithProperty unit test stubs"""
|
"""InnerDictWithProperty unit test stubs"""
|
||||||
@ -26,19 +30,19 @@ class TestInnerDictWithProperty(unittest.TestCase):
|
|||||||
def tearDown(self):
|
def tearDown(self):
|
||||||
pass
|
pass
|
||||||
|
|
||||||
def make_instance(self, include_optional) -> InnerDictWithProperty:
|
def make_instance(self, include_optional):
|
||||||
"""Test InnerDictWithProperty
|
"""Test InnerDictWithProperty
|
||||||
include_option is a boolean, when False only required
|
include_option is a boolean, when False only required
|
||||||
params are included, when True both required and
|
params are included, when True both required and
|
||||||
optional params are included """
|
optional params are included """
|
||||||
# uncomment below to create an instance of `InnerDictWithProperty`
|
# uncomment below to create an instance of `InnerDictWithProperty`
|
||||||
"""
|
"""
|
||||||
model = InnerDictWithProperty() # noqa: E501
|
model = petstore_api.models.inner_dict_with_property.InnerDictWithProperty() # noqa: E501
|
||||||
if include_optional:
|
if include_optional :
|
||||||
return InnerDictWithProperty(
|
return InnerDictWithProperty(
|
||||||
a_property = None
|
a_property = None
|
||||||
)
|
)
|
||||||
else:
|
else :
|
||||||
return InnerDictWithProperty(
|
return InnerDictWithProperty(
|
||||||
)
|
)
|
||||||
"""
|
"""
|
||||||
|
@ -3,19 +3,21 @@
|
|||||||
"""
|
"""
|
||||||
OpenAPI Petstore
|
OpenAPI Petstore
|
||||||
|
|
||||||
This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\
|
This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501
|
||||||
|
|
||||||
The version of the OpenAPI document: 1.0.0
|
The version of the OpenAPI document: 1.0.0
|
||||||
Generated by OpenAPI Generator (https://openapi-generator.tech)
|
Generated by OpenAPI Generator (https://openapi-generator.tech)
|
||||||
|
|
||||||
Do not edit the class manually.
|
Do not edit the class manually.
|
||||||
""" # noqa: E501
|
"""
|
||||||
|
|
||||||
|
|
||||||
import unittest
|
import unittest
|
||||||
import datetime
|
import datetime
|
||||||
|
|
||||||
|
import petstore_api
|
||||||
from petstore_api.models.int_or_string import IntOrString # noqa: E501
|
from petstore_api.models.int_or_string import IntOrString # noqa: E501
|
||||||
|
from petstore_api.rest import ApiException
|
||||||
|
|
||||||
class TestIntOrString(unittest.TestCase):
|
class TestIntOrString(unittest.TestCase):
|
||||||
"""IntOrString unit test stubs"""
|
"""IntOrString unit test stubs"""
|
||||||
@ -26,18 +28,18 @@ class TestIntOrString(unittest.TestCase):
|
|||||||
def tearDown(self):
|
def tearDown(self):
|
||||||
pass
|
pass
|
||||||
|
|
||||||
def make_instance(self, include_optional) -> IntOrString:
|
def make_instance(self, include_optional):
|
||||||
"""Test IntOrString
|
"""Test IntOrString
|
||||||
include_option is a boolean, when False only required
|
include_option is a boolean, when False only required
|
||||||
params are included, when True both required and
|
params are included, when True both required and
|
||||||
optional params are included """
|
optional params are included """
|
||||||
# uncomment below to create an instance of `IntOrString`
|
# uncomment below to create an instance of `IntOrString`
|
||||||
"""
|
"""
|
||||||
model = IntOrString() # noqa: E501
|
model = petstore_api.models.int_or_string.IntOrString() # noqa: E501
|
||||||
if include_optional:
|
if include_optional :
|
||||||
return IntOrString(
|
return IntOrString(
|
||||||
)
|
)
|
||||||
else:
|
else :
|
||||||
return IntOrString(
|
return IntOrString(
|
||||||
)
|
)
|
||||||
"""
|
"""
|
||||||
|
@ -3,19 +3,21 @@
|
|||||||
"""
|
"""
|
||||||
OpenAPI Petstore
|
OpenAPI Petstore
|
||||||
|
|
||||||
This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\
|
This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501
|
||||||
|
|
||||||
The version of the OpenAPI document: 1.0.0
|
The version of the OpenAPI document: 1.0.0
|
||||||
Generated by OpenAPI Generator (https://openapi-generator.tech)
|
Generated by: https://openapi-generator.tech
|
||||||
|
"""
|
||||||
|
|
||||||
Do not edit the class manually.
|
|
||||||
""" # noqa: E501
|
|
||||||
|
|
||||||
|
from __future__ import absolute_import
|
||||||
|
|
||||||
import unittest
|
import unittest
|
||||||
import datetime
|
import datetime
|
||||||
|
|
||||||
|
import petstore_api
|
||||||
from petstore_api.models.list import List # noqa: E501
|
from petstore_api.models.list import List # noqa: E501
|
||||||
|
from petstore_api.rest import ApiException
|
||||||
|
|
||||||
class TestList(unittest.TestCase):
|
class TestList(unittest.TestCase):
|
||||||
"""List unit test stubs"""
|
"""List unit test stubs"""
|
||||||
@ -26,22 +28,19 @@ class TestList(unittest.TestCase):
|
|||||||
def tearDown(self):
|
def tearDown(self):
|
||||||
pass
|
pass
|
||||||
|
|
||||||
def make_instance(self, include_optional) -> List:
|
def make_instance(self, include_optional):
|
||||||
"""Test List
|
"""Test List
|
||||||
include_option is a boolean, when False only required
|
include_option is a boolean, when False only required
|
||||||
params are included, when True both required and
|
params are included, when True both required and
|
||||||
optional params are included """
|
optional params are included """
|
||||||
# uncomment below to create an instance of `List`
|
# model = petstore_api.models.list.List() # noqa: E501
|
||||||
"""
|
if include_optional :
|
||||||
model = List() # noqa: E501
|
|
||||||
if include_optional:
|
|
||||||
return List(
|
return List(
|
||||||
var_123_list = ''
|
_123_list = ''
|
||||||
)
|
)
|
||||||
else:
|
else :
|
||||||
return List(
|
return List(
|
||||||
)
|
)
|
||||||
"""
|
|
||||||
|
|
||||||
def testList(self):
|
def testList(self):
|
||||||
"""Test List"""
|
"""Test List"""
|
||||||
|
@ -3,19 +3,21 @@
|
|||||||
"""
|
"""
|
||||||
OpenAPI Petstore
|
OpenAPI Petstore
|
||||||
|
|
||||||
This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\
|
This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501
|
||||||
|
|
||||||
The version of the OpenAPI document: 1.0.0
|
The version of the OpenAPI document: 1.0.0
|
||||||
Generated by OpenAPI Generator (https://openapi-generator.tech)
|
Generated by OpenAPI Generator (https://openapi-generator.tech)
|
||||||
|
|
||||||
Do not edit the class manually.
|
Do not edit the class manually.
|
||||||
""" # noqa: E501
|
"""
|
||||||
|
|
||||||
|
|
||||||
import unittest
|
import unittest
|
||||||
import datetime
|
import datetime
|
||||||
|
|
||||||
|
import petstore_api
|
||||||
from petstore_api.models.map_of_array_of_model import MapOfArrayOfModel # noqa: E501
|
from petstore_api.models.map_of_array_of_model import MapOfArrayOfModel # noqa: E501
|
||||||
|
from petstore_api.rest import ApiException
|
||||||
|
|
||||||
class TestMapOfArrayOfModel(unittest.TestCase):
|
class TestMapOfArrayOfModel(unittest.TestCase):
|
||||||
"""MapOfArrayOfModel unit test stubs"""
|
"""MapOfArrayOfModel unit test stubs"""
|
||||||
@ -26,15 +28,15 @@ class TestMapOfArrayOfModel(unittest.TestCase):
|
|||||||
def tearDown(self):
|
def tearDown(self):
|
||||||
pass
|
pass
|
||||||
|
|
||||||
def make_instance(self, include_optional) -> MapOfArrayOfModel:
|
def make_instance(self, include_optional):
|
||||||
"""Test MapOfArrayOfModel
|
"""Test MapOfArrayOfModel
|
||||||
include_option is a boolean, when False only required
|
include_option is a boolean, when False only required
|
||||||
params are included, when True both required and
|
params are included, when True both required and
|
||||||
optional params are included """
|
optional params are included """
|
||||||
# uncomment below to create an instance of `MapOfArrayOfModel`
|
# uncomment below to create an instance of `MapOfArrayOfModel`
|
||||||
"""
|
"""
|
||||||
model = MapOfArrayOfModel() # noqa: E501
|
model = petstore_api.models.map_of_array_of_model.MapOfArrayOfModel() # noqa: E501
|
||||||
if include_optional:
|
if include_optional :
|
||||||
return MapOfArrayOfModel(
|
return MapOfArrayOfModel(
|
||||||
shop_id_to_org_online_lip_map = {
|
shop_id_to_org_online_lip_map = {
|
||||||
'key' : [
|
'key' : [
|
||||||
@ -44,7 +46,7 @@ class TestMapOfArrayOfModel(unittest.TestCase):
|
|||||||
]
|
]
|
||||||
}
|
}
|
||||||
)
|
)
|
||||||
else:
|
else :
|
||||||
return MapOfArrayOfModel(
|
return MapOfArrayOfModel(
|
||||||
)
|
)
|
||||||
"""
|
"""
|
||||||
|
@ -3,19 +3,21 @@
|
|||||||
"""
|
"""
|
||||||
OpenAPI Petstore
|
OpenAPI Petstore
|
||||||
|
|
||||||
This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\
|
This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501
|
||||||
|
|
||||||
The version of the OpenAPI document: 1.0.0
|
The version of the OpenAPI document: 1.0.0
|
||||||
Generated by OpenAPI Generator (https://openapi-generator.tech)
|
Generated by: https://openapi-generator.tech
|
||||||
|
"""
|
||||||
|
|
||||||
Do not edit the class manually.
|
|
||||||
""" # noqa: E501
|
|
||||||
|
|
||||||
|
from __future__ import absolute_import
|
||||||
|
|
||||||
import unittest
|
import unittest
|
||||||
import datetime
|
import datetime
|
||||||
|
|
||||||
|
import petstore_api
|
||||||
from petstore_api.models.map_test import MapTest # noqa: E501
|
from petstore_api.models.map_test import MapTest # noqa: E501
|
||||||
|
from petstore_api.rest import ApiException
|
||||||
|
|
||||||
class TestMapTest(unittest.TestCase):
|
class TestMapTest(unittest.TestCase):
|
||||||
"""MapTest unit test stubs"""
|
"""MapTest unit test stubs"""
|
||||||
@ -26,15 +28,13 @@ class TestMapTest(unittest.TestCase):
|
|||||||
def tearDown(self):
|
def tearDown(self):
|
||||||
pass
|
pass
|
||||||
|
|
||||||
def make_instance(self, include_optional) -> MapTest:
|
def make_instance(self, include_optional):
|
||||||
"""Test MapTest
|
"""Test MapTest
|
||||||
include_option is a boolean, when False only required
|
include_option is a boolean, when False only required
|
||||||
params are included, when True both required and
|
params are included, when True both required and
|
||||||
optional params are included """
|
optional params are included """
|
||||||
# uncomment below to create an instance of `MapTest`
|
# model = petstore_api.models.map_test.MapTest() # noqa: E501
|
||||||
"""
|
if include_optional :
|
||||||
model = MapTest() # noqa: E501
|
|
||||||
if include_optional:
|
|
||||||
return MapTest(
|
return MapTest(
|
||||||
map_map_of_string = {
|
map_map_of_string = {
|
||||||
'key' : {
|
'key' : {
|
||||||
@ -51,10 +51,9 @@ class TestMapTest(unittest.TestCase):
|
|||||||
'key' : True
|
'key' : True
|
||||||
}
|
}
|
||||||
)
|
)
|
||||||
else:
|
else :
|
||||||
return MapTest(
|
return MapTest(
|
||||||
)
|
)
|
||||||
"""
|
|
||||||
|
|
||||||
def testMapTest(self):
|
def testMapTest(self):
|
||||||
"""Test MapTest"""
|
"""Test MapTest"""
|
||||||
|
@ -3,19 +3,21 @@
|
|||||||
"""
|
"""
|
||||||
OpenAPI Petstore
|
OpenAPI Petstore
|
||||||
|
|
||||||
This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\
|
This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501
|
||||||
|
|
||||||
The version of the OpenAPI document: 1.0.0
|
The version of the OpenAPI document: 1.0.0
|
||||||
Generated by OpenAPI Generator (https://openapi-generator.tech)
|
Generated by: https://openapi-generator.tech
|
||||||
|
"""
|
||||||
|
|
||||||
Do not edit the class manually.
|
|
||||||
""" # noqa: E501
|
|
||||||
|
|
||||||
|
from __future__ import absolute_import
|
||||||
|
|
||||||
import unittest
|
import unittest
|
||||||
import datetime
|
import datetime
|
||||||
|
|
||||||
|
import petstore_api
|
||||||
from petstore_api.models.mixed_properties_and_additional_properties_class import MixedPropertiesAndAdditionalPropertiesClass # noqa: E501
|
from petstore_api.models.mixed_properties_and_additional_properties_class import MixedPropertiesAndAdditionalPropertiesClass # noqa: E501
|
||||||
|
from petstore_api.rest import ApiException
|
||||||
|
|
||||||
class TestMixedPropertiesAndAdditionalPropertiesClass(unittest.TestCase):
|
class TestMixedPropertiesAndAdditionalPropertiesClass(unittest.TestCase):
|
||||||
"""MixedPropertiesAndAdditionalPropertiesClass unit test stubs"""
|
"""MixedPropertiesAndAdditionalPropertiesClass unit test stubs"""
|
||||||
@ -26,15 +28,13 @@ class TestMixedPropertiesAndAdditionalPropertiesClass(unittest.TestCase):
|
|||||||
def tearDown(self):
|
def tearDown(self):
|
||||||
pass
|
pass
|
||||||
|
|
||||||
def make_instance(self, include_optional) -> MixedPropertiesAndAdditionalPropertiesClass:
|
def make_instance(self, include_optional):
|
||||||
"""Test MixedPropertiesAndAdditionalPropertiesClass
|
"""Test MixedPropertiesAndAdditionalPropertiesClass
|
||||||
include_option is a boolean, when False only required
|
include_option is a boolean, when False only required
|
||||||
params are included, when True both required and
|
params are included, when True both required and
|
||||||
optional params are included """
|
optional params are included """
|
||||||
# uncomment below to create an instance of `MixedPropertiesAndAdditionalPropertiesClass`
|
# model = petstore_api.models.mixed_properties_and_additional_properties_class.MixedPropertiesAndAdditionalPropertiesClass() # noqa: E501
|
||||||
"""
|
if include_optional :
|
||||||
model = MixedPropertiesAndAdditionalPropertiesClass() # noqa: E501
|
|
||||||
if include_optional:
|
|
||||||
return MixedPropertiesAndAdditionalPropertiesClass(
|
return MixedPropertiesAndAdditionalPropertiesClass(
|
||||||
uuid = '',
|
uuid = '',
|
||||||
date_time = datetime.datetime.strptime('2013-10-20 19:20:30.00', '%Y-%m-%d %H:%M:%S.%f'),
|
date_time = datetime.datetime.strptime('2013-10-20 19:20:30.00', '%Y-%m-%d %H:%M:%S.%f'),
|
||||||
@ -44,10 +44,9 @@ class TestMixedPropertiesAndAdditionalPropertiesClass(unittest.TestCase):
|
|||||||
color = 'red', )
|
color = 'red', )
|
||||||
}
|
}
|
||||||
)
|
)
|
||||||
else:
|
else :
|
||||||
return MixedPropertiesAndAdditionalPropertiesClass(
|
return MixedPropertiesAndAdditionalPropertiesClass(
|
||||||
)
|
)
|
||||||
"""
|
|
||||||
|
|
||||||
def testMixedPropertiesAndAdditionalPropertiesClass(self):
|
def testMixedPropertiesAndAdditionalPropertiesClass(self):
|
||||||
"""Test MixedPropertiesAndAdditionalPropertiesClass"""
|
"""Test MixedPropertiesAndAdditionalPropertiesClass"""
|
||||||
|
@ -3,19 +3,21 @@
|
|||||||
"""
|
"""
|
||||||
OpenAPI Petstore
|
OpenAPI Petstore
|
||||||
|
|
||||||
This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\
|
This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501
|
||||||
|
|
||||||
The version of the OpenAPI document: 1.0.0
|
The version of the OpenAPI document: 1.0.0
|
||||||
Generated by OpenAPI Generator (https://openapi-generator.tech)
|
Generated by: https://openapi-generator.tech
|
||||||
|
"""
|
||||||
|
|
||||||
Do not edit the class manually.
|
|
||||||
""" # noqa: E501
|
|
||||||
|
|
||||||
|
from __future__ import absolute_import
|
||||||
|
|
||||||
import unittest
|
import unittest
|
||||||
import datetime
|
import datetime
|
||||||
|
|
||||||
|
import petstore_api
|
||||||
from petstore_api.models.model200_response import Model200Response # noqa: E501
|
from petstore_api.models.model200_response import Model200Response # noqa: E501
|
||||||
|
from petstore_api.rest import ApiException
|
||||||
|
|
||||||
class TestModel200Response(unittest.TestCase):
|
class TestModel200Response(unittest.TestCase):
|
||||||
"""Model200Response unit test stubs"""
|
"""Model200Response unit test stubs"""
|
||||||
@ -26,23 +28,20 @@ class TestModel200Response(unittest.TestCase):
|
|||||||
def tearDown(self):
|
def tearDown(self):
|
||||||
pass
|
pass
|
||||||
|
|
||||||
def make_instance(self, include_optional) -> Model200Response:
|
def make_instance(self, include_optional):
|
||||||
"""Test Model200Response
|
"""Test Model200Response
|
||||||
include_option is a boolean, when False only required
|
include_option is a boolean, when False only required
|
||||||
params are included, when True both required and
|
params are included, when True both required and
|
||||||
optional params are included """
|
optional params are included """
|
||||||
# uncomment below to create an instance of `Model200Response`
|
# model = petstore_api.models.model200_response.Model200Response() # noqa: E501
|
||||||
"""
|
if include_optional :
|
||||||
model = Model200Response() # noqa: E501
|
|
||||||
if include_optional:
|
|
||||||
return Model200Response(
|
return Model200Response(
|
||||||
name = 56,
|
name = 56,
|
||||||
var_class = ''
|
_class = ''
|
||||||
)
|
)
|
||||||
else:
|
else :
|
||||||
return Model200Response(
|
return Model200Response(
|
||||||
)
|
)
|
||||||
"""
|
|
||||||
|
|
||||||
def testModel200Response(self):
|
def testModel200Response(self):
|
||||||
"""Test Model200Response"""
|
"""Test Model200Response"""
|
||||||
|
@ -3,19 +3,21 @@
|
|||||||
"""
|
"""
|
||||||
OpenAPI Petstore
|
OpenAPI Petstore
|
||||||
|
|
||||||
This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\
|
This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501
|
||||||
|
|
||||||
The version of the OpenAPI document: 1.0.0
|
The version of the OpenAPI document: 1.0.0
|
||||||
Generated by OpenAPI Generator (https://openapi-generator.tech)
|
Generated by: https://openapi-generator.tech
|
||||||
|
"""
|
||||||
|
|
||||||
Do not edit the class manually.
|
|
||||||
""" # noqa: E501
|
|
||||||
|
|
||||||
|
from __future__ import absolute_import
|
||||||
|
|
||||||
import unittest
|
import unittest
|
||||||
import datetime
|
import datetime
|
||||||
|
|
||||||
|
import petstore_api
|
||||||
from petstore_api.models.model_return import ModelReturn # noqa: E501
|
from petstore_api.models.model_return import ModelReturn # noqa: E501
|
||||||
|
from petstore_api.rest import ApiException
|
||||||
|
|
||||||
class TestModelReturn(unittest.TestCase):
|
class TestModelReturn(unittest.TestCase):
|
||||||
"""ModelReturn unit test stubs"""
|
"""ModelReturn unit test stubs"""
|
||||||
@ -26,22 +28,19 @@ class TestModelReturn(unittest.TestCase):
|
|||||||
def tearDown(self):
|
def tearDown(self):
|
||||||
pass
|
pass
|
||||||
|
|
||||||
def make_instance(self, include_optional) -> ModelReturn:
|
def make_instance(self, include_optional):
|
||||||
"""Test ModelReturn
|
"""Test ModelReturn
|
||||||
include_option is a boolean, when False only required
|
include_option is a boolean, when False only required
|
||||||
params are included, when True both required and
|
params are included, when True both required and
|
||||||
optional params are included """
|
optional params are included """
|
||||||
# uncomment below to create an instance of `ModelReturn`
|
# model = petstore_api.models.model_return.ModelReturn() # noqa: E501
|
||||||
"""
|
if include_optional :
|
||||||
model = ModelReturn() # noqa: E501
|
|
||||||
if include_optional:
|
|
||||||
return ModelReturn(
|
return ModelReturn(
|
||||||
var_return = 56
|
_return = 56
|
||||||
)
|
)
|
||||||
else:
|
else :
|
||||||
return ModelReturn(
|
return ModelReturn(
|
||||||
)
|
)
|
||||||
"""
|
|
||||||
|
|
||||||
def testModelReturn(self):
|
def testModelReturn(self):
|
||||||
"""Test ModelReturn"""
|
"""Test ModelReturn"""
|
||||||
|
@ -3,19 +3,21 @@
|
|||||||
"""
|
"""
|
||||||
OpenAPI Petstore
|
OpenAPI Petstore
|
||||||
|
|
||||||
This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\
|
This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501
|
||||||
|
|
||||||
The version of the OpenAPI document: 1.0.0
|
The version of the OpenAPI document: 1.0.0
|
||||||
Generated by OpenAPI Generator (https://openapi-generator.tech)
|
Generated by: https://openapi-generator.tech
|
||||||
|
"""
|
||||||
|
|
||||||
Do not edit the class manually.
|
|
||||||
""" # noqa: E501
|
|
||||||
|
|
||||||
|
from __future__ import absolute_import
|
||||||
|
|
||||||
import unittest
|
import unittest
|
||||||
import datetime
|
import datetime
|
||||||
|
|
||||||
|
import petstore_api
|
||||||
from petstore_api.models.name import Name # noqa: E501
|
from petstore_api.models.name import Name # noqa: E501
|
||||||
|
from petstore_api.rest import ApiException
|
||||||
|
|
||||||
class TestName(unittest.TestCase):
|
class TestName(unittest.TestCase):
|
||||||
"""Name unit test stubs"""
|
"""Name unit test stubs"""
|
||||||
@ -26,26 +28,23 @@ class TestName(unittest.TestCase):
|
|||||||
def tearDown(self):
|
def tearDown(self):
|
||||||
pass
|
pass
|
||||||
|
|
||||||
def make_instance(self, include_optional) -> Name:
|
def make_instance(self, include_optional):
|
||||||
"""Test Name
|
"""Test Name
|
||||||
include_option is a boolean, when False only required
|
include_option is a boolean, when False only required
|
||||||
params are included, when True both required and
|
params are included, when True both required and
|
||||||
optional params are included """
|
optional params are included """
|
||||||
# uncomment below to create an instance of `Name`
|
# model = petstore_api.models.name.Name() # noqa: E501
|
||||||
"""
|
if include_optional :
|
||||||
model = Name() # noqa: E501
|
|
||||||
if include_optional:
|
|
||||||
return Name(
|
return Name(
|
||||||
name = 56,
|
name = 56,
|
||||||
snake_case = 56,
|
snake_case = 56,
|
||||||
var_property = '',
|
_property = '',
|
||||||
var_123_number = 56
|
_123_number = 56
|
||||||
)
|
)
|
||||||
else:
|
else :
|
||||||
return Name(
|
return Name(
|
||||||
name = 56,
|
name = 56,
|
||||||
)
|
)
|
||||||
"""
|
|
||||||
|
|
||||||
def testName(self):
|
def testName(self):
|
||||||
"""Test Name"""
|
"""Test Name"""
|
||||||
|
@ -3,19 +3,21 @@
|
|||||||
"""
|
"""
|
||||||
OpenAPI Petstore
|
OpenAPI Petstore
|
||||||
|
|
||||||
This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\
|
This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501
|
||||||
|
|
||||||
The version of the OpenAPI document: 1.0.0
|
The version of the OpenAPI document: 1.0.0
|
||||||
Generated by OpenAPI Generator (https://openapi-generator.tech)
|
Generated by: https://openapi-generator.tech
|
||||||
|
"""
|
||||||
|
|
||||||
Do not edit the class manually.
|
|
||||||
""" # noqa: E501
|
|
||||||
|
|
||||||
|
from __future__ import absolute_import
|
||||||
|
|
||||||
import unittest
|
import unittest
|
||||||
import datetime
|
import datetime
|
||||||
|
|
||||||
|
import petstore_api
|
||||||
from petstore_api.models.nullable_class import NullableClass # noqa: E501
|
from petstore_api.models.nullable_class import NullableClass # noqa: E501
|
||||||
|
from petstore_api.rest import ApiException
|
||||||
|
|
||||||
class TestNullableClass(unittest.TestCase):
|
class TestNullableClass(unittest.TestCase):
|
||||||
"""NullableClass unit test stubs"""
|
"""NullableClass unit test stubs"""
|
||||||
@ -26,15 +28,13 @@ class TestNullableClass(unittest.TestCase):
|
|||||||
def tearDown(self):
|
def tearDown(self):
|
||||||
pass
|
pass
|
||||||
|
|
||||||
def make_instance(self, include_optional) -> NullableClass:
|
def make_instance(self, include_optional):
|
||||||
"""Test NullableClass
|
"""Test NullableClass
|
||||||
include_option is a boolean, when False only required
|
include_option is a boolean, when False only required
|
||||||
params are included, when True both required and
|
params are included, when True both required and
|
||||||
optional params are included """
|
optional params are included """
|
||||||
# uncomment below to create an instance of `NullableClass`
|
# model = petstore_api.models.nullable_class.NullableClass() # noqa: E501
|
||||||
"""
|
if include_optional :
|
||||||
model = NullableClass() # noqa: E501
|
|
||||||
if include_optional:
|
|
||||||
return NullableClass(
|
return NullableClass(
|
||||||
required_integer_prop = 56,
|
required_integer_prop = 56,
|
||||||
integer_prop = 56,
|
integer_prop = 56,
|
||||||
@ -62,11 +62,10 @@ class TestNullableClass(unittest.TestCase):
|
|||||||
'key' : None
|
'key' : None
|
||||||
}
|
}
|
||||||
)
|
)
|
||||||
else:
|
else :
|
||||||
return NullableClass(
|
return NullableClass(
|
||||||
required_integer_prop = 56,
|
required_integer_prop = 56,
|
||||||
)
|
)
|
||||||
"""
|
|
||||||
|
|
||||||
def testNullableClass(self):
|
def testNullableClass(self):
|
||||||
"""Test NullableClass"""
|
"""Test NullableClass"""
|
||||||
|
@ -3,19 +3,21 @@
|
|||||||
"""
|
"""
|
||||||
OpenAPI Petstore
|
OpenAPI Petstore
|
||||||
|
|
||||||
This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\
|
This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501
|
||||||
|
|
||||||
The version of the OpenAPI document: 1.0.0
|
The version of the OpenAPI document: 1.0.0
|
||||||
Generated by OpenAPI Generator (https://openapi-generator.tech)
|
Generated by OpenAPI Generator (https://openapi-generator.tech)
|
||||||
|
|
||||||
Do not edit the class manually.
|
Do not edit the class manually.
|
||||||
""" # noqa: E501
|
"""
|
||||||
|
|
||||||
|
|
||||||
import unittest
|
import unittest
|
||||||
import datetime
|
import datetime
|
||||||
|
|
||||||
|
import petstore_api
|
||||||
from petstore_api.models.nullable_property import NullableProperty # noqa: E501
|
from petstore_api.models.nullable_property import NullableProperty # noqa: E501
|
||||||
|
from petstore_api.rest import ApiException
|
||||||
|
|
||||||
class TestNullableProperty(unittest.TestCase):
|
class TestNullableProperty(unittest.TestCase):
|
||||||
"""NullableProperty unit test stubs"""
|
"""NullableProperty unit test stubs"""
|
||||||
@ -26,20 +28,20 @@ class TestNullableProperty(unittest.TestCase):
|
|||||||
def tearDown(self):
|
def tearDown(self):
|
||||||
pass
|
pass
|
||||||
|
|
||||||
def make_instance(self, include_optional) -> NullableProperty:
|
def make_instance(self, include_optional):
|
||||||
"""Test NullableProperty
|
"""Test NullableProperty
|
||||||
include_option is a boolean, when False only required
|
include_option is a boolean, when False only required
|
||||||
params are included, when True both required and
|
params are included, when True both required and
|
||||||
optional params are included """
|
optional params are included """
|
||||||
# uncomment below to create an instance of `NullableProperty`
|
# uncomment below to create an instance of `NullableProperty`
|
||||||
"""
|
"""
|
||||||
model = NullableProperty() # noqa: E501
|
model = petstore_api.models.nullable_property.NullableProperty() # noqa: E501
|
||||||
if include_optional:
|
if include_optional :
|
||||||
return NullableProperty(
|
return NullableProperty(
|
||||||
id = 56,
|
id = 56,
|
||||||
name = 'AUR,rZ#UM/?R,Fp^l6$ARjbhJk C>'
|
name = 'AUR,rZ#UM/?R,Fp^l6$ARjbhJk C>'
|
||||||
)
|
)
|
||||||
else:
|
else :
|
||||||
return NullableProperty(
|
return NullableProperty(
|
||||||
id = 56,
|
id = 56,
|
||||||
name = 'AUR,rZ#UM/?R,Fp^l6$ARjbhJk C>',
|
name = 'AUR,rZ#UM/?R,Fp^l6$ARjbhJk C>',
|
||||||
|
@ -3,19 +3,21 @@
|
|||||||
"""
|
"""
|
||||||
OpenAPI Petstore
|
OpenAPI Petstore
|
||||||
|
|
||||||
This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\
|
This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501
|
||||||
|
|
||||||
The version of the OpenAPI document: 1.0.0
|
The version of the OpenAPI document: 1.0.0
|
||||||
Generated by OpenAPI Generator (https://openapi-generator.tech)
|
Generated by: https://openapi-generator.tech
|
||||||
|
"""
|
||||||
|
|
||||||
Do not edit the class manually.
|
|
||||||
""" # noqa: E501
|
|
||||||
|
|
||||||
|
from __future__ import absolute_import
|
||||||
|
|
||||||
import unittest
|
import unittest
|
||||||
import datetime
|
import datetime
|
||||||
|
|
||||||
|
import petstore_api
|
||||||
from petstore_api.models.number_only import NumberOnly # noqa: E501
|
from petstore_api.models.number_only import NumberOnly # noqa: E501
|
||||||
|
from petstore_api.rest import ApiException
|
||||||
|
|
||||||
class TestNumberOnly(unittest.TestCase):
|
class TestNumberOnly(unittest.TestCase):
|
||||||
"""NumberOnly unit test stubs"""
|
"""NumberOnly unit test stubs"""
|
||||||
@ -26,22 +28,19 @@ class TestNumberOnly(unittest.TestCase):
|
|||||||
def tearDown(self):
|
def tearDown(self):
|
||||||
pass
|
pass
|
||||||
|
|
||||||
def make_instance(self, include_optional) -> NumberOnly:
|
def make_instance(self, include_optional):
|
||||||
"""Test NumberOnly
|
"""Test NumberOnly
|
||||||
include_option is a boolean, when False only required
|
include_option is a boolean, when False only required
|
||||||
params are included, when True both required and
|
params are included, when True both required and
|
||||||
optional params are included """
|
optional params are included """
|
||||||
# uncomment below to create an instance of `NumberOnly`
|
# model = petstore_api.models.number_only.NumberOnly() # noqa: E501
|
||||||
"""
|
if include_optional :
|
||||||
model = NumberOnly() # noqa: E501
|
|
||||||
if include_optional:
|
|
||||||
return NumberOnly(
|
return NumberOnly(
|
||||||
just_number = 1.337
|
just_number = 1.337
|
||||||
)
|
)
|
||||||
else:
|
else :
|
||||||
return NumberOnly(
|
return NumberOnly(
|
||||||
)
|
)
|
||||||
"""
|
|
||||||
|
|
||||||
def testNumberOnly(self):
|
def testNumberOnly(self):
|
||||||
"""Test NumberOnly"""
|
"""Test NumberOnly"""
|
||||||
|
@ -3,19 +3,21 @@
|
|||||||
"""
|
"""
|
||||||
OpenAPI Petstore
|
OpenAPI Petstore
|
||||||
|
|
||||||
This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\
|
This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501
|
||||||
|
|
||||||
The version of the OpenAPI document: 1.0.0
|
The version of the OpenAPI document: 1.0.0
|
||||||
Generated by OpenAPI Generator (https://openapi-generator.tech)
|
Generated by OpenAPI Generator (https://openapi-generator.tech)
|
||||||
|
|
||||||
Do not edit the class manually.
|
Do not edit the class manually.
|
||||||
""" # noqa: E501
|
"""
|
||||||
|
|
||||||
|
|
||||||
import unittest
|
import unittest
|
||||||
import datetime
|
import datetime
|
||||||
|
|
||||||
|
import petstore_api
|
||||||
from petstore_api.models.object_to_test_additional_properties import ObjectToTestAdditionalProperties # noqa: E501
|
from petstore_api.models.object_to_test_additional_properties import ObjectToTestAdditionalProperties # noqa: E501
|
||||||
|
from petstore_api.rest import ApiException
|
||||||
|
|
||||||
class TestObjectToTestAdditionalProperties(unittest.TestCase):
|
class TestObjectToTestAdditionalProperties(unittest.TestCase):
|
||||||
"""ObjectToTestAdditionalProperties unit test stubs"""
|
"""ObjectToTestAdditionalProperties unit test stubs"""
|
||||||
@ -26,19 +28,19 @@ class TestObjectToTestAdditionalProperties(unittest.TestCase):
|
|||||||
def tearDown(self):
|
def tearDown(self):
|
||||||
pass
|
pass
|
||||||
|
|
||||||
def make_instance(self, include_optional) -> ObjectToTestAdditionalProperties:
|
def make_instance(self, include_optional):
|
||||||
"""Test ObjectToTestAdditionalProperties
|
"""Test ObjectToTestAdditionalProperties
|
||||||
include_option is a boolean, when False only required
|
include_option is a boolean, when False only required
|
||||||
params are included, when True both required and
|
params are included, when True both required and
|
||||||
optional params are included """
|
optional params are included """
|
||||||
# uncomment below to create an instance of `ObjectToTestAdditionalProperties`
|
# uncomment below to create an instance of `ObjectToTestAdditionalProperties`
|
||||||
"""
|
"""
|
||||||
model = ObjectToTestAdditionalProperties() # noqa: E501
|
model = petstore_api.models.object_to_test_additional_properties.ObjectToTestAdditionalProperties() # noqa: E501
|
||||||
if include_optional:
|
if include_optional :
|
||||||
return ObjectToTestAdditionalProperties(
|
return ObjectToTestAdditionalProperties(
|
||||||
var_property = True
|
var_property = True
|
||||||
)
|
)
|
||||||
else:
|
else :
|
||||||
return ObjectToTestAdditionalProperties(
|
return ObjectToTestAdditionalProperties(
|
||||||
)
|
)
|
||||||
"""
|
"""
|
||||||
|
@ -3,19 +3,21 @@
|
|||||||
"""
|
"""
|
||||||
OpenAPI Petstore
|
OpenAPI Petstore
|
||||||
|
|
||||||
This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\
|
This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501
|
||||||
|
|
||||||
The version of the OpenAPI document: 1.0.0
|
The version of the OpenAPI document: 1.0.0
|
||||||
Generated by OpenAPI Generator (https://openapi-generator.tech)
|
Generated by: https://openapi-generator.tech
|
||||||
|
"""
|
||||||
|
|
||||||
Do not edit the class manually.
|
|
||||||
""" # noqa: E501
|
|
||||||
|
|
||||||
|
from __future__ import absolute_import
|
||||||
|
|
||||||
import unittest
|
import unittest
|
||||||
import datetime
|
import datetime
|
||||||
|
|
||||||
|
import petstore_api
|
||||||
from petstore_api.models.object_with_deprecated_fields import ObjectWithDeprecatedFields # noqa: E501
|
from petstore_api.models.object_with_deprecated_fields import ObjectWithDeprecatedFields # noqa: E501
|
||||||
|
from petstore_api.rest import ApiException
|
||||||
|
|
||||||
class TestObjectWithDeprecatedFields(unittest.TestCase):
|
class TestObjectWithDeprecatedFields(unittest.TestCase):
|
||||||
"""ObjectWithDeprecatedFields unit test stubs"""
|
"""ObjectWithDeprecatedFields unit test stubs"""
|
||||||
@ -26,15 +28,13 @@ class TestObjectWithDeprecatedFields(unittest.TestCase):
|
|||||||
def tearDown(self):
|
def tearDown(self):
|
||||||
pass
|
pass
|
||||||
|
|
||||||
def make_instance(self, include_optional) -> ObjectWithDeprecatedFields:
|
def make_instance(self, include_optional):
|
||||||
"""Test ObjectWithDeprecatedFields
|
"""Test ObjectWithDeprecatedFields
|
||||||
include_option is a boolean, when False only required
|
include_option is a boolean, when False only required
|
||||||
params are included, when True both required and
|
params are included, when True both required and
|
||||||
optional params are included """
|
optional params are included """
|
||||||
# uncomment below to create an instance of `ObjectWithDeprecatedFields`
|
# model = petstore_api.models.object_with_deprecated_fields.ObjectWithDeprecatedFields() # noqa: E501
|
||||||
"""
|
if include_optional :
|
||||||
model = ObjectWithDeprecatedFields() # noqa: E501
|
|
||||||
if include_optional:
|
|
||||||
return ObjectWithDeprecatedFields(
|
return ObjectWithDeprecatedFields(
|
||||||
uuid = '',
|
uuid = '',
|
||||||
id = 1.337,
|
id = 1.337,
|
||||||
@ -44,10 +44,9 @@ class TestObjectWithDeprecatedFields(unittest.TestCase):
|
|||||||
'bar'
|
'bar'
|
||||||
]
|
]
|
||||||
)
|
)
|
||||||
else:
|
else :
|
||||||
return ObjectWithDeprecatedFields(
|
return ObjectWithDeprecatedFields(
|
||||||
)
|
)
|
||||||
"""
|
|
||||||
|
|
||||||
def testObjectWithDeprecatedFields(self):
|
def testObjectWithDeprecatedFields(self):
|
||||||
"""Test ObjectWithDeprecatedFields"""
|
"""Test ObjectWithDeprecatedFields"""
|
||||||
|
@ -3,19 +3,21 @@
|
|||||||
"""
|
"""
|
||||||
OpenAPI Petstore
|
OpenAPI Petstore
|
||||||
|
|
||||||
This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\
|
This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501
|
||||||
|
|
||||||
The version of the OpenAPI document: 1.0.0
|
The version of the OpenAPI document: 1.0.0
|
||||||
Generated by OpenAPI Generator (https://openapi-generator.tech)
|
Generated by OpenAPI Generator (https://openapi-generator.tech)
|
||||||
|
|
||||||
Do not edit the class manually.
|
Do not edit the class manually.
|
||||||
""" # noqa: E501
|
"""
|
||||||
|
|
||||||
|
|
||||||
import unittest
|
import unittest
|
||||||
import datetime
|
import datetime
|
||||||
|
|
||||||
|
import petstore_api
|
||||||
from petstore_api.models.one_of_enum_string import OneOfEnumString # noqa: E501
|
from petstore_api.models.one_of_enum_string import OneOfEnumString # noqa: E501
|
||||||
|
from petstore_api.rest import ApiException
|
||||||
|
|
||||||
class TestOneOfEnumString(unittest.TestCase):
|
class TestOneOfEnumString(unittest.TestCase):
|
||||||
"""OneOfEnumString unit test stubs"""
|
"""OneOfEnumString unit test stubs"""
|
||||||
@ -26,18 +28,18 @@ class TestOneOfEnumString(unittest.TestCase):
|
|||||||
def tearDown(self):
|
def tearDown(self):
|
||||||
pass
|
pass
|
||||||
|
|
||||||
def make_instance(self, include_optional) -> OneOfEnumString:
|
def make_instance(self, include_optional):
|
||||||
"""Test OneOfEnumString
|
"""Test OneOfEnumString
|
||||||
include_option is a boolean, when False only required
|
include_option is a boolean, when False only required
|
||||||
params are included, when True both required and
|
params are included, when True both required and
|
||||||
optional params are included """
|
optional params are included """
|
||||||
# uncomment below to create an instance of `OneOfEnumString`
|
# uncomment below to create an instance of `OneOfEnumString`
|
||||||
"""
|
"""
|
||||||
model = OneOfEnumString() # noqa: E501
|
model = petstore_api.models.one_of_enum_string.OneOfEnumString() # noqa: E501
|
||||||
if include_optional:
|
if include_optional :
|
||||||
return OneOfEnumString(
|
return OneOfEnumString(
|
||||||
)
|
)
|
||||||
else:
|
else :
|
||||||
return OneOfEnumString(
|
return OneOfEnumString(
|
||||||
)
|
)
|
||||||
"""
|
"""
|
||||||
|
@ -3,19 +3,21 @@
|
|||||||
"""
|
"""
|
||||||
OpenAPI Petstore
|
OpenAPI Petstore
|
||||||
|
|
||||||
This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\
|
This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501
|
||||||
|
|
||||||
The version of the OpenAPI document: 1.0.0
|
The version of the OpenAPI document: 1.0.0
|
||||||
Generated by OpenAPI Generator (https://openapi-generator.tech)
|
Generated by: https://openapi-generator.tech
|
||||||
|
"""
|
||||||
|
|
||||||
Do not edit the class manually.
|
|
||||||
""" # noqa: E501
|
|
||||||
|
|
||||||
|
from __future__ import absolute_import
|
||||||
|
|
||||||
import unittest
|
import unittest
|
||||||
import datetime
|
import datetime
|
||||||
|
|
||||||
|
import petstore_api
|
||||||
from petstore_api.models.order import Order # noqa: E501
|
from petstore_api.models.order import Order # noqa: E501
|
||||||
|
from petstore_api.rest import ApiException
|
||||||
|
|
||||||
class TestOrder(unittest.TestCase):
|
class TestOrder(unittest.TestCase):
|
||||||
"""Order unit test stubs"""
|
"""Order unit test stubs"""
|
||||||
@ -26,15 +28,13 @@ class TestOrder(unittest.TestCase):
|
|||||||
def tearDown(self):
|
def tearDown(self):
|
||||||
pass
|
pass
|
||||||
|
|
||||||
def make_instance(self, include_optional) -> Order:
|
def make_instance(self, include_optional):
|
||||||
"""Test Order
|
"""Test Order
|
||||||
include_option is a boolean, when False only required
|
include_option is a boolean, when False only required
|
||||||
params are included, when True both required and
|
params are included, when True both required and
|
||||||
optional params are included """
|
optional params are included """
|
||||||
# uncomment below to create an instance of `Order`
|
# model = petstore_api.models.order.Order() # noqa: E501
|
||||||
"""
|
if include_optional :
|
||||||
model = Order() # noqa: E501
|
|
||||||
if include_optional:
|
|
||||||
return Order(
|
return Order(
|
||||||
id = 56,
|
id = 56,
|
||||||
pet_id = 56,
|
pet_id = 56,
|
||||||
@ -43,10 +43,9 @@ class TestOrder(unittest.TestCase):
|
|||||||
status = 'placed',
|
status = 'placed',
|
||||||
complete = True
|
complete = True
|
||||||
)
|
)
|
||||||
else:
|
else :
|
||||||
return Order(
|
return Order(
|
||||||
)
|
)
|
||||||
"""
|
|
||||||
|
|
||||||
def testOrder(self):
|
def testOrder(self):
|
||||||
"""Test Order"""
|
"""Test Order"""
|
||||||
|
@ -3,19 +3,21 @@
|
|||||||
"""
|
"""
|
||||||
OpenAPI Petstore
|
OpenAPI Petstore
|
||||||
|
|
||||||
This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\
|
This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501
|
||||||
|
|
||||||
The version of the OpenAPI document: 1.0.0
|
The version of the OpenAPI document: 1.0.0
|
||||||
Generated by OpenAPI Generator (https://openapi-generator.tech)
|
Generated by: https://openapi-generator.tech
|
||||||
|
"""
|
||||||
|
|
||||||
Do not edit the class manually.
|
|
||||||
""" # noqa: E501
|
|
||||||
|
|
||||||
|
from __future__ import absolute_import
|
||||||
|
|
||||||
import unittest
|
import unittest
|
||||||
import datetime
|
import datetime
|
||||||
|
|
||||||
|
import petstore_api
|
||||||
from petstore_api.models.outer_composite import OuterComposite # noqa: E501
|
from petstore_api.models.outer_composite import OuterComposite # noqa: E501
|
||||||
|
from petstore_api.rest import ApiException
|
||||||
|
|
||||||
class TestOuterComposite(unittest.TestCase):
|
class TestOuterComposite(unittest.TestCase):
|
||||||
"""OuterComposite unit test stubs"""
|
"""OuterComposite unit test stubs"""
|
||||||
@ -26,24 +28,21 @@ class TestOuterComposite(unittest.TestCase):
|
|||||||
def tearDown(self):
|
def tearDown(self):
|
||||||
pass
|
pass
|
||||||
|
|
||||||
def make_instance(self, include_optional) -> OuterComposite:
|
def make_instance(self, include_optional):
|
||||||
"""Test OuterComposite
|
"""Test OuterComposite
|
||||||
include_option is a boolean, when False only required
|
include_option is a boolean, when False only required
|
||||||
params are included, when True both required and
|
params are included, when True both required and
|
||||||
optional params are included """
|
optional params are included """
|
||||||
# uncomment below to create an instance of `OuterComposite`
|
# model = petstore_api.models.outer_composite.OuterComposite() # noqa: E501
|
||||||
"""
|
if include_optional :
|
||||||
model = OuterComposite() # noqa: E501
|
|
||||||
if include_optional:
|
|
||||||
return OuterComposite(
|
return OuterComposite(
|
||||||
my_number = 1.337,
|
my_number = 1.337,
|
||||||
my_string = '',
|
my_string = '',
|
||||||
my_boolean = True
|
my_boolean = True
|
||||||
)
|
)
|
||||||
else:
|
else :
|
||||||
return OuterComposite(
|
return OuterComposite(
|
||||||
)
|
)
|
||||||
"""
|
|
||||||
|
|
||||||
def testOuterComposite(self):
|
def testOuterComposite(self):
|
||||||
"""Test OuterComposite"""
|
"""Test OuterComposite"""
|
||||||
|
@ -3,19 +3,21 @@
|
|||||||
"""
|
"""
|
||||||
OpenAPI Petstore
|
OpenAPI Petstore
|
||||||
|
|
||||||
This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\
|
This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501
|
||||||
|
|
||||||
The version of the OpenAPI document: 1.0.0
|
The version of the OpenAPI document: 1.0.0
|
||||||
Generated by OpenAPI Generator (https://openapi-generator.tech)
|
Generated by: https://openapi-generator.tech
|
||||||
|
"""
|
||||||
|
|
||||||
Do not edit the class manually.
|
|
||||||
""" # noqa: E501
|
|
||||||
|
|
||||||
|
from __future__ import absolute_import
|
||||||
|
|
||||||
import unittest
|
import unittest
|
||||||
import datetime
|
import datetime
|
||||||
|
|
||||||
|
import petstore_api
|
||||||
from petstore_api.models.outer_enum import OuterEnum # noqa: E501
|
from petstore_api.models.outer_enum import OuterEnum # noqa: E501
|
||||||
|
from petstore_api.rest import ApiException
|
||||||
|
|
||||||
class TestOuterEnum(unittest.TestCase):
|
class TestOuterEnum(unittest.TestCase):
|
||||||
"""OuterEnum unit test stubs"""
|
"""OuterEnum unit test stubs"""
|
||||||
|
@ -3,19 +3,21 @@
|
|||||||
"""
|
"""
|
||||||
OpenAPI Petstore
|
OpenAPI Petstore
|
||||||
|
|
||||||
This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\
|
This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501
|
||||||
|
|
||||||
The version of the OpenAPI document: 1.0.0
|
The version of the OpenAPI document: 1.0.0
|
||||||
Generated by OpenAPI Generator (https://openapi-generator.tech)
|
Generated by: https://openapi-generator.tech
|
||||||
|
"""
|
||||||
|
|
||||||
Do not edit the class manually.
|
|
||||||
""" # noqa: E501
|
|
||||||
|
|
||||||
|
from __future__ import absolute_import
|
||||||
|
|
||||||
import unittest
|
import unittest
|
||||||
import datetime
|
import datetime
|
||||||
|
|
||||||
|
import petstore_api
|
||||||
from petstore_api.models.outer_enum_default_value import OuterEnumDefaultValue # noqa: E501
|
from petstore_api.models.outer_enum_default_value import OuterEnumDefaultValue # noqa: E501
|
||||||
|
from petstore_api.rest import ApiException
|
||||||
|
|
||||||
class TestOuterEnumDefaultValue(unittest.TestCase):
|
class TestOuterEnumDefaultValue(unittest.TestCase):
|
||||||
"""OuterEnumDefaultValue unit test stubs"""
|
"""OuterEnumDefaultValue unit test stubs"""
|
||||||
|
@ -3,19 +3,21 @@
|
|||||||
"""
|
"""
|
||||||
OpenAPI Petstore
|
OpenAPI Petstore
|
||||||
|
|
||||||
This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\
|
This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501
|
||||||
|
|
||||||
The version of the OpenAPI document: 1.0.0
|
The version of the OpenAPI document: 1.0.0
|
||||||
Generated by OpenAPI Generator (https://openapi-generator.tech)
|
Generated by: https://openapi-generator.tech
|
||||||
|
"""
|
||||||
|
|
||||||
Do not edit the class manually.
|
|
||||||
""" # noqa: E501
|
|
||||||
|
|
||||||
|
from __future__ import absolute_import
|
||||||
|
|
||||||
import unittest
|
import unittest
|
||||||
import datetime
|
import datetime
|
||||||
|
|
||||||
|
import petstore_api
|
||||||
from petstore_api.models.outer_enum_integer import OuterEnumInteger # noqa: E501
|
from petstore_api.models.outer_enum_integer import OuterEnumInteger # noqa: E501
|
||||||
|
from petstore_api.rest import ApiException
|
||||||
|
|
||||||
class TestOuterEnumInteger(unittest.TestCase):
|
class TestOuterEnumInteger(unittest.TestCase):
|
||||||
"""OuterEnumInteger unit test stubs"""
|
"""OuterEnumInteger unit test stubs"""
|
||||||
|
@ -3,19 +3,21 @@
|
|||||||
"""
|
"""
|
||||||
OpenAPI Petstore
|
OpenAPI Petstore
|
||||||
|
|
||||||
This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\
|
This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501
|
||||||
|
|
||||||
The version of the OpenAPI document: 1.0.0
|
The version of the OpenAPI document: 1.0.0
|
||||||
Generated by OpenAPI Generator (https://openapi-generator.tech)
|
Generated by: https://openapi-generator.tech
|
||||||
|
"""
|
||||||
|
|
||||||
Do not edit the class manually.
|
|
||||||
""" # noqa: E501
|
|
||||||
|
|
||||||
|
from __future__ import absolute_import
|
||||||
|
|
||||||
import unittest
|
import unittest
|
||||||
import datetime
|
import datetime
|
||||||
|
|
||||||
|
import petstore_api
|
||||||
from petstore_api.models.outer_enum_integer_default_value import OuterEnumIntegerDefaultValue # noqa: E501
|
from petstore_api.models.outer_enum_integer_default_value import OuterEnumIntegerDefaultValue # noqa: E501
|
||||||
|
from petstore_api.rest import ApiException
|
||||||
|
|
||||||
class TestOuterEnumIntegerDefaultValue(unittest.TestCase):
|
class TestOuterEnumIntegerDefaultValue(unittest.TestCase):
|
||||||
"""OuterEnumIntegerDefaultValue unit test stubs"""
|
"""OuterEnumIntegerDefaultValue unit test stubs"""
|
||||||
|
@ -3,19 +3,21 @@
|
|||||||
"""
|
"""
|
||||||
OpenAPI Petstore
|
OpenAPI Petstore
|
||||||
|
|
||||||
This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\
|
This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501
|
||||||
|
|
||||||
The version of the OpenAPI document: 1.0.0
|
The version of the OpenAPI document: 1.0.0
|
||||||
Generated by OpenAPI Generator (https://openapi-generator.tech)
|
Generated by: https://openapi-generator.tech
|
||||||
|
"""
|
||||||
|
|
||||||
Do not edit the class manually.
|
|
||||||
""" # noqa: E501
|
|
||||||
|
|
||||||
|
from __future__ import absolute_import
|
||||||
|
|
||||||
import unittest
|
import unittest
|
||||||
import datetime
|
import datetime
|
||||||
|
|
||||||
|
import petstore_api
|
||||||
from petstore_api.models.outer_object_with_enum_property import OuterObjectWithEnumProperty # noqa: E501
|
from petstore_api.models.outer_object_with_enum_property import OuterObjectWithEnumProperty # noqa: E501
|
||||||
|
from petstore_api.rest import ApiException
|
||||||
|
|
||||||
class TestOuterObjectWithEnumProperty(unittest.TestCase):
|
class TestOuterObjectWithEnumProperty(unittest.TestCase):
|
||||||
"""OuterObjectWithEnumProperty unit test stubs"""
|
"""OuterObjectWithEnumProperty unit test stubs"""
|
||||||
@ -26,24 +28,20 @@ class TestOuterObjectWithEnumProperty(unittest.TestCase):
|
|||||||
def tearDown(self):
|
def tearDown(self):
|
||||||
pass
|
pass
|
||||||
|
|
||||||
def make_instance(self, include_optional) -> OuterObjectWithEnumProperty:
|
def make_instance(self, include_optional):
|
||||||
"""Test OuterObjectWithEnumProperty
|
"""Test OuterObjectWithEnumProperty
|
||||||
include_option is a boolean, when False only required
|
include_option is a boolean, when False only required
|
||||||
params are included, when True both required and
|
params are included, when True both required and
|
||||||
optional params are included """
|
optional params are included """
|
||||||
# uncomment below to create an instance of `OuterObjectWithEnumProperty`
|
# model = petstore_api.models.outer_object_with_enum_property.OuterObjectWithEnumProperty() # noqa: E501
|
||||||
"""
|
if include_optional :
|
||||||
model = OuterObjectWithEnumProperty() # noqa: E501
|
|
||||||
if include_optional:
|
|
||||||
return OuterObjectWithEnumProperty(
|
return OuterObjectWithEnumProperty(
|
||||||
str_value = 'placed',
|
|
||||||
value = 2
|
value = 2
|
||||||
)
|
)
|
||||||
else:
|
else :
|
||||||
return OuterObjectWithEnumProperty(
|
return OuterObjectWithEnumProperty(
|
||||||
value = 2,
|
value = 2,
|
||||||
)
|
)
|
||||||
"""
|
|
||||||
|
|
||||||
def testOuterObjectWithEnumProperty(self):
|
def testOuterObjectWithEnumProperty(self):
|
||||||
"""Test OuterObjectWithEnumProperty"""
|
"""Test OuterObjectWithEnumProperty"""
|
||||||
|
@ -3,19 +3,21 @@
|
|||||||
"""
|
"""
|
||||||
OpenAPI Petstore
|
OpenAPI Petstore
|
||||||
|
|
||||||
This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\
|
This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501
|
||||||
|
|
||||||
The version of the OpenAPI document: 1.0.0
|
The version of the OpenAPI document: 1.0.0
|
||||||
Generated by OpenAPI Generator (https://openapi-generator.tech)
|
Generated by OpenAPI Generator (https://openapi-generator.tech)
|
||||||
|
|
||||||
Do not edit the class manually.
|
Do not edit the class manually.
|
||||||
""" # noqa: E501
|
"""
|
||||||
|
|
||||||
|
|
||||||
import unittest
|
import unittest
|
||||||
import datetime
|
import datetime
|
||||||
|
|
||||||
|
import petstore_api
|
||||||
from petstore_api.models.parent import Parent # noqa: E501
|
from petstore_api.models.parent import Parent # noqa: E501
|
||||||
|
from petstore_api.rest import ApiException
|
||||||
|
|
||||||
class TestParent(unittest.TestCase):
|
class TestParent(unittest.TestCase):
|
||||||
"""Parent unit test stubs"""
|
"""Parent unit test stubs"""
|
||||||
@ -26,22 +28,22 @@ class TestParent(unittest.TestCase):
|
|||||||
def tearDown(self):
|
def tearDown(self):
|
||||||
pass
|
pass
|
||||||
|
|
||||||
def make_instance(self, include_optional) -> Parent:
|
def make_instance(self, include_optional):
|
||||||
"""Test Parent
|
"""Test Parent
|
||||||
include_option is a boolean, when False only required
|
include_option is a boolean, when False only required
|
||||||
params are included, when True both required and
|
params are included, when True both required and
|
||||||
optional params are included """
|
optional params are included """
|
||||||
# uncomment below to create an instance of `Parent`
|
# uncomment below to create an instance of `Parent`
|
||||||
"""
|
"""
|
||||||
model = Parent() # noqa: E501
|
model = petstore_api.models.parent.Parent() # noqa: E501
|
||||||
if include_optional:
|
if include_optional :
|
||||||
return Parent(
|
return Parent(
|
||||||
optional_dict = {
|
optional_dict = {
|
||||||
'key' : petstore_api.models.inner_dict_with_property.InnerDictWithProperty(
|
'key' : petstore_api.models.inner_dict_with_property.InnerDictWithProperty(
|
||||||
a_property = petstore_api.models.a_property.aProperty(), )
|
a_property = petstore_api.models.a_property.aProperty(), )
|
||||||
}
|
}
|
||||||
)
|
)
|
||||||
else:
|
else :
|
||||||
return Parent(
|
return Parent(
|
||||||
)
|
)
|
||||||
"""
|
"""
|
||||||
|
@ -3,19 +3,23 @@
|
|||||||
"""
|
"""
|
||||||
OpenAPI Petstore
|
OpenAPI Petstore
|
||||||
|
|
||||||
This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\
|
This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501
|
||||||
|
|
||||||
The version of the OpenAPI document: 1.0.0
|
The version of the OpenAPI document: 1.0.0
|
||||||
Generated by OpenAPI Generator (https://openapi-generator.tech)
|
Generated by OpenAPI Generator (https://openapi-generator.tech)
|
||||||
|
|
||||||
Do not edit the class manually.
|
Do not edit the class manually.
|
||||||
""" # noqa: E501
|
"""
|
||||||
|
|
||||||
|
|
||||||
|
from __future__ import absolute_import
|
||||||
|
|
||||||
import unittest
|
import unittest
|
||||||
import datetime
|
import datetime
|
||||||
|
|
||||||
|
import petstore_api
|
||||||
from petstore_api.models.parent_with_optional_dict import ParentWithOptionalDict # noqa: E501
|
from petstore_api.models.parent_with_optional_dict import ParentWithOptionalDict # noqa: E501
|
||||||
|
from petstore_api.rest import ApiException
|
||||||
|
|
||||||
class TestParentWithOptionalDict(unittest.TestCase):
|
class TestParentWithOptionalDict(unittest.TestCase):
|
||||||
"""ParentWithOptionalDict unit test stubs"""
|
"""ParentWithOptionalDict unit test stubs"""
|
||||||
@ -26,22 +30,22 @@ class TestParentWithOptionalDict(unittest.TestCase):
|
|||||||
def tearDown(self):
|
def tearDown(self):
|
||||||
pass
|
pass
|
||||||
|
|
||||||
def make_instance(self, include_optional) -> ParentWithOptionalDict:
|
def make_instance(self, include_optional):
|
||||||
"""Test ParentWithOptionalDict
|
"""Test ParentWithOptionalDict
|
||||||
include_option is a boolean, when False only required
|
include_option is a boolean, when False only required
|
||||||
params are included, when True both required and
|
params are included, when True both required and
|
||||||
optional params are included """
|
optional params are included """
|
||||||
# uncomment below to create an instance of `ParentWithOptionalDict`
|
# uncomment below to create an instance of `ParentWithOptionalDict`
|
||||||
"""
|
"""
|
||||||
model = ParentWithOptionalDict() # noqa: E501
|
model = petstore_api.models.parent_with_optional_dict.ParentWithOptionalDict() # noqa: E501
|
||||||
if include_optional:
|
if include_optional :
|
||||||
return ParentWithOptionalDict(
|
return ParentWithOptionalDict(
|
||||||
optional_dict = {
|
optional_dict = {
|
||||||
'key' : petstore_api.models.inner_dict_with_property.InnerDictWithProperty(
|
'key' : petstore_api.models.inner_dict_with_property.InnerDictWithProperty(
|
||||||
a_property = petstore_api.models.a_property.aProperty(), )
|
a_property = petstore_api.models.a_property.aProperty(), )
|
||||||
}
|
}
|
||||||
)
|
)
|
||||||
else:
|
else :
|
||||||
return ParentWithOptionalDict(
|
return ParentWithOptionalDict(
|
||||||
)
|
)
|
||||||
"""
|
"""
|
||||||
|
@ -3,19 +3,21 @@
|
|||||||
"""
|
"""
|
||||||
OpenAPI Petstore
|
OpenAPI Petstore
|
||||||
|
|
||||||
This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\
|
This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501
|
||||||
|
|
||||||
The version of the OpenAPI document: 1.0.0
|
The version of the OpenAPI document: 1.0.0
|
||||||
Generated by OpenAPI Generator (https://openapi-generator.tech)
|
Generated by: https://openapi-generator.tech
|
||||||
|
"""
|
||||||
|
|
||||||
Do not edit the class manually.
|
|
||||||
""" # noqa: E501
|
|
||||||
|
|
||||||
|
from __future__ import absolute_import
|
||||||
|
|
||||||
import unittest
|
import unittest
|
||||||
import datetime
|
import datetime
|
||||||
|
|
||||||
|
import petstore_api
|
||||||
from petstore_api.models.pet import Pet # noqa: E501
|
from petstore_api.models.pet import Pet # noqa: E501
|
||||||
|
from petstore_api.rest import ApiException
|
||||||
|
|
||||||
class TestPet(unittest.TestCase):
|
class TestPet(unittest.TestCase):
|
||||||
"""Pet unit test stubs"""
|
"""Pet unit test stubs"""
|
||||||
@ -26,15 +28,13 @@ class TestPet(unittest.TestCase):
|
|||||||
def tearDown(self):
|
def tearDown(self):
|
||||||
pass
|
pass
|
||||||
|
|
||||||
def make_instance(self, include_optional) -> Pet:
|
def make_instance(self, include_optional):
|
||||||
"""Test Pet
|
"""Test Pet
|
||||||
include_option is a boolean, when False only required
|
include_option is a boolean, when False only required
|
||||||
params are included, when True both required and
|
params are included, when True both required and
|
||||||
optional params are included """
|
optional params are included """
|
||||||
# uncomment below to create an instance of `Pet`
|
# model = petstore_api.models.pet.Pet() # noqa: E501
|
||||||
"""
|
if include_optional :
|
||||||
model = Pet() # noqa: E501
|
|
||||||
if include_optional:
|
|
||||||
return Pet(
|
return Pet(
|
||||||
id = 56,
|
id = 56,
|
||||||
category = petstore_api.models.category.Category(
|
category = petstore_api.models.category.Category(
|
||||||
@ -51,14 +51,13 @@ class TestPet(unittest.TestCase):
|
|||||||
],
|
],
|
||||||
status = 'available'
|
status = 'available'
|
||||||
)
|
)
|
||||||
else:
|
else :
|
||||||
return Pet(
|
return Pet(
|
||||||
name = 'doggie',
|
name = 'doggie',
|
||||||
photo_urls = [
|
photo_urls = [
|
||||||
''
|
''
|
||||||
],
|
],
|
||||||
)
|
)
|
||||||
"""
|
|
||||||
|
|
||||||
def testPet(self):
|
def testPet(self):
|
||||||
"""Test Pet"""
|
"""Test Pet"""
|
||||||
|
@ -3,86 +3,88 @@
|
|||||||
"""
|
"""
|
||||||
OpenAPI Petstore
|
OpenAPI Petstore
|
||||||
|
|
||||||
This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\
|
This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501
|
||||||
|
|
||||||
The version of the OpenAPI document: 1.0.0
|
The version of the OpenAPI document: 1.0.0
|
||||||
Generated by OpenAPI Generator (https://openapi-generator.tech)
|
Generated by: https://openapi-generator.tech
|
||||||
|
"""
|
||||||
|
|
||||||
Do not edit the class manually.
|
|
||||||
""" # noqa: E501
|
|
||||||
|
|
||||||
|
from __future__ import absolute_import
|
||||||
|
|
||||||
import unittest
|
import unittest
|
||||||
|
|
||||||
|
import petstore_api
|
||||||
from petstore_api.api.pet_api import PetApi # noqa: E501
|
from petstore_api.api.pet_api import PetApi # noqa: E501
|
||||||
|
from petstore_api.rest import ApiException
|
||||||
|
|
||||||
|
|
||||||
class TestPetApi(unittest.TestCase):
|
class TestPetApi(unittest.TestCase):
|
||||||
"""PetApi unit test stubs"""
|
"""PetApi unit test stubs"""
|
||||||
|
|
||||||
def setUp(self) -> None:
|
def setUp(self):
|
||||||
self.api = PetApi() # noqa: E501
|
self.api = petstore_api.api.pet_api.PetApi() # noqa: E501
|
||||||
|
|
||||||
def tearDown(self) -> None:
|
def tearDown(self):
|
||||||
pass
|
pass
|
||||||
|
|
||||||
def test_add_pet(self) -> None:
|
def test_add_pet(self):
|
||||||
"""Test case for add_pet
|
"""Test case for add_pet
|
||||||
|
|
||||||
Add a new pet to the store # noqa: E501
|
Add a new pet to the store # noqa: E501
|
||||||
"""
|
"""
|
||||||
pass
|
pass
|
||||||
|
|
||||||
def test_delete_pet(self) -> None:
|
def test_delete_pet(self):
|
||||||
"""Test case for delete_pet
|
"""Test case for delete_pet
|
||||||
|
|
||||||
Deletes a pet # noqa: E501
|
Deletes a pet # noqa: E501
|
||||||
"""
|
"""
|
||||||
pass
|
pass
|
||||||
|
|
||||||
def test_find_pets_by_status(self) -> None:
|
def test_find_pets_by_status(self):
|
||||||
"""Test case for find_pets_by_status
|
"""Test case for find_pets_by_status
|
||||||
|
|
||||||
Finds Pets by status # noqa: E501
|
Finds Pets by status # noqa: E501
|
||||||
"""
|
"""
|
||||||
pass
|
pass
|
||||||
|
|
||||||
def test_find_pets_by_tags(self) -> None:
|
def test_find_pets_by_tags(self):
|
||||||
"""Test case for find_pets_by_tags
|
"""Test case for find_pets_by_tags
|
||||||
|
|
||||||
Finds Pets by tags # noqa: E501
|
Finds Pets by tags # noqa: E501
|
||||||
"""
|
"""
|
||||||
pass
|
pass
|
||||||
|
|
||||||
def test_get_pet_by_id(self) -> None:
|
def test_get_pet_by_id(self):
|
||||||
"""Test case for get_pet_by_id
|
"""Test case for get_pet_by_id
|
||||||
|
|
||||||
Find pet by ID # noqa: E501
|
Find pet by ID # noqa: E501
|
||||||
"""
|
"""
|
||||||
pass
|
pass
|
||||||
|
|
||||||
def test_update_pet(self) -> None:
|
def test_update_pet(self):
|
||||||
"""Test case for update_pet
|
"""Test case for update_pet
|
||||||
|
|
||||||
Update an existing pet # noqa: E501
|
Update an existing pet # noqa: E501
|
||||||
"""
|
"""
|
||||||
pass
|
pass
|
||||||
|
|
||||||
def test_update_pet_with_form(self) -> None:
|
def test_update_pet_with_form(self):
|
||||||
"""Test case for update_pet_with_form
|
"""Test case for update_pet_with_form
|
||||||
|
|
||||||
Updates a pet in the store with form data # noqa: E501
|
Updates a pet in the store with form data # noqa: E501
|
||||||
"""
|
"""
|
||||||
pass
|
pass
|
||||||
|
|
||||||
def test_upload_file(self) -> None:
|
def test_upload_file(self):
|
||||||
"""Test case for upload_file
|
"""Test case for upload_file
|
||||||
|
|
||||||
uploads an image # noqa: E501
|
uploads an image # noqa: E501
|
||||||
"""
|
"""
|
||||||
pass
|
pass
|
||||||
|
|
||||||
def test_upload_file_with_required_file(self) -> None:
|
def test_upload_file_with_required_file(self):
|
||||||
"""Test case for upload_file_with_required_file
|
"""Test case for upload_file_with_required_file
|
||||||
|
|
||||||
uploads an image (required) # noqa: E501
|
uploads an image (required) # noqa: E501
|
||||||
|
@ -3,19 +3,21 @@
|
|||||||
"""
|
"""
|
||||||
OpenAPI Petstore
|
OpenAPI Petstore
|
||||||
|
|
||||||
This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\
|
This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501
|
||||||
|
|
||||||
The version of the OpenAPI document: 1.0.0
|
The version of the OpenAPI document: 1.0.0
|
||||||
Generated by OpenAPI Generator (https://openapi-generator.tech)
|
Generated by: https://openapi-generator.tech
|
||||||
|
"""
|
||||||
|
|
||||||
Do not edit the class manually.
|
|
||||||
""" # noqa: E501
|
|
||||||
|
|
||||||
|
from __future__ import absolute_import
|
||||||
|
|
||||||
import unittest
|
import unittest
|
||||||
import datetime
|
import datetime
|
||||||
|
|
||||||
|
import petstore_api
|
||||||
from petstore_api.models.pig import Pig # noqa: E501
|
from petstore_api.models.pig import Pig # noqa: E501
|
||||||
|
from petstore_api.rest import ApiException
|
||||||
|
|
||||||
class TestPig(unittest.TestCase):
|
class TestPig(unittest.TestCase):
|
||||||
"""Pig unit test stubs"""
|
"""Pig unit test stubs"""
|
||||||
@ -26,27 +28,24 @@ class TestPig(unittest.TestCase):
|
|||||||
def tearDown(self):
|
def tearDown(self):
|
||||||
pass
|
pass
|
||||||
|
|
||||||
def make_instance(self, include_optional) -> Pig:
|
def make_instance(self, include_optional):
|
||||||
"""Test Pig
|
"""Test Pig
|
||||||
include_option is a boolean, when False only required
|
include_option is a boolean, when False only required
|
||||||
params are included, when True both required and
|
params are included, when True both required and
|
||||||
optional params are included """
|
optional params are included """
|
||||||
# uncomment below to create an instance of `Pig`
|
# model = petstore_api.models.pig.Pig() # noqa: E501
|
||||||
"""
|
if include_optional :
|
||||||
model = Pig() # noqa: E501
|
|
||||||
if include_optional:
|
|
||||||
return Pig(
|
return Pig(
|
||||||
class_name = '',
|
class_name = '',
|
||||||
color = '',
|
color = '',
|
||||||
size = 56
|
size = 56
|
||||||
)
|
)
|
||||||
else:
|
else :
|
||||||
return Pig(
|
return Pig(
|
||||||
class_name = '',
|
class_name = '',
|
||||||
color = '',
|
color = '',
|
||||||
size = 56,
|
size = 56,
|
||||||
)
|
)
|
||||||
"""
|
|
||||||
|
|
||||||
def testPig(self):
|
def testPig(self):
|
||||||
"""Test Pig"""
|
"""Test Pig"""
|
||||||
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
x
Reference in New Issue
Block a user