[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:
William Cheng 2023-09-25 15:59:06 +08:00 committed by GitHub
parent 3b95f701e5
commit 077744a7af
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
231 changed files with 8281 additions and 2684 deletions

View File

@ -41,8 +41,8 @@ import java.util.*;
import static org.openapitools.codegen.utils.StringUtils.escape;
import static org.openapitools.codegen.utils.StringUtils.underscore;
public class PythonClientPydanticV1Codegen extends AbstractPythonCodegen implements CodegenConfig {
private final Logger LOGGER = LoggerFactory.getLogger(PythonClientCodegen.class);
public class PythonPydanticV1ClientCodegen extends AbstractPythonPydanticV1Codegen implements CodegenConfig {
private final Logger LOGGER = LoggerFactory.getLogger(PythonPydanticV1ClientCodegen.class);
public static final String PACKAGE_URL = "packageUrl";
public static final String DEFAULT_LIBRARY = "urllib3";
@ -60,7 +60,7 @@ public class PythonClientPydanticV1Codegen extends AbstractPythonCodegen impleme
private String testFolder;
public PythonClientPydanticV1Codegen() {
public PythonPydanticV1ClientCodegen() {
super();
// force sortParamsByRequiredFlag to true to make the api method signature less complicated

View File

@ -101,7 +101,7 @@ org.openapitools.codegen.languages.PostmanCollectionCodegen
org.openapitools.codegen.languages.PowerShellClientCodegen
org.openapitools.codegen.languages.ProtobufSchemaCodegen
org.openapitools.codegen.languages.PythonClientCodegen
org.openapitools.codegen.languages.PythonClientPydanticV1Codegen
org.openapitools.codegen.languages.PythonPydanticV1ClientCodegen
org.openapitools.codegen.languages.PythonFastAPIServerCodegen
org.openapitools.codegen.languages.PythonFlaskConnexionServerCodegen
org.openapitools.codegen.languages.PythonAiohttpConnexionServerCodegen

View File

@ -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))

View File

@ -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)

View File

@ -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");
}
}

View File

@ -1217,7 +1217,9 @@
<modules>
<!-- clients -->
<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-pydantic-v1-aiohttp</module>
<!-- TODO comment out below when the test for typescript-nestjs is ready
<module>samples/client/petstore/typescript-nestjs-v6-provided-in-root</module>-->
<!-- comment out due to error `npm run build`

View File

@ -5,7 +5,7 @@ This Python package is automatically generated by the [OpenAPI Generator](https:
- API version: 0.1.0
- Package version: 1.0.0
- Build package: org.openapitools.codegen.languages.PythonClientPydanticV1Codegen
- Build package: org.openapitools.codegen.languages.PythonPydanticV1ClientCodegen
## Requirements.

View File

@ -3,20 +3,22 @@
"""
Echo Server API
Echo Server API
Echo Server API # noqa: E501
The version of the OpenAPI document: 0.1.0
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 datetime
import openapi_client
from openapi_client.models.bird import Bird # noqa: E501
from openapi_client.rest import ApiException
class TestBird(unittest.TestCase):
"""Bird unit test stubs"""
@ -27,14 +29,14 @@ class TestBird(unittest.TestCase):
def tearDown(self):
pass
def make_instance(self, include_optional) -> Bird:
def make_instance(self, include_optional):
"""Test Bird
include_option is a boolean, when False only required
params are included, when True both required and
optional params are included """
# uncomment below to create an instance of `Bird`
"""
model = Bird() # noqa: E501
model = openapi_client.models.bird.Bird() # noqa: E501
if include_optional :
return Bird(
size = '',

View File

@ -3,79 +3,39 @@
"""
Echo Server API
Echo Server API
Echo Server API # noqa: E501
The version of the OpenAPI document: 0.1.0
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 openapi_client
from openapi_client.api.body_api import BodyApi # noqa: E501
from openapi_client.rest import ApiException
class TestBodyApi(unittest.TestCase):
"""BodyApi unit test stubs"""
def setUp(self) -> None:
self.api = BodyApi() # noqa: E501
def setUp(self):
self.api = openapi_client.api.body_api.BodyApi() # noqa: E501
def tearDown(self) -> None:
def tearDown(self):
pass
def test_test_binary_gif(self) -> None:
"""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:
def test_test_echo_body_pet(self):
"""Test case for test_echo_body_pet
Test body parameter(s) # noqa: E501
"""
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__':
unittest.main()

View File

@ -3,20 +3,22 @@
"""
Echo Server API
Echo Server API
Echo Server API # noqa: E501
The version of the OpenAPI document: 0.1.0
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 datetime
import openapi_client
from openapi_client.models.category import Category # noqa: E501
from openapi_client.rest import ApiException
class TestCategory(unittest.TestCase):
"""Category unit test stubs"""
@ -27,14 +29,14 @@ class TestCategory(unittest.TestCase):
def tearDown(self):
pass
def make_instance(self, include_optional) -> Category:
def make_instance(self, include_optional):
"""Test Category
include_option is a boolean, when False only required
params are included, when True both required and
optional params are included """
# uncomment below to create an instance of `Category`
"""
model = Category() # noqa: E501
model = openapi_client.models.category.Category() # noqa: E501
if include_optional :
return Category(
id = 1,

View File

@ -3,20 +3,22 @@
"""
Echo Server API
Echo Server API
Echo Server API # noqa: E501
The version of the OpenAPI document: 0.1.0
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 datetime
import openapi_client
from openapi_client.models.data_query import DataQuery # noqa: E501
from openapi_client.rest import ApiException
class TestDataQuery(unittest.TestCase):
"""DataQuery unit test stubs"""
@ -27,14 +29,14 @@ class TestDataQuery(unittest.TestCase):
def tearDown(self):
pass
def make_instance(self, include_optional) -> DataQuery:
def make_instance(self, include_optional):
"""Test DataQuery
include_option is a boolean, when False only required
params are included, when True both required and
optional params are included """
# uncomment below to create an instance of `DataQuery`
"""
model = DataQuery() # noqa: E501
model = openapi_client.models.data_query.DataQuery() # noqa: E501
if include_optional :
return DataQuery(
suffix = '',

View File

@ -3,20 +3,22 @@
"""
Echo Server API
Echo Server API
Echo Server API # noqa: E501
The version of the OpenAPI document: 0.1.0
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 datetime
import openapi_client
from openapi_client.models.default_value import DefaultValue # noqa: E501
from openapi_client.rest import ApiException
class TestDefaultValue(unittest.TestCase):
"""DefaultValue unit test stubs"""
@ -27,19 +29,16 @@ class TestDefaultValue(unittest.TestCase):
def tearDown(self):
pass
def make_instance(self, include_optional) -> DefaultValue:
def make_instance(self, include_optional):
"""Test DefaultValue
include_option is a boolean, when False only required
params are included, when True both required and
optional params are included """
# uncomment below to create an instance of `DefaultValue`
"""
model = DefaultValue() # noqa: E501
model = openapi_client.models.default_value.DefaultValue() # noqa: E501
if include_optional :
return DefaultValue(
array_string_enum_ref_default = [
'success'
],
array_string_enum_default = [
'success'
],
@ -55,9 +54,6 @@ class TestDefaultValue(unittest.TestCase):
array_string_nullable = [
''
],
array_string_extension_nullable = [
''
],
string_nullable = ''
)
else :

View File

@ -3,44 +3,39 @@
"""
Echo Server API
Echo Server API
Echo Server API # noqa: E501
The version of the OpenAPI document: 0.1.0
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 openapi_client
from openapi_client.api.form_api import FormApi # noqa: E501
from openapi_client.rest import ApiException
class TestFormApi(unittest.TestCase):
"""FormApi unit test stubs"""
def setUp(self) -> None:
self.api = FormApi() # noqa: E501
def setUp(self):
self.api = openapi_client.api.form_api.FormApi() # noqa: E501
def tearDown(self) -> None:
def tearDown(self):
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 form parameter(s) # noqa: E501
"""
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__':
unittest.main()

View File

@ -3,31 +3,33 @@
"""
Echo Server API
Echo Server API
Echo Server API # noqa: E501
The version of the OpenAPI document: 0.1.0
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 openapi_client
from openapi_client.api.header_api import HeaderApi # noqa: E501
from openapi_client.rest import ApiException
class TestHeaderApi(unittest.TestCase):
"""HeaderApi unit test stubs"""
def setUp(self) -> None:
self.api = HeaderApi() # noqa: E501
def setUp(self):
self.api = openapi_client.api.header_api.HeaderApi() # noqa: E501
def tearDown(self) -> None:
def tearDown(self):
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 header parameter(s) # noqa: E501

View 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()

View File

@ -3,20 +3,22 @@
"""
Echo Server API
Echo Server API
Echo Server API # noqa: E501
The version of the OpenAPI document: 0.1.0
Contact: team@openapitools.org
Generated by OpenAPI Generator (https://openapi-generator.tech)
Do not edit the class manually.
""" # noqa: E501
"""
import unittest
import datetime
import openapi_client
from openapi_client.models.number_properties_only import NumberPropertiesOnly # noqa: E501
from openapi_client.rest import ApiException
class TestNumberPropertiesOnly(unittest.TestCase):
"""NumberPropertiesOnly unit test stubs"""
@ -27,19 +29,19 @@ class TestNumberPropertiesOnly(unittest.TestCase):
def tearDown(self):
pass
def make_instance(self, include_optional) -> NumberPropertiesOnly:
def make_instance(self, include_optional):
"""Test NumberPropertiesOnly
include_option is a boolean, when False only required
params are included, when True both required and
optional params are included """
# 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 :
return NumberPropertiesOnly(
number = 1.337,
float = 1.337,
double = 0.8
double = ''
)
else :
return NumberPropertiesOnly(

View File

@ -3,31 +3,33 @@
"""
Echo Server API
Echo Server API
Echo Server API # noqa: E501
The version of the OpenAPI document: 0.1.0
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 openapi_client
from openapi_client.api.path_api import PathApi # noqa: E501
from openapi_client.rest import ApiException
class TestPathApi(unittest.TestCase):
"""PathApi unit test stubs"""
def setUp(self) -> None:
self.api = PathApi() # noqa: E501
def setUp(self):
self.api = openapi_client.api.path_api.PathApi() # noqa: E501
def tearDown(self) -> None:
def tearDown(self):
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 path parameter(s) # noqa: E501

View File

@ -3,20 +3,22 @@
"""
Echo Server API
Echo Server API
Echo Server API # noqa: E501
The version of the OpenAPI document: 0.1.0
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 datetime
import openapi_client
from openapi_client.models.pet import Pet # noqa: E501
from openapi_client.rest import ApiException
class TestPet(unittest.TestCase):
"""Pet unit test stubs"""
@ -27,14 +29,14 @@ class TestPet(unittest.TestCase):
def tearDown(self):
pass
def make_instance(self, include_optional) -> Pet:
def make_instance(self, include_optional):
"""Test Pet
include_option is a boolean, when False only required
params are included, when True both required and
optional params are included """
# uncomment below to create an instance of `Pet`
"""
model = Pet() # noqa: E501
model = openapi_client.models.pet.Pet() # noqa: E501
if include_optional :
return Pet(
id = 10,

View File

@ -3,20 +3,22 @@
"""
Echo Server API
Echo Server API
Echo Server API # noqa: E501
The version of the OpenAPI document: 0.1.0
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 datetime
import openapi_client
from openapi_client.models.query import Query # noqa: E501
from openapi_client.rest import ApiException
class TestQuery(unittest.TestCase):
"""Query unit test stubs"""
@ -27,14 +29,14 @@ class TestQuery(unittest.TestCase):
def tearDown(self):
pass
def make_instance(self, include_optional) -> Query:
def make_instance(self, include_optional):
"""Test Query
include_option is a boolean, when False only required
params are included, when True both required and
optional params are included """
# uncomment below to create an instance of `Query`
"""
model = Query() # noqa: E501
model = openapi_client.models.query.Query() # noqa: E501
if include_optional :
return Query(
id = 56,

View File

@ -3,86 +3,53 @@
"""
Echo Server API
Echo Server API
Echo Server API # noqa: E501
The version of the OpenAPI document: 0.1.0
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 openapi_client
from openapi_client.api.query_api import QueryApi # noqa: E501
from openapi_client.rest import ApiException
class TestQueryApi(unittest.TestCase):
"""QueryApi unit test stubs"""
def setUp(self) -> None:
self.api = QueryApi() # noqa: E501
def setUp(self):
self.api = openapi_client.api.query_api.QueryApi() # noqa: E501
def tearDown(self) -> None:
def tearDown(self):
pass
def test_test_enum_ref_string(self) -> None:
"""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:
def test_test_query_integer_boolean_string(self):
"""Test case for test_query_integer_boolean_string
Test query parameter(s) # noqa: E501
"""
pass
def test_test_query_style_deep_object_explode_true_object(self) -> None:
"""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:
def test_test_query_style_form_explode_true_array_string(self):
"""Test case for test_query_style_form_explode_true_array_string
Test query parameter(s) # noqa: E501
"""
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 query parameter(s) # noqa: E501
"""
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__':
unittest.main()

View File

@ -3,20 +3,22 @@
"""
Echo Server API
Echo Server API
Echo Server API # noqa: E501
The version of the OpenAPI document: 0.1.0
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 datetime
import openapi_client
from openapi_client.models.string_enum_ref import StringEnumRef # noqa: E501
from openapi_client.rest import ApiException
class TestStringEnumRef(unittest.TestCase):
"""StringEnumRef unit test stubs"""

View File

@ -3,20 +3,22 @@
"""
Echo Server API
Echo Server API
Echo Server API # noqa: E501
The version of the OpenAPI document: 0.1.0
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 datetime
import openapi_client
from openapi_client.models.tag import Tag # noqa: E501
from openapi_client.rest import ApiException
class TestTag(unittest.TestCase):
"""Tag unit test stubs"""
@ -27,14 +29,14 @@ class TestTag(unittest.TestCase):
def tearDown(self):
pass
def make_instance(self, include_optional) -> Tag:
def make_instance(self, include_optional):
"""Test Tag
include_option is a boolean, when False only required
params are included, when True both required and
optional params are included """
# uncomment below to create an instance of `Tag`
"""
model = Tag() # noqa: E501
model = openapi_client.models.tag.Tag() # noqa: E501
if include_optional :
return Tag(
id = 56,

View File

@ -3,20 +3,22 @@
"""
Echo Server API
Echo Server API
Echo Server API # noqa: E501
The version of the OpenAPI document: 0.1.0
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 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.rest import ApiException
class TestTestQueryStyleDeepObjectExplodeTrueObjectAllOfQueryObjectParameter(unittest.TestCase):
"""TestQueryStyleDeepObjectExplodeTrueObjectAllOfQueryObjectParameter unit test stubs"""
@ -27,14 +29,14 @@ class TestTestQueryStyleDeepObjectExplodeTrueObjectAllOfQueryObjectParameter(uni
def tearDown(self):
pass
def make_instance(self, include_optional) -> TestQueryStyleDeepObjectExplodeTrueObjectAllOfQueryObjectParameter:
def make_instance(self, include_optional):
"""Test TestQueryStyleDeepObjectExplodeTrueObjectAllOfQueryObjectParameter
include_option is a boolean, when False only required
params are included, when True both required and
optional params are included """
# 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 :
return TestQueryStyleDeepObjectExplodeTrueObjectAllOfQueryObjectParameter(
size = '',

View File

@ -3,20 +3,22 @@
"""
Echo Server API
Echo Server API
Echo Server API # noqa: E501
The version of the OpenAPI document: 0.1.0
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 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.rest import ApiException
class TestTestQueryStyleFormExplodeTrueArrayStringQueryObjectParameter(unittest.TestCase):
"""TestQueryStyleFormExplodeTrueArrayStringQueryObjectParameter unit test stubs"""
@ -27,14 +29,14 @@ class TestTestQueryStyleFormExplodeTrueArrayStringQueryObjectParameter(unittest.
def tearDown(self):
pass
def make_instance(self, include_optional) -> TestQueryStyleFormExplodeTrueArrayStringQueryObjectParameter:
def make_instance(self, include_optional):
"""Test TestQueryStyleFormExplodeTrueArrayStringQueryObjectParameter
include_option is a boolean, when False only required
params are included, when True both required and
optional params are included """
# 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 :
return TestQueryStyleFormExplodeTrueArrayStringQueryObjectParameter(
values = [

Binary file not shown.

After

Width:  |  Height:  |  Size: 43 B

View File

@ -5,7 +5,7 @@ This Python package is automatically generated by the [OpenAPI Generator](https:
- API version: 1.0.0
- Package version: 1.0.0
- Build package: org.openapitools.codegen.languages.PythonClientPydanticV1Codegen
- Build package: org.openapitools.codegen.languages.PythonPydanticV1ClientCodegen
## Requirements.

View File

@ -0,0 +1,2 @@
tox
flake8

View 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>

View File

@ -3,19 +3,21 @@
"""
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
Generated by OpenAPI Generator (https://openapi-generator.tech)
Do not edit the class manually.
""" # noqa: E501
"""
import unittest
import datetime
import petstore_api
from petstore_api.models.additional_properties_any_type import AdditionalPropertiesAnyType # noqa: E501
from petstore_api.rest import ApiException
class TestAdditionalPropertiesAnyType(unittest.TestCase):
"""AdditionalPropertiesAnyType unit test stubs"""
@ -26,14 +28,14 @@ class TestAdditionalPropertiesAnyType(unittest.TestCase):
def tearDown(self):
pass
def make_instance(self, include_optional) -> AdditionalPropertiesAnyType:
def make_instance(self, include_optional):
"""Test AdditionalPropertiesAnyType
include_option is a boolean, when False only required
params are included, when True both required and
optional params are included """
# 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 :
return AdditionalPropertiesAnyType(
name = ''

View File

@ -3,19 +3,21 @@
"""
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
Generated by OpenAPI Generator (https://openapi-generator.tech)
Do not edit the class manually.
""" # noqa: E501
"""
import unittest
import datetime
import petstore_api
from petstore_api.models.additional_properties_class import AdditionalPropertiesClass # noqa: E501
from petstore_api.rest import ApiException
class TestAdditionalPropertiesClass(unittest.TestCase):
"""AdditionalPropertiesClass unit test stubs"""
@ -26,14 +28,14 @@ class TestAdditionalPropertiesClass(unittest.TestCase):
def tearDown(self):
pass
def make_instance(self, include_optional) -> AdditionalPropertiesClass:
def make_instance(self, include_optional):
"""Test AdditionalPropertiesClass
include_option is a boolean, when False only required
params are included, when True both required and
optional params are included """
# 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 :
return AdditionalPropertiesClass(
map_property = {

View File

@ -3,19 +3,21 @@
"""
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
Generated by OpenAPI Generator (https://openapi-generator.tech)
Do not edit the class manually.
""" # noqa: E501
"""
import unittest
import datetime
import petstore_api
from petstore_api.models.additional_properties_object import AdditionalPropertiesObject # noqa: E501
from petstore_api.rest import ApiException
class TestAdditionalPropertiesObject(unittest.TestCase):
"""AdditionalPropertiesObject unit test stubs"""
@ -26,14 +28,14 @@ class TestAdditionalPropertiesObject(unittest.TestCase):
def tearDown(self):
pass
def make_instance(self, include_optional) -> AdditionalPropertiesObject:
def make_instance(self, include_optional):
"""Test AdditionalPropertiesObject
include_option is a boolean, when False only required
params are included, when True both required and
optional params are included """
# 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 :
return AdditionalPropertiesObject(
name = ''

View File

@ -3,19 +3,21 @@
"""
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
Generated by OpenAPI Generator (https://openapi-generator.tech)
Do not edit the class manually.
""" # noqa: E501
"""
import unittest
import datetime
import petstore_api
from petstore_api.models.additional_properties_with_description_only import AdditionalPropertiesWithDescriptionOnly # noqa: E501
from petstore_api.rest import ApiException
class TestAdditionalPropertiesWithDescriptionOnly(unittest.TestCase):
"""AdditionalPropertiesWithDescriptionOnly unit test stubs"""
@ -26,14 +28,14 @@ class TestAdditionalPropertiesWithDescriptionOnly(unittest.TestCase):
def tearDown(self):
pass
def make_instance(self, include_optional) -> AdditionalPropertiesWithDescriptionOnly:
def make_instance(self, include_optional):
"""Test AdditionalPropertiesWithDescriptionOnly
include_option is a boolean, when False only required
params are included, when True both required and
optional params are included """
# 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 :
return AdditionalPropertiesWithDescriptionOnly(
name = ''

View File

@ -3,19 +3,21 @@
"""
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
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 datetime
import petstore_api
from petstore_api.models.all_of_with_single_ref import AllOfWithSingleRef # noqa: E501
from petstore_api.rest import ApiException
class TestAllOfWithSingleRef(unittest.TestCase):
"""AllOfWithSingleRef unit test stubs"""
@ -26,23 +28,20 @@ class TestAllOfWithSingleRef(unittest.TestCase):
def tearDown(self):
pass
def make_instance(self, include_optional) -> AllOfWithSingleRef:
def make_instance(self, include_optional):
"""Test AllOfWithSingleRef
include_option is a boolean, when False only required
params are included, when True both required and
optional params are included """
# uncomment below to create an instance of `AllOfWithSingleRef`
"""
model = AllOfWithSingleRef() # noqa: E501
# model = petstore_api.models.all_of_with_single_ref.AllOfWithSingleRef() # noqa: E501
if include_optional :
return AllOfWithSingleRef(
username = '',
single_ref_type = 'admin'
single_ref_type = None
)
else :
return AllOfWithSingleRef(
)
"""
def testAllOfWithSingleRef(self):
"""Test AllOfWithSingleRef"""

View File

@ -3,19 +3,21 @@
"""
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
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 datetime
import petstore_api
from petstore_api.models.animal import Animal # noqa: E501
from petstore_api.rest import ApiException
class TestAnimal(unittest.TestCase):
"""Animal unit test stubs"""
@ -26,14 +28,12 @@ class TestAnimal(unittest.TestCase):
def tearDown(self):
pass
def make_instance(self, include_optional) -> Animal:
def make_instance(self, include_optional):
"""Test Animal
include_option is a boolean, when False only required
params are included, when True both required and
optional params are included """
# uncomment below to create an instance of `Animal`
"""
model = Animal() # noqa: E501
# model = petstore_api.models.animal.Animal() # noqa: E501
if include_optional :
return Animal(
class_name = '',
@ -43,7 +43,6 @@ class TestAnimal(unittest.TestCase):
return Animal(
class_name = '',
)
"""
def testAnimal(self):
"""Test Animal"""

View File

@ -3,30 +3,32 @@
"""
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
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 petstore_api
from petstore_api.api.another_fake_api import AnotherFakeApi # noqa: E501
from petstore_api.rest import ApiException
class TestAnotherFakeApi(unittest.TestCase):
"""AnotherFakeApi unit test stubs"""
def setUp(self) -> None:
self.api = AnotherFakeApi() # noqa: E501
def setUp(self):
self.api = petstore_api.api.another_fake_api.AnotherFakeApi() # noqa: E501
def tearDown(self) -> None:
def tearDown(self):
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
To test special tags # noqa: E501

View File

@ -3,19 +3,21 @@
"""
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
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 datetime
import petstore_api
from petstore_api.models.any_of_color import AnyOfColor # noqa: E501
from petstore_api.rest import ApiException
class TestAnyOfColor(unittest.TestCase):
"""AnyOfColor unit test stubs"""
@ -26,14 +28,14 @@ class TestAnyOfColor(unittest.TestCase):
def tearDown(self):
pass
def make_instance(self, include_optional) -> AnyOfColor:
def make_instance(self, include_optional):
"""Test AnyOfColor
include_option is a boolean, when False only required
params are included, when True both required and
optional params are included """
# 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 :
return AnyOfColor(
)

View File

@ -3,19 +3,21 @@
"""
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
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 datetime
import petstore_api
from petstore_api.models.any_of_pig import AnyOfPig # noqa: E501
from petstore_api.rest import ApiException
class TestAnyOfPig(unittest.TestCase):
"""AnyOfPig unit test stubs"""
@ -26,14 +28,12 @@ class TestAnyOfPig(unittest.TestCase):
def tearDown(self):
pass
def make_instance(self, include_optional) -> AnyOfPig:
def make_instance(self, include_optional):
"""Test AnyOfPig
include_option is a boolean, when False only required
params are included, when True both required and
optional params are included """
# uncomment below to create an instance of `AnyOfPig`
"""
model = AnyOfPig() # noqa: E501
# model = petstore_api.models.any_of_pig.AnyOfPig() # noqa: E501
if include_optional :
return AnyOfPig(
class_name = '',
@ -46,7 +46,6 @@ class TestAnyOfPig(unittest.TestCase):
color = '',
size = 56,
)
"""
def testAnyOfPig(self):
"""Test AnyOfPig"""

View File

@ -3,19 +3,21 @@
"""
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
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 datetime
import petstore_api
from petstore_api.models.api_response import ApiResponse # noqa: E501
from petstore_api.rest import ApiException
class TestApiResponse(unittest.TestCase):
"""ApiResponse unit test stubs"""
@ -26,14 +28,12 @@ class TestApiResponse(unittest.TestCase):
def tearDown(self):
pass
def make_instance(self, include_optional) -> ApiResponse:
def make_instance(self, include_optional):
"""Test ApiResponse
include_option is a boolean, when False only required
params are included, when True both required and
optional params are included """
# uncomment below to create an instance of `ApiResponse`
"""
model = ApiResponse() # noqa: E501
# model = petstore_api.models.api_response.ApiResponse() # noqa: E501
if include_optional :
return ApiResponse(
code = 56,
@ -43,7 +43,6 @@ class TestApiResponse(unittest.TestCase):
else :
return ApiResponse(
)
"""
def testApiResponse(self):
"""Test ApiResponse"""

View File

@ -3,19 +3,21 @@
"""
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
Generated by OpenAPI Generator (https://openapi-generator.tech)
Do not edit the class manually.
""" # noqa: E501
"""
import unittest
import datetime
import petstore_api
from petstore_api.models.array_of_array_of_model import ArrayOfArrayOfModel # noqa: E501
from petstore_api.rest import ApiException
class TestArrayOfArrayOfModel(unittest.TestCase):
"""ArrayOfArrayOfModel unit test stubs"""
@ -26,14 +28,14 @@ class TestArrayOfArrayOfModel(unittest.TestCase):
def tearDown(self):
pass
def make_instance(self, include_optional) -> ArrayOfArrayOfModel:
def make_instance(self, include_optional):
"""Test ArrayOfArrayOfModel
include_option is a boolean, when False only required
params are included, when True both required and
optional params are included """
# 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 :
return ArrayOfArrayOfModel(
another_property = [

View File

@ -3,19 +3,21 @@
"""
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
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 datetime
import petstore_api
from petstore_api.models.array_of_array_of_number_only import ArrayOfArrayOfNumberOnly # noqa: E501
from petstore_api.rest import ApiException
class TestArrayOfArrayOfNumberOnly(unittest.TestCase):
"""ArrayOfArrayOfNumberOnly unit test stubs"""
@ -26,14 +28,12 @@ class TestArrayOfArrayOfNumberOnly(unittest.TestCase):
def tearDown(self):
pass
def make_instance(self, include_optional) -> ArrayOfArrayOfNumberOnly:
def make_instance(self, include_optional):
"""Test ArrayOfArrayOfNumberOnly
include_option is a boolean, when False only required
params are included, when True both required and
optional params are included """
# uncomment below to create an instance of `ArrayOfArrayOfNumberOnly`
"""
model = ArrayOfArrayOfNumberOnly() # noqa: E501
# model = petstore_api.models.array_of_array_of_number_only.ArrayOfArrayOfNumberOnly() # noqa: E501
if include_optional :
return ArrayOfArrayOfNumberOnly(
array_array_number = [
@ -45,7 +45,6 @@ class TestArrayOfArrayOfNumberOnly(unittest.TestCase):
else :
return ArrayOfArrayOfNumberOnly(
)
"""
def testArrayOfArrayOfNumberOnly(self):
"""Test ArrayOfArrayOfNumberOnly"""

View File

@ -3,19 +3,21 @@
"""
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
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 datetime
import petstore_api
from petstore_api.models.array_of_number_only import ArrayOfNumberOnly # noqa: E501
from petstore_api.rest import ApiException
class TestArrayOfNumberOnly(unittest.TestCase):
"""ArrayOfNumberOnly unit test stubs"""
@ -26,14 +28,12 @@ class TestArrayOfNumberOnly(unittest.TestCase):
def tearDown(self):
pass
def make_instance(self, include_optional) -> ArrayOfNumberOnly:
def make_instance(self, include_optional):
"""Test ArrayOfNumberOnly
include_option is a boolean, when False only required
params are included, when True both required and
optional params are included """
# uncomment below to create an instance of `ArrayOfNumberOnly`
"""
model = ArrayOfNumberOnly() # noqa: E501
# model = petstore_api.models.array_of_number_only.ArrayOfNumberOnly() # noqa: E501
if include_optional :
return ArrayOfNumberOnly(
array_number = [
@ -43,7 +43,6 @@ class TestArrayOfNumberOnly(unittest.TestCase):
else :
return ArrayOfNumberOnly(
)
"""
def testArrayOfNumberOnly(self):
"""Test ArrayOfNumberOnly"""

View File

@ -3,19 +3,21 @@
"""
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
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 datetime
import petstore_api
from petstore_api.models.array_test import ArrayTest # noqa: E501
from petstore_api.rest import ApiException
class TestArrayTest(unittest.TestCase):
"""ArrayTest unit test stubs"""
@ -26,14 +28,12 @@ class TestArrayTest(unittest.TestCase):
def tearDown(self):
pass
def make_instance(self, include_optional) -> ArrayTest:
def make_instance(self, include_optional):
"""Test ArrayTest
include_option is a boolean, when False only required
params are included, when True both required and
optional params are included """
# uncomment below to create an instance of `ArrayTest`
"""
model = ArrayTest() # noqa: E501
# model = petstore_api.models.array_test.ArrayTest() # noqa: E501
if include_optional :
return ArrayTest(
array_of_string = [
@ -55,7 +55,6 @@ class TestArrayTest(unittest.TestCase):
else :
return ArrayTest(
)
"""
def testArrayTest(self):
"""Test ArrayTest"""

View File

@ -3,19 +3,21 @@
"""
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
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 datetime
import petstore_api
from petstore_api.models.basque_pig import BasquePig # noqa: E501
from petstore_api.rest import ApiException
class TestBasquePig(unittest.TestCase):
"""BasquePig unit test stubs"""
@ -26,14 +28,12 @@ class TestBasquePig(unittest.TestCase):
def tearDown(self):
pass
def make_instance(self, include_optional) -> BasquePig:
def make_instance(self, include_optional):
"""Test BasquePig
include_option is a boolean, when False only required
params are included, when True both required and
optional params are included """
# uncomment below to create an instance of `BasquePig`
"""
model = BasquePig() # noqa: E501
# model = petstore_api.models.basque_pig.BasquePig() # noqa: E501
if include_optional :
return BasquePig(
class_name = '',
@ -44,7 +44,6 @@ class TestBasquePig(unittest.TestCase):
class_name = '',
color = '',
)
"""
def testBasquePig(self):
"""Test BasquePig"""

View File

@ -3,19 +3,21 @@
"""
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
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 datetime
import petstore_api
from petstore_api.models.capitalization import Capitalization # noqa: E501
from petstore_api.rest import ApiException
class TestCapitalization(unittest.TestCase):
"""Capitalization unit test stubs"""
@ -26,14 +28,12 @@ class TestCapitalization(unittest.TestCase):
def tearDown(self):
pass
def make_instance(self, include_optional) -> Capitalization:
def make_instance(self, include_optional):
"""Test Capitalization
include_option is a boolean, when False only required
params are included, when True both required and
optional params are included """
# uncomment below to create an instance of `Capitalization`
"""
model = Capitalization() # noqa: E501
# model = petstore_api.models.capitalization.Capitalization() # noqa: E501
if include_optional :
return Capitalization(
small_camel = '',
@ -46,7 +46,6 @@ class TestCapitalization(unittest.TestCase):
else :
return Capitalization(
)
"""
def testCapitalization(self):
"""Test Capitalization"""

View File

@ -3,19 +3,21 @@
"""
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
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 datetime
import petstore_api
from petstore_api.models.cat import Cat # noqa: E501
from petstore_api.rest import ApiException
class TestCat(unittest.TestCase):
"""Cat unit test stubs"""
@ -26,14 +28,12 @@ class TestCat(unittest.TestCase):
def tearDown(self):
pass
def make_instance(self, include_optional) -> Cat:
def make_instance(self, include_optional):
"""Test Cat
include_option is a boolean, when False only required
params are included, when True both required and
optional params are included """
# uncomment below to create an instance of `Cat`
"""
model = Cat() # noqa: E501
# model = petstore_api.models.cat.Cat() # noqa: E501
if include_optional :
return Cat(
declawed = True
@ -41,7 +41,6 @@ class TestCat(unittest.TestCase):
else :
return Cat(
)
"""
def testCat(self):
"""Test Cat"""

View File

@ -3,19 +3,21 @@
"""
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
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 datetime
import petstore_api
from petstore_api.models.category import Category # noqa: E501
from petstore_api.rest import ApiException
class TestCategory(unittest.TestCase):
"""Category unit test stubs"""
@ -26,14 +28,12 @@ class TestCategory(unittest.TestCase):
def tearDown(self):
pass
def make_instance(self, include_optional) -> Category:
def make_instance(self, include_optional):
"""Test Category
include_option is a boolean, when False only required
params are included, when True both required and
optional params are included """
# uncomment below to create an instance of `Category`
"""
model = Category() # noqa: E501
# model = petstore_api.models.category.Category() # noqa: E501
if include_optional :
return Category(
id = 56,
@ -43,7 +43,6 @@ class TestCategory(unittest.TestCase):
return Category(
name = 'default-name',
)
"""
def testCategory(self):
"""Test Category"""

View File

@ -3,19 +3,23 @@
"""
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
Generated by OpenAPI Generator (https://openapi-generator.tech)
Do not edit the class manually.
""" # noqa: E501
"""
from __future__ import absolute_import
import unittest
import datetime
import petstore_api
from petstore_api.models.circular_reference_model import CircularReferenceModel # noqa: E501
from petstore_api.rest import ApiException
class TestCircularReferenceModel(unittest.TestCase):
"""CircularReferenceModel unit test stubs"""
@ -26,14 +30,14 @@ class TestCircularReferenceModel(unittest.TestCase):
def tearDown(self):
pass
def make_instance(self, include_optional) -> CircularReferenceModel:
def make_instance(self, include_optional):
"""Test CircularReferenceModel
include_option is a boolean, when False only required
params are included, when True both required and
optional params are included """
# 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 :
return CircularReferenceModel(
size = 56,

View File

@ -3,19 +3,21 @@
"""
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
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 datetime
import petstore_api
from petstore_api.models.class_model import ClassModel # noqa: E501
from petstore_api.rest import ApiException
class TestClassModel(unittest.TestCase):
"""ClassModel unit test stubs"""
@ -26,22 +28,19 @@ class TestClassModel(unittest.TestCase):
def tearDown(self):
pass
def make_instance(self, include_optional) -> ClassModel:
def make_instance(self, include_optional):
"""Test ClassModel
include_option is a boolean, when False only required
params are included, when True both required and
optional params are included """
# uncomment below to create an instance of `ClassModel`
"""
model = ClassModel() # noqa: E501
# model = petstore_api.models.class_model.ClassModel() # noqa: E501
if include_optional :
return ClassModel(
var_class = ''
_class = ''
)
else :
return ClassModel(
)
"""
def testClassModel(self):
"""Test ClassModel"""

View File

@ -3,19 +3,21 @@
"""
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
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 datetime
import petstore_api
from petstore_api.models.client import Client # noqa: E501
from petstore_api.rest import ApiException
class TestClient(unittest.TestCase):
"""Client unit test stubs"""
@ -26,14 +28,12 @@ class TestClient(unittest.TestCase):
def tearDown(self):
pass
def make_instance(self, include_optional) -> Client:
def make_instance(self, include_optional):
"""Test Client
include_option is a boolean, when False only required
params are included, when True both required and
optional params are included """
# uncomment below to create an instance of `Client`
"""
model = Client() # noqa: E501
# model = petstore_api.models.client.Client() # noqa: E501
if include_optional :
return Client(
client = ''
@ -41,7 +41,6 @@ class TestClient(unittest.TestCase):
else :
return Client(
)
"""
def testClient(self):
"""Test Client"""

View File

@ -3,19 +3,21 @@
"""
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
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 datetime
import petstore_api
from petstore_api.models.color import Color # noqa: E501
from petstore_api.rest import ApiException
class TestColor(unittest.TestCase):
"""Color unit test stubs"""
@ -26,14 +28,14 @@ class TestColor(unittest.TestCase):
def tearDown(self):
pass
def make_instance(self, include_optional) -> Color:
def make_instance(self, include_optional):
"""Test Color
include_option is a boolean, when False only required
params are included, when True both required and
optional params are included """
# uncomment below to create an instance of `Color`
"""
model = Color() # noqa: E501
model = petstore_api.models.color.Color() # noqa: E501
if include_optional :
return Color(
)

View File

@ -3,19 +3,21 @@
"""
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
Generated by OpenAPI Generator (https://openapi-generator.tech)
Do not edit the class manually.
""" # noqa: E501
"""
import unittest
import datetime
import petstore_api
from petstore_api.models.creature import Creature # noqa: E501
from petstore_api.rest import ApiException
class TestCreature(unittest.TestCase):
"""Creature unit test stubs"""
@ -26,14 +28,14 @@ class TestCreature(unittest.TestCase):
def tearDown(self):
pass
def make_instance(self, include_optional) -> Creature:
def make_instance(self, include_optional):
"""Test Creature
include_option is a boolean, when False only required
params are included, when True both required and
optional params are included """
# uncomment below to create an instance of `Creature`
"""
model = Creature() # noqa: E501
model = petstore_api.models.creature.Creature() # noqa: E501
if include_optional :
return Creature(
info = petstore_api.models.creature_info.CreatureInfo(

View File

@ -3,19 +3,21 @@
"""
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
Generated by OpenAPI Generator (https://openapi-generator.tech)
Do not edit the class manually.
""" # noqa: E501
"""
import unittest
import datetime
import petstore_api
from petstore_api.models.creature_info import CreatureInfo # noqa: E501
from petstore_api.rest import ApiException
class TestCreatureInfo(unittest.TestCase):
"""CreatureInfo unit test stubs"""
@ -26,14 +28,14 @@ class TestCreatureInfo(unittest.TestCase):
def tearDown(self):
pass
def make_instance(self, include_optional) -> CreatureInfo:
def make_instance(self, include_optional):
"""Test CreatureInfo
include_option is a boolean, when False only required
params are included, when True both required and
optional params are included """
# uncomment below to create an instance of `CreatureInfo`
"""
model = CreatureInfo() # noqa: E501
model = petstore_api.models.creature_info.CreatureInfo() # noqa: E501
if include_optional :
return CreatureInfo(
name = ''

View File

@ -3,19 +3,21 @@
"""
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
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 datetime
import petstore_api
from petstore_api.models.danish_pig import DanishPig # noqa: E501
from petstore_api.rest import ApiException
class TestDanishPig(unittest.TestCase):
"""DanishPig unit test stubs"""
@ -26,14 +28,12 @@ class TestDanishPig(unittest.TestCase):
def tearDown(self):
pass
def make_instance(self, include_optional) -> DanishPig:
def make_instance(self, include_optional):
"""Test DanishPig
include_option is a boolean, when False only required
params are included, when True both required and
optional params are included """
# uncomment below to create an instance of `DanishPig`
"""
model = DanishPig() # noqa: E501
# model = petstore_api.models.danish_pig.DanishPig() # noqa: E501
if include_optional :
return DanishPig(
class_name = '',
@ -44,7 +44,6 @@ class TestDanishPig(unittest.TestCase):
class_name = '',
size = 56,
)
"""
def testDanishPig(self):
"""Test DanishPig"""

View File

@ -3,30 +3,32 @@
"""
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
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 petstore_api
from petstore_api.api.default_api import DefaultApi # noqa: E501
from petstore_api.rest import ApiException
class TestDefaultApi(unittest.TestCase):
"""DefaultApi unit test stubs"""
def setUp(self) -> None:
self.api = DefaultApi() # noqa: E501
def setUp(self):
self.api = petstore_api.api.default_api.DefaultApi() # noqa: E501
def tearDown(self) -> None:
def tearDown(self):
pass
def test_foo_get(self) -> None:
def test_foo_get(self):
"""Test case for foo_get
"""

View File

@ -3,19 +3,21 @@
"""
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
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 datetime
import petstore_api
from petstore_api.models.deprecated_object import DeprecatedObject # noqa: E501
from petstore_api.rest import ApiException
class TestDeprecatedObject(unittest.TestCase):
"""DeprecatedObject unit test stubs"""
@ -26,14 +28,12 @@ class TestDeprecatedObject(unittest.TestCase):
def tearDown(self):
pass
def make_instance(self, include_optional) -> DeprecatedObject:
def make_instance(self, include_optional):
"""Test DeprecatedObject
include_option is a boolean, when False only required
params are included, when True both required and
optional params are included """
# uncomment below to create an instance of `DeprecatedObject`
"""
model = DeprecatedObject() # noqa: E501
# model = petstore_api.models.deprecated_object.DeprecatedObject() # noqa: E501
if include_optional :
return DeprecatedObject(
name = ''
@ -41,7 +41,6 @@ class TestDeprecatedObject(unittest.TestCase):
else :
return DeprecatedObject(
)
"""
def testDeprecatedObject(self):
"""Test DeprecatedObject"""

View File

@ -3,19 +3,21 @@
"""
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
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 datetime
import petstore_api
from petstore_api.models.dog import Dog # noqa: E501
from petstore_api.rest import ApiException
class TestDog(unittest.TestCase):
"""Dog unit test stubs"""
@ -26,14 +28,12 @@ class TestDog(unittest.TestCase):
def tearDown(self):
pass
def make_instance(self, include_optional) -> Dog:
def make_instance(self, include_optional):
"""Test Dog
include_option is a boolean, when False only required
params are included, when True both required and
optional params are included """
# uncomment below to create an instance of `Dog`
"""
model = Dog() # noqa: E501
# model = petstore_api.models.dog.Dog() # noqa: E501
if include_optional :
return Dog(
breed = ''
@ -41,7 +41,6 @@ class TestDog(unittest.TestCase):
else :
return Dog(
)
"""
def testDog(self):
"""Test Dog"""

View File

@ -3,19 +3,21 @@
"""
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
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 datetime
import petstore_api
from petstore_api.models.dummy_model import DummyModel # noqa: E501
from petstore_api.rest import ApiException
class TestDummyModel(unittest.TestCase):
"""DummyModel unit test stubs"""
@ -26,14 +28,14 @@ class TestDummyModel(unittest.TestCase):
def tearDown(self):
pass
def make_instance(self, include_optional) -> DummyModel:
def make_instance(self, include_optional):
"""Test DummyModel
include_option is a boolean, when False only required
params are included, when True both required and
optional params are included """
# uncomment below to create an instance of `DummyModel`
"""
model = DummyModel() # noqa: E501
model = petstore_api.models.dummy_model.DummyModel() # noqa: E501
if include_optional :
return DummyModel(
category = '',

View File

@ -3,19 +3,21 @@
"""
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
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 datetime
import petstore_api
from petstore_api.models.enum_arrays import EnumArrays # noqa: E501
from petstore_api.rest import ApiException
class TestEnumArrays(unittest.TestCase):
"""EnumArrays unit test stubs"""
@ -26,14 +28,12 @@ class TestEnumArrays(unittest.TestCase):
def tearDown(self):
pass
def make_instance(self, include_optional) -> EnumArrays:
def make_instance(self, include_optional):
"""Test EnumArrays
include_option is a boolean, when False only required
params are included, when True both required and
optional params are included """
# uncomment below to create an instance of `EnumArrays`
"""
model = EnumArrays() # noqa: E501
# model = petstore_api.models.enum_arrays.EnumArrays() # noqa: E501
if include_optional :
return EnumArrays(
just_symbol = '>=',
@ -44,7 +44,6 @@ class TestEnumArrays(unittest.TestCase):
else :
return EnumArrays(
)
"""
def testEnumArrays(self):
"""Test EnumArrays"""

View File

@ -3,19 +3,21 @@
"""
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
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 datetime
import petstore_api
from petstore_api.models.enum_class import EnumClass # noqa: E501
from petstore_api.rest import ApiException
class TestEnumClass(unittest.TestCase):
"""EnumClass unit test stubs"""

View File

@ -3,19 +3,21 @@
"""
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
Generated by OpenAPI Generator (https://openapi-generator.tech)
Do not edit the class manually.
""" # noqa: E501
"""
import unittest
import datetime
import petstore_api
from petstore_api.models.enum_string1 import EnumString1 # noqa: E501
from petstore_api.rest import ApiException
class TestEnumString1(unittest.TestCase):
"""EnumString1 unit test stubs"""

View File

@ -3,19 +3,21 @@
"""
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
Generated by OpenAPI Generator (https://openapi-generator.tech)
Do not edit the class manually.
""" # noqa: E501
"""
import unittest
import datetime
import petstore_api
from petstore_api.models.enum_string2 import EnumString2 # noqa: E501
from petstore_api.rest import ApiException
class TestEnumString2(unittest.TestCase):
"""EnumString2 unit test stubs"""

View File

@ -3,19 +3,21 @@
"""
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
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 datetime
import petstore_api
from petstore_api.models.enum_test import EnumTest # noqa: E501
from petstore_api.rest import ApiException
class TestEnumTest(unittest.TestCase):
"""EnumTest unit test stubs"""
@ -26,31 +28,23 @@ class TestEnumTest(unittest.TestCase):
def tearDown(self):
pass
def make_instance(self, include_optional) -> EnumTest:
def make_instance(self, include_optional):
"""Test EnumTest
include_option is a boolean, when False only required
params are included, when True both required and
optional params are included """
# uncomment below to create an instance of `EnumTest`
"""
model = EnumTest() # noqa: E501
# model = petstore_api.models.enum_test.EnumTest() # noqa: E501
if include_optional :
return EnumTest(
enum_string = 'UPPER',
enum_string_required = 'UPPER',
enum_integer_default = 1,
enum_integer = 1,
enum_number = 1.1,
outer_enum = 'placed',
outer_enum_integer = 2,
outer_enum_default_value = 'placed',
outer_enum_integer_default_value = -1
enum_number = 1.1
)
else :
return EnumTest(
enum_string_required = 'UPPER',
)
"""
def testEnumTest(self):
"""Test EnumTest"""

View File

@ -3,168 +3,129 @@
"""
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
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 petstore_api
from petstore_api.api.fake_api import FakeApi # noqa: E501
from petstore_api.rest import ApiException
class TestFakeApi(unittest.TestCase):
"""FakeApi unit test stubs"""
def setUp(self) -> None:
self.api = FakeApi() # noqa: E501
def setUp(self):
self.api = petstore_api.api.fake_api.FakeApi() # noqa: E501
def tearDown(self) -> None:
def tearDown(self):
pass
def test_fake_any_type_request_body(self) -> None:
"""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:
def test_fake_health_get(self):
"""Test case for fake_health_get
Health check endpoint # noqa: E501
"""
pass
def test_fake_http_signature_test(self) -> None:
def test_fake_http_signature_test(self):
"""Test case for fake_http_signature_test
test http signature authentication # noqa: E501
"""
pass
def test_fake_outer_boolean_serialize(self) -> None:
def test_fake_outer_boolean_serialize(self):
"""Test case for fake_outer_boolean_serialize
"""
pass
def test_fake_outer_composite_serialize(self) -> None:
def test_fake_outer_composite_serialize(self):
"""Test case for fake_outer_composite_serialize
"""
pass
def test_fake_outer_number_serialize(self) -> None:
def test_fake_outer_number_serialize(self):
"""Test case for fake_outer_number_serialize
"""
pass
def test_fake_outer_string_serialize(self) -> None:
def test_fake_outer_string_serialize(self):
"""Test case for fake_outer_string_serialize
"""
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
"""
pass
def test_fake_return_list_of_objects(self) -> None:
"""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:
def test_test_body_with_binary(self):
"""Test case for test_body_with_binary
"""
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
"""
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
"""
pass
def test_test_client_model(self) -> None:
def test_test_client_model(self):
"""Test case for test_client_model
To test \"client\" model # noqa: E501
"""
pass
def test_test_date_time_query_parameter(self) -> None:
"""Test case for test_date_time_query_parameter
"""
pass
def test_test_endpoint_parameters(self) -> None:
def test_test_endpoint_parameters(self):
"""Test case for test_endpoint_parameters
Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 # noqa: E501
"""
pass
def test_test_group_parameters(self) -> None:
def test_test_group_parameters(self):
"""Test case for test_group_parameters
Fake endpoint to test group parameters (optional) # noqa: E501
"""
pass
def test_test_inline_additional_properties(self) -> None:
def test_test_inline_additional_properties(self):
"""Test case for test_inline_additional_properties
test inline additionalProperties # noqa: E501
"""
pass
def test_test_inline_freeform_additional_properties(self) -> None:
"""Test case for test_inline_freeform_additional_properties
test inline free-form additionalProperties # noqa: E501
"""
pass
def test_test_json_form_data(self) -> None:
def test_test_json_form_data(self):
"""Test case for test_json_form_data
test json serialization of form data # noqa: E501
"""
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
"""

View File

@ -3,30 +3,32 @@
"""
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
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 petstore_api
from petstore_api.api.fake_classname_tags123_api import FakeClassnameTags123Api # noqa: E501
from petstore_api.rest import ApiException
class TestFakeClassnameTags123Api(unittest.TestCase):
"""FakeClassnameTags123Api unit test stubs"""
def setUp(self) -> None:
self.api = FakeClassnameTags123Api() # noqa: E501
def setUp(self):
self.api = petstore_api.api.fake_classname_tags123_api.FakeClassnameTags123Api() # noqa: E501
def tearDown(self) -> None:
def tearDown(self):
pass
def test_test_classname(self) -> None:
def test_test_classname(self):
"""Test case for test_classname
To test class name in snake case # noqa: E501

View File

@ -3,19 +3,21 @@
"""
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
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 datetime
import petstore_api
from petstore_api.models.file import File # noqa: E501
from petstore_api.rest import ApiException
class TestFile(unittest.TestCase):
"""File unit test stubs"""
@ -26,14 +28,12 @@ class TestFile(unittest.TestCase):
def tearDown(self):
pass
def make_instance(self, include_optional) -> File:
def make_instance(self, include_optional):
"""Test File
include_option is a boolean, when False only required
params are included, when True both required and
optional params are included """
# uncomment below to create an instance of `File`
"""
model = File() # noqa: E501
# model = petstore_api.models.file.File() # noqa: E501
if include_optional :
return File(
source_uri = ''
@ -41,7 +41,6 @@ class TestFile(unittest.TestCase):
else :
return File(
)
"""
def testFile(self):
"""Test File"""

View File

@ -3,19 +3,21 @@
"""
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
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 datetime
import petstore_api
from petstore_api.models.file_schema_test_class import FileSchemaTestClass # noqa: E501
from petstore_api.rest import ApiException
class TestFileSchemaTestClass(unittest.TestCase):
"""FileSchemaTestClass unit test stubs"""
@ -26,14 +28,12 @@ class TestFileSchemaTestClass(unittest.TestCase):
def tearDown(self):
pass
def make_instance(self, include_optional) -> FileSchemaTestClass:
def make_instance(self, include_optional):
"""Test FileSchemaTestClass
include_option is a boolean, when False only required
params are included, when True both required and
optional params are included """
# uncomment below to create an instance of `FileSchemaTestClass`
"""
model = FileSchemaTestClass() # noqa: E501
# model = petstore_api.models.file_schema_test_class.FileSchemaTestClass() # noqa: E501
if include_optional :
return FileSchemaTestClass(
file = petstore_api.models.file.File(
@ -46,7 +46,6 @@ class TestFileSchemaTestClass(unittest.TestCase):
else :
return FileSchemaTestClass(
)
"""
def testFileSchemaTestClass(self):
"""Test FileSchemaTestClass"""

View File

@ -3,19 +3,23 @@
"""
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
Generated by OpenAPI Generator (https://openapi-generator.tech)
Do not edit the class manually.
""" # noqa: E501
"""
from __future__ import absolute_import
import unittest
import datetime
import petstore_api
from petstore_api.models.first_ref import FirstRef # noqa: E501
from petstore_api.rest import ApiException
class TestFirstRef(unittest.TestCase):
"""FirstRef unit test stubs"""
@ -26,14 +30,14 @@ class TestFirstRef(unittest.TestCase):
def tearDown(self):
pass
def make_instance(self, include_optional) -> FirstRef:
def make_instance(self, include_optional):
"""Test FirstRef
include_option is a boolean, when False only required
params are included, when True both required and
optional params are included """
# uncomment below to create an instance of `FirstRef`
"""
model = FirstRef() # noqa: E501
model = petstore_api.models.first_ref.FirstRef() # noqa: E501
if include_optional :
return FirstRef(
category = '',

View File

@ -3,19 +3,21 @@
"""
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
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 datetime
import petstore_api
from petstore_api.models.foo import Foo # noqa: E501
from petstore_api.rest import ApiException
class TestFoo(unittest.TestCase):
"""Foo unit test stubs"""
@ -26,14 +28,12 @@ class TestFoo(unittest.TestCase):
def tearDown(self):
pass
def make_instance(self, include_optional) -> Foo:
def make_instance(self, include_optional):
"""Test Foo
include_option is a boolean, when False only required
params are included, when True both required and
optional params are included """
# uncomment below to create an instance of `Foo`
"""
model = Foo() # noqa: E501
# model = petstore_api.models.foo.Foo() # noqa: E501
if include_optional :
return Foo(
bar = 'bar'
@ -41,7 +41,6 @@ class TestFoo(unittest.TestCase):
else :
return Foo(
)
"""
def testFoo(self):
"""Test Foo"""

View File

@ -3,19 +3,21 @@
"""
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
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 datetime
import petstore_api
from petstore_api.models.foo_get_default_response import FooGetDefaultResponse # noqa: E501
from petstore_api.rest import ApiException
class TestFooGetDefaultResponse(unittest.TestCase):
"""FooGetDefaultResponse unit test stubs"""
@ -26,14 +28,12 @@ class TestFooGetDefaultResponse(unittest.TestCase):
def tearDown(self):
pass
def make_instance(self, include_optional) -> FooGetDefaultResponse:
def make_instance(self, include_optional):
"""Test FooGetDefaultResponse
include_option is a boolean, when False only required
params are included, when True both required and
optional params are included """
# uncomment below to create an instance of `FooGetDefaultResponse`
"""
model = FooGetDefaultResponse() # noqa: E501
# model = petstore_api.models.foo_get_default_response.FooGetDefaultResponse() # noqa: E501
if include_optional :
return FooGetDefaultResponse(
string = petstore_api.models.foo.Foo(
@ -42,7 +42,6 @@ class TestFooGetDefaultResponse(unittest.TestCase):
else :
return FooGetDefaultResponse(
)
"""
def testFooGetDefaultResponse(self):
"""Test FooGetDefaultResponse"""

View File

@ -3,19 +3,21 @@
"""
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
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 datetime
import petstore_api
from petstore_api.models.format_test import FormatTest # noqa: E501
from petstore_api.rest import ApiException
class TestFormatTest(unittest.TestCase):
"""FormatTest unit test stubs"""
@ -26,14 +28,12 @@ class TestFormatTest(unittest.TestCase):
def tearDown(self):
pass
def make_instance(self, include_optional) -> FormatTest:
def make_instance(self, include_optional):
"""Test FormatTest
include_option is a boolean, when False only required
params are included, when True both required and
optional params are included """
# uncomment below to create an instance of `FormatTest`
"""
model = FormatTest() # noqa: E501
# model = petstore_api.models.format_test.FormatTest() # noqa: E501
if include_optional :
return FormatTest(
integer = 10,
@ -42,12 +42,10 @@ class TestFormatTest(unittest.TestCase):
number = 32.1,
float = 54.3,
double = 67.8,
decimal = 1,
string = 'a',
string_with_double_quote_pattern = 'this is \"something\"',
byte = 'YQ==',
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'),
uuid = '72f98069-206d-4f12-9f12-3d1e525a8e84',
password = '0123456789',
@ -57,10 +55,10 @@ class TestFormatTest(unittest.TestCase):
else :
return FormatTest(
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',
)
"""
def testFormatTest(self):
"""Test FormatTest"""

View File

@ -3,19 +3,21 @@
"""
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
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 datetime
import petstore_api
from petstore_api.models.has_only_read_only import HasOnlyReadOnly # noqa: E501
from petstore_api.rest import ApiException
class TestHasOnlyReadOnly(unittest.TestCase):
"""HasOnlyReadOnly unit test stubs"""
@ -26,14 +28,12 @@ class TestHasOnlyReadOnly(unittest.TestCase):
def tearDown(self):
pass
def make_instance(self, include_optional) -> HasOnlyReadOnly:
def make_instance(self, include_optional):
"""Test HasOnlyReadOnly
include_option is a boolean, when False only required
params are included, when True both required and
optional params are included """
# uncomment below to create an instance of `HasOnlyReadOnly`
"""
model = HasOnlyReadOnly() # noqa: E501
# model = petstore_api.models.has_only_read_only.HasOnlyReadOnly() # noqa: E501
if include_optional :
return HasOnlyReadOnly(
bar = '',
@ -42,7 +42,6 @@ class TestHasOnlyReadOnly(unittest.TestCase):
else :
return HasOnlyReadOnly(
)
"""
def testHasOnlyReadOnly(self):
"""Test HasOnlyReadOnly"""

View File

@ -3,19 +3,21 @@
"""
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
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 datetime
import petstore_api
from petstore_api.models.health_check_result import HealthCheckResult # noqa: E501
from petstore_api.rest import ApiException
class TestHealthCheckResult(unittest.TestCase):
"""HealthCheckResult unit test stubs"""
@ -26,14 +28,12 @@ class TestHealthCheckResult(unittest.TestCase):
def tearDown(self):
pass
def make_instance(self, include_optional) -> HealthCheckResult:
def make_instance(self, include_optional):
"""Test HealthCheckResult
include_option is a boolean, when False only required
params are included, when True both required and
optional params are included """
# uncomment below to create an instance of `HealthCheckResult`
"""
model = HealthCheckResult() # noqa: E501
# model = petstore_api.models.health_check_result.HealthCheckResult() # noqa: E501
if include_optional :
return HealthCheckResult(
nullable_message = ''
@ -41,7 +41,6 @@ class TestHealthCheckResult(unittest.TestCase):
else :
return HealthCheckResult(
)
"""
def testHealthCheckResult(self):
"""Test HealthCheckResult"""

View File

@ -3,19 +3,23 @@
"""
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
Generated by OpenAPI Generator (https://openapi-generator.tech)
Do not edit the class manually.
""" # noqa: E501
"""
from __future__ import absolute_import
import unittest
import datetime
import petstore_api
from petstore_api.models.inner_dict_with_property import InnerDictWithProperty # noqa: E501
from petstore_api.rest import ApiException
class TestInnerDictWithProperty(unittest.TestCase):
"""InnerDictWithProperty unit test stubs"""
@ -26,14 +30,14 @@ class TestInnerDictWithProperty(unittest.TestCase):
def tearDown(self):
pass
def make_instance(self, include_optional) -> InnerDictWithProperty:
def make_instance(self, include_optional):
"""Test InnerDictWithProperty
include_option is a boolean, when False only required
params are included, when True both required and
optional params are included """
# 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 :
return InnerDictWithProperty(
a_property = None

View File

@ -3,19 +3,21 @@
"""
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
Generated by OpenAPI Generator (https://openapi-generator.tech)
Do not edit the class manually.
""" # noqa: E501
"""
import unittest
import datetime
import petstore_api
from petstore_api.models.int_or_string import IntOrString # noqa: E501
from petstore_api.rest import ApiException
class TestIntOrString(unittest.TestCase):
"""IntOrString unit test stubs"""
@ -26,14 +28,14 @@ class TestIntOrString(unittest.TestCase):
def tearDown(self):
pass
def make_instance(self, include_optional) -> IntOrString:
def make_instance(self, include_optional):
"""Test IntOrString
include_option is a boolean, when False only required
params are included, when True both required and
optional params are included """
# 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 :
return IntOrString(
)

View File

@ -3,19 +3,21 @@
"""
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
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 datetime
import petstore_api
from petstore_api.models.list import List # noqa: E501
from petstore_api.rest import ApiException
class TestList(unittest.TestCase):
"""List unit test stubs"""
@ -26,22 +28,19 @@ class TestList(unittest.TestCase):
def tearDown(self):
pass
def make_instance(self, include_optional) -> List:
def make_instance(self, include_optional):
"""Test List
include_option is a boolean, when False only required
params are included, when True both required and
optional params are included """
# uncomment below to create an instance of `List`
"""
model = List() # noqa: E501
# model = petstore_api.models.list.List() # noqa: E501
if include_optional :
return List(
var_123_list = ''
_123_list = ''
)
else :
return List(
)
"""
def testList(self):
"""Test List"""

View File

@ -3,19 +3,21 @@
"""
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
Generated by OpenAPI Generator (https://openapi-generator.tech)
Do not edit the class manually.
""" # noqa: E501
"""
import unittest
import datetime
import petstore_api
from petstore_api.models.map_of_array_of_model import MapOfArrayOfModel # noqa: E501
from petstore_api.rest import ApiException
class TestMapOfArrayOfModel(unittest.TestCase):
"""MapOfArrayOfModel unit test stubs"""
@ -26,14 +28,14 @@ class TestMapOfArrayOfModel(unittest.TestCase):
def tearDown(self):
pass
def make_instance(self, include_optional) -> MapOfArrayOfModel:
def make_instance(self, include_optional):
"""Test MapOfArrayOfModel
include_option is a boolean, when False only required
params are included, when True both required and
optional params are included """
# 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 :
return MapOfArrayOfModel(
shop_id_to_org_online_lip_map = {

View File

@ -3,19 +3,21 @@
"""
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
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 datetime
import petstore_api
from petstore_api.models.map_test import MapTest # noqa: E501
from petstore_api.rest import ApiException
class TestMapTest(unittest.TestCase):
"""MapTest unit test stubs"""
@ -26,14 +28,12 @@ class TestMapTest(unittest.TestCase):
def tearDown(self):
pass
def make_instance(self, include_optional) -> MapTest:
def make_instance(self, include_optional):
"""Test MapTest
include_option is a boolean, when False only required
params are included, when True both required and
optional params are included """
# uncomment below to create an instance of `MapTest`
"""
model = MapTest() # noqa: E501
# model = petstore_api.models.map_test.MapTest() # noqa: E501
if include_optional :
return MapTest(
map_map_of_string = {
@ -54,7 +54,6 @@ class TestMapTest(unittest.TestCase):
else :
return MapTest(
)
"""
def testMapTest(self):
"""Test MapTest"""

View File

@ -3,19 +3,21 @@
"""
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
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 datetime
import petstore_api
from petstore_api.models.mixed_properties_and_additional_properties_class import MixedPropertiesAndAdditionalPropertiesClass # noqa: E501
from petstore_api.rest import ApiException
class TestMixedPropertiesAndAdditionalPropertiesClass(unittest.TestCase):
"""MixedPropertiesAndAdditionalPropertiesClass unit test stubs"""
@ -26,14 +28,12 @@ class TestMixedPropertiesAndAdditionalPropertiesClass(unittest.TestCase):
def tearDown(self):
pass
def make_instance(self, include_optional) -> MixedPropertiesAndAdditionalPropertiesClass:
def make_instance(self, include_optional):
"""Test MixedPropertiesAndAdditionalPropertiesClass
include_option is a boolean, when False only required
params are included, when True both required and
optional params are included """
# uncomment below to create an instance of `MixedPropertiesAndAdditionalPropertiesClass`
"""
model = MixedPropertiesAndAdditionalPropertiesClass() # noqa: E501
# model = petstore_api.models.mixed_properties_and_additional_properties_class.MixedPropertiesAndAdditionalPropertiesClass() # noqa: E501
if include_optional :
return MixedPropertiesAndAdditionalPropertiesClass(
uuid = '',
@ -47,7 +47,6 @@ class TestMixedPropertiesAndAdditionalPropertiesClass(unittest.TestCase):
else :
return MixedPropertiesAndAdditionalPropertiesClass(
)
"""
def testMixedPropertiesAndAdditionalPropertiesClass(self):
"""Test MixedPropertiesAndAdditionalPropertiesClass"""

View File

@ -3,19 +3,21 @@
"""
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
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 datetime
import petstore_api
from petstore_api.models.model200_response import Model200Response # noqa: E501
from petstore_api.rest import ApiException
class TestModel200Response(unittest.TestCase):
"""Model200Response unit test stubs"""
@ -26,23 +28,20 @@ class TestModel200Response(unittest.TestCase):
def tearDown(self):
pass
def make_instance(self, include_optional) -> Model200Response:
def make_instance(self, include_optional):
"""Test Model200Response
include_option is a boolean, when False only required
params are included, when True both required and
optional params are included """
# uncomment below to create an instance of `Model200Response`
"""
model = Model200Response() # noqa: E501
# model = petstore_api.models.model200_response.Model200Response() # noqa: E501
if include_optional :
return Model200Response(
name = 56,
var_class = ''
_class = ''
)
else :
return Model200Response(
)
"""
def testModel200Response(self):
"""Test Model200Response"""

View File

@ -3,19 +3,21 @@
"""
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
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 datetime
import petstore_api
from petstore_api.models.model_return import ModelReturn # noqa: E501
from petstore_api.rest import ApiException
class TestModelReturn(unittest.TestCase):
"""ModelReturn unit test stubs"""
@ -26,22 +28,19 @@ class TestModelReturn(unittest.TestCase):
def tearDown(self):
pass
def make_instance(self, include_optional) -> ModelReturn:
def make_instance(self, include_optional):
"""Test ModelReturn
include_option is a boolean, when False only required
params are included, when True both required and
optional params are included """
# uncomment below to create an instance of `ModelReturn`
"""
model = ModelReturn() # noqa: E501
# model = petstore_api.models.model_return.ModelReturn() # noqa: E501
if include_optional :
return ModelReturn(
var_return = 56
_return = 56
)
else :
return ModelReturn(
)
"""
def testModelReturn(self):
"""Test ModelReturn"""

View File

@ -3,19 +3,21 @@
"""
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
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 datetime
import petstore_api
from petstore_api.models.name import Name # noqa: E501
from petstore_api.rest import ApiException
class TestName(unittest.TestCase):
"""Name unit test stubs"""
@ -26,26 +28,23 @@ class TestName(unittest.TestCase):
def tearDown(self):
pass
def make_instance(self, include_optional) -> Name:
def make_instance(self, include_optional):
"""Test Name
include_option is a boolean, when False only required
params are included, when True both required and
optional params are included """
# uncomment below to create an instance of `Name`
"""
model = Name() # noqa: E501
# model = petstore_api.models.name.Name() # noqa: E501
if include_optional :
return Name(
name = 56,
snake_case = 56,
var_property = '',
var_123_number = 56
_property = '',
_123_number = 56
)
else :
return Name(
name = 56,
)
"""
def testName(self):
"""Test Name"""

View File

@ -3,19 +3,21 @@
"""
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
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 datetime
import petstore_api
from petstore_api.models.nullable_class import NullableClass # noqa: E501
from petstore_api.rest import ApiException
class TestNullableClass(unittest.TestCase):
"""NullableClass unit test stubs"""
@ -26,14 +28,12 @@ class TestNullableClass(unittest.TestCase):
def tearDown(self):
pass
def make_instance(self, include_optional) -> NullableClass:
def make_instance(self, include_optional):
"""Test NullableClass
include_option is a boolean, when False only required
params are included, when True both required and
optional params are included """
# uncomment below to create an instance of `NullableClass`
"""
model = NullableClass() # noqa: E501
# model = petstore_api.models.nullable_class.NullableClass() # noqa: E501
if include_optional :
return NullableClass(
required_integer_prop = 56,
@ -66,7 +66,6 @@ class TestNullableClass(unittest.TestCase):
return NullableClass(
required_integer_prop = 56,
)
"""
def testNullableClass(self):
"""Test NullableClass"""

View File

@ -3,19 +3,21 @@
"""
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
Generated by OpenAPI Generator (https://openapi-generator.tech)
Do not edit the class manually.
""" # noqa: E501
"""
import unittest
import datetime
import petstore_api
from petstore_api.models.nullable_property import NullableProperty # noqa: E501
from petstore_api.rest import ApiException
class TestNullableProperty(unittest.TestCase):
"""NullableProperty unit test stubs"""
@ -26,14 +28,14 @@ class TestNullableProperty(unittest.TestCase):
def tearDown(self):
pass
def make_instance(self, include_optional) -> NullableProperty:
def make_instance(self, include_optional):
"""Test NullableProperty
include_option is a boolean, when False only required
params are included, when True both required and
optional params are included """
# uncomment below to create an instance of `NullableProperty`
"""
model = NullableProperty() # noqa: E501
model = petstore_api.models.nullable_property.NullableProperty() # noqa: E501
if include_optional :
return NullableProperty(
id = 56,

View File

@ -3,19 +3,21 @@
"""
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
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 datetime
import petstore_api
from petstore_api.models.number_only import NumberOnly # noqa: E501
from petstore_api.rest import ApiException
class TestNumberOnly(unittest.TestCase):
"""NumberOnly unit test stubs"""
@ -26,14 +28,12 @@ class TestNumberOnly(unittest.TestCase):
def tearDown(self):
pass
def make_instance(self, include_optional) -> NumberOnly:
def make_instance(self, include_optional):
"""Test NumberOnly
include_option is a boolean, when False only required
params are included, when True both required and
optional params are included """
# uncomment below to create an instance of `NumberOnly`
"""
model = NumberOnly() # noqa: E501
# model = petstore_api.models.number_only.NumberOnly() # noqa: E501
if include_optional :
return NumberOnly(
just_number = 1.337
@ -41,7 +41,6 @@ class TestNumberOnly(unittest.TestCase):
else :
return NumberOnly(
)
"""
def testNumberOnly(self):
"""Test NumberOnly"""

View File

@ -3,19 +3,21 @@
"""
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
Generated by OpenAPI Generator (https://openapi-generator.tech)
Do not edit the class manually.
""" # noqa: E501
"""
import unittest
import datetime
import petstore_api
from petstore_api.models.object_to_test_additional_properties import ObjectToTestAdditionalProperties # noqa: E501
from petstore_api.rest import ApiException
class TestObjectToTestAdditionalProperties(unittest.TestCase):
"""ObjectToTestAdditionalProperties unit test stubs"""
@ -26,14 +28,14 @@ class TestObjectToTestAdditionalProperties(unittest.TestCase):
def tearDown(self):
pass
def make_instance(self, include_optional) -> ObjectToTestAdditionalProperties:
def make_instance(self, include_optional):
"""Test ObjectToTestAdditionalProperties
include_option is a boolean, when False only required
params are included, when True both required and
optional params are included """
# 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 :
return ObjectToTestAdditionalProperties(
var_property = True

View File

@ -3,19 +3,21 @@
"""
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
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 datetime
import petstore_api
from petstore_api.models.object_with_deprecated_fields import ObjectWithDeprecatedFields # noqa: E501
from petstore_api.rest import ApiException
class TestObjectWithDeprecatedFields(unittest.TestCase):
"""ObjectWithDeprecatedFields unit test stubs"""
@ -26,14 +28,12 @@ class TestObjectWithDeprecatedFields(unittest.TestCase):
def tearDown(self):
pass
def make_instance(self, include_optional) -> ObjectWithDeprecatedFields:
def make_instance(self, include_optional):
"""Test ObjectWithDeprecatedFields
include_option is a boolean, when False only required
params are included, when True both required and
optional params are included """
# uncomment below to create an instance of `ObjectWithDeprecatedFields`
"""
model = ObjectWithDeprecatedFields() # noqa: E501
# model = petstore_api.models.object_with_deprecated_fields.ObjectWithDeprecatedFields() # noqa: E501
if include_optional :
return ObjectWithDeprecatedFields(
uuid = '',
@ -47,7 +47,6 @@ class TestObjectWithDeprecatedFields(unittest.TestCase):
else :
return ObjectWithDeprecatedFields(
)
"""
def testObjectWithDeprecatedFields(self):
"""Test ObjectWithDeprecatedFields"""

View File

@ -3,19 +3,21 @@
"""
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
Generated by OpenAPI Generator (https://openapi-generator.tech)
Do not edit the class manually.
""" # noqa: E501
"""
import unittest
import datetime
import petstore_api
from petstore_api.models.one_of_enum_string import OneOfEnumString # noqa: E501
from petstore_api.rest import ApiException
class TestOneOfEnumString(unittest.TestCase):
"""OneOfEnumString unit test stubs"""
@ -26,14 +28,14 @@ class TestOneOfEnumString(unittest.TestCase):
def tearDown(self):
pass
def make_instance(self, include_optional) -> OneOfEnumString:
def make_instance(self, include_optional):
"""Test OneOfEnumString
include_option is a boolean, when False only required
params are included, when True both required and
optional params are included """
# 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 :
return OneOfEnumString(
)

View File

@ -3,19 +3,21 @@
"""
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
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 datetime
import petstore_api
from petstore_api.models.order import Order # noqa: E501
from petstore_api.rest import ApiException
class TestOrder(unittest.TestCase):
"""Order unit test stubs"""
@ -26,14 +28,12 @@ class TestOrder(unittest.TestCase):
def tearDown(self):
pass
def make_instance(self, include_optional) -> Order:
def make_instance(self, include_optional):
"""Test Order
include_option is a boolean, when False only required
params are included, when True both required and
optional params are included """
# uncomment below to create an instance of `Order`
"""
model = Order() # noqa: E501
# model = petstore_api.models.order.Order() # noqa: E501
if include_optional :
return Order(
id = 56,
@ -46,7 +46,6 @@ class TestOrder(unittest.TestCase):
else :
return Order(
)
"""
def testOrder(self):
"""Test Order"""

View File

@ -3,19 +3,21 @@
"""
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
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 datetime
import petstore_api
from petstore_api.models.outer_composite import OuterComposite # noqa: E501
from petstore_api.rest import ApiException
class TestOuterComposite(unittest.TestCase):
"""OuterComposite unit test stubs"""
@ -26,14 +28,12 @@ class TestOuterComposite(unittest.TestCase):
def tearDown(self):
pass
def make_instance(self, include_optional) -> OuterComposite:
def make_instance(self, include_optional):
"""Test OuterComposite
include_option is a boolean, when False only required
params are included, when True both required and
optional params are included """
# uncomment below to create an instance of `OuterComposite`
"""
model = OuterComposite() # noqa: E501
# model = petstore_api.models.outer_composite.OuterComposite() # noqa: E501
if include_optional :
return OuterComposite(
my_number = 1.337,
@ -43,7 +43,6 @@ class TestOuterComposite(unittest.TestCase):
else :
return OuterComposite(
)
"""
def testOuterComposite(self):
"""Test OuterComposite"""

View File

@ -3,19 +3,21 @@
"""
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
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 datetime
import petstore_api
from petstore_api.models.outer_enum import OuterEnum # noqa: E501
from petstore_api.rest import ApiException
class TestOuterEnum(unittest.TestCase):
"""OuterEnum unit test stubs"""

View File

@ -3,19 +3,21 @@
"""
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
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 datetime
import petstore_api
from petstore_api.models.outer_enum_default_value import OuterEnumDefaultValue # noqa: E501
from petstore_api.rest import ApiException
class TestOuterEnumDefaultValue(unittest.TestCase):
"""OuterEnumDefaultValue unit test stubs"""

View File

@ -3,19 +3,21 @@
"""
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
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 datetime
import petstore_api
from petstore_api.models.outer_enum_integer import OuterEnumInteger # noqa: E501
from petstore_api.rest import ApiException
class TestOuterEnumInteger(unittest.TestCase):
"""OuterEnumInteger unit test stubs"""

View File

@ -3,19 +3,21 @@
"""
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
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 datetime
import petstore_api
from petstore_api.models.outer_enum_integer_default_value import OuterEnumIntegerDefaultValue # noqa: E501
from petstore_api.rest import ApiException
class TestOuterEnumIntegerDefaultValue(unittest.TestCase):
"""OuterEnumIntegerDefaultValue unit test stubs"""

View File

@ -3,19 +3,21 @@
"""
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
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 datetime
import petstore_api
from petstore_api.models.outer_object_with_enum_property import OuterObjectWithEnumProperty # noqa: E501
from petstore_api.rest import ApiException
class TestOuterObjectWithEnumProperty(unittest.TestCase):
"""OuterObjectWithEnumProperty unit test stubs"""
@ -26,24 +28,20 @@ class TestOuterObjectWithEnumProperty(unittest.TestCase):
def tearDown(self):
pass
def make_instance(self, include_optional) -> OuterObjectWithEnumProperty:
def make_instance(self, include_optional):
"""Test OuterObjectWithEnumProperty
include_option is a boolean, when False only required
params are included, when True both required and
optional params are included """
# uncomment below to create an instance of `OuterObjectWithEnumProperty`
"""
model = OuterObjectWithEnumProperty() # noqa: E501
# model = petstore_api.models.outer_object_with_enum_property.OuterObjectWithEnumProperty() # noqa: E501
if include_optional :
return OuterObjectWithEnumProperty(
str_value = 'placed',
value = 2
)
else :
return OuterObjectWithEnumProperty(
value = 2,
)
"""
def testOuterObjectWithEnumProperty(self):
"""Test OuterObjectWithEnumProperty"""

View File

@ -3,19 +3,21 @@
"""
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
Generated by OpenAPI Generator (https://openapi-generator.tech)
Do not edit the class manually.
""" # noqa: E501
"""
import unittest
import datetime
import petstore_api
from petstore_api.models.parent import Parent # noqa: E501
from petstore_api.rest import ApiException
class TestParent(unittest.TestCase):
"""Parent unit test stubs"""
@ -26,14 +28,14 @@ class TestParent(unittest.TestCase):
def tearDown(self):
pass
def make_instance(self, include_optional) -> Parent:
def make_instance(self, include_optional):
"""Test Parent
include_option is a boolean, when False only required
params are included, when True both required and
optional params are included """
# uncomment below to create an instance of `Parent`
"""
model = Parent() # noqa: E501
model = petstore_api.models.parent.Parent() # noqa: E501
if include_optional :
return Parent(
optional_dict = {

View File

@ -3,19 +3,23 @@
"""
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
Generated by OpenAPI Generator (https://openapi-generator.tech)
Do not edit the class manually.
""" # noqa: E501
"""
from __future__ import absolute_import
import unittest
import datetime
import petstore_api
from petstore_api.models.parent_with_optional_dict import ParentWithOptionalDict # noqa: E501
from petstore_api.rest import ApiException
class TestParentWithOptionalDict(unittest.TestCase):
"""ParentWithOptionalDict unit test stubs"""
@ -26,14 +30,14 @@ class TestParentWithOptionalDict(unittest.TestCase):
def tearDown(self):
pass
def make_instance(self, include_optional) -> ParentWithOptionalDict:
def make_instance(self, include_optional):
"""Test ParentWithOptionalDict
include_option is a boolean, when False only required
params are included, when True both required and
optional params are included """
# 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 :
return ParentWithOptionalDict(
optional_dict = {

View File

@ -3,19 +3,21 @@
"""
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
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 datetime
import petstore_api
from petstore_api.models.pet import Pet # noqa: E501
from petstore_api.rest import ApiException
class TestPet(unittest.TestCase):
"""Pet unit test stubs"""
@ -26,14 +28,12 @@ class TestPet(unittest.TestCase):
def tearDown(self):
pass
def make_instance(self, include_optional) -> Pet:
def make_instance(self, include_optional):
"""Test Pet
include_option is a boolean, when False only required
params are included, when True both required and
optional params are included """
# uncomment below to create an instance of `Pet`
"""
model = Pet() # noqa: E501
# model = petstore_api.models.pet.Pet() # noqa: E501
if include_optional :
return Pet(
id = 56,
@ -58,7 +58,6 @@ class TestPet(unittest.TestCase):
''
],
)
"""
def testPet(self):
"""Test Pet"""

View File

@ -3,86 +3,88 @@
"""
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
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 petstore_api
from petstore_api.api.pet_api import PetApi # noqa: E501
from petstore_api.rest import ApiException
class TestPetApi(unittest.TestCase):
"""PetApi unit test stubs"""
def setUp(self) -> None:
self.api = PetApi() # noqa: E501
def setUp(self):
self.api = petstore_api.api.pet_api.PetApi() # noqa: E501
def tearDown(self) -> None:
def tearDown(self):
pass
def test_add_pet(self) -> None:
def test_add_pet(self):
"""Test case for add_pet
Add a new pet to the store # noqa: E501
"""
pass
def test_delete_pet(self) -> None:
def test_delete_pet(self):
"""Test case for delete_pet
Deletes a pet # noqa: E501
"""
pass
def test_find_pets_by_status(self) -> None:
def test_find_pets_by_status(self):
"""Test case for find_pets_by_status
Finds Pets by status # noqa: E501
"""
pass
def test_find_pets_by_tags(self) -> None:
def test_find_pets_by_tags(self):
"""Test case for find_pets_by_tags
Finds Pets by tags # noqa: E501
"""
pass
def test_get_pet_by_id(self) -> None:
def test_get_pet_by_id(self):
"""Test case for get_pet_by_id
Find pet by ID # noqa: E501
"""
pass
def test_update_pet(self) -> None:
def test_update_pet(self):
"""Test case for update_pet
Update an existing pet # noqa: E501
"""
pass
def test_update_pet_with_form(self) -> None:
def test_update_pet_with_form(self):
"""Test case for update_pet_with_form
Updates a pet in the store with form data # noqa: E501
"""
pass
def test_upload_file(self) -> None:
def test_upload_file(self):
"""Test case for upload_file
uploads an image # noqa: E501
"""
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
uploads an image (required) # noqa: E501

View File

@ -3,19 +3,21 @@
"""
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
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 datetime
import petstore_api
from petstore_api.models.pig import Pig # noqa: E501
from petstore_api.rest import ApiException
class TestPig(unittest.TestCase):
"""Pig unit test stubs"""
@ -26,14 +28,12 @@ class TestPig(unittest.TestCase):
def tearDown(self):
pass
def make_instance(self, include_optional) -> Pig:
def make_instance(self, include_optional):
"""Test Pig
include_option is a boolean, when False only required
params are included, when True both required and
optional params are included """
# uncomment below to create an instance of `Pig`
"""
model = Pig() # noqa: E501
# model = petstore_api.models.pig.Pig() # noqa: E501
if include_optional :
return Pig(
class_name = '',
@ -46,7 +46,6 @@ class TestPig(unittest.TestCase):
color = '',
size = 56,
)
"""
def testPig(self):
"""Test Pig"""

Some files were not shown because too many files have changed in this diff Show More