Merge remote-tracking branch 'origin/master' into 4.3.x

This commit is contained in:
William Cheng
2019-12-28 12:00:09 +08:00
761 changed files with 40748 additions and 6074 deletions

View File

@@ -45,7 +45,9 @@ coverage.xml
*,cover
.hypothesis/
venv/
.venv/
.python-version
.pytest_cache
# Translations
*.mo

View File

@@ -127,6 +127,8 @@ Class | Method | HTTP request | Description
- [ArrayOfArrayOfNumberOnly](docs/ArrayOfArrayOfNumberOnly.md)
- [ArrayOfNumberOnly](docs/ArrayOfNumberOnly.md)
- [ArrayTest](docs/ArrayTest.md)
- [BigCat](docs/BigCat.md)
- [BigCatAllOf](docs/BigCatAllOf.md)
- [Capitalization](docs/Capitalization.md)
- [Cat](docs/Cat.md)
- [CatAllOf](docs/CatAllOf.md)

View File

@@ -1,4 +1,2 @@
tox
coverage
randomize
flake8

View File

@@ -0,0 +1,10 @@
# BigCat
## Properties
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**kind** | **str** | | [optional]
[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)

View File

@@ -0,0 +1,10 @@
# BigCatAllOf
## Properties
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**kind** | **str** | | [optional]
[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)

View File

@@ -46,6 +46,8 @@ from petstore_api.models.api_response import ApiResponse
from petstore_api.models.array_of_array_of_number_only import ArrayOfArrayOfNumberOnly
from petstore_api.models.array_of_number_only import ArrayOfNumberOnly
from petstore_api.models.array_test import ArrayTest
from petstore_api.models.big_cat import BigCat
from petstore_api.models.big_cat_all_of import BigCatAllOf
from petstore_api.models.capitalization import Capitalization
from petstore_api.models.cat import Cat
from petstore_api.models.cat_all_of import CatAllOf

View File

@@ -27,6 +27,8 @@ from petstore_api.models.api_response import ApiResponse
from petstore_api.models.array_of_array_of_number_only import ArrayOfArrayOfNumberOnly
from petstore_api.models.array_of_number_only import ArrayOfNumberOnly
from petstore_api.models.array_test import ArrayTest
from petstore_api.models.big_cat import BigCat
from petstore_api.models.big_cat_all_of import BigCatAllOf
from petstore_api.models.capitalization import Capitalization
from petstore_api.models.cat import Cat
from petstore_api.models.cat_all_of import CatAllOf

View File

@@ -44,7 +44,8 @@ class Animal(object):
discriminator_value_class_map = {
'Dog': 'Dog',
'Cat': 'Cat'
'Cat': 'Cat',
'BigCat': 'BigCat'
}
def __init__(self, class_name=None, color='red', local_vars_configuration=None): # noqa: E501

View File

@@ -0,0 +1,126 @@
# coding: utf-8
"""
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: \" \\ # noqa: E501
The version of the OpenAPI document: 1.0.0
Generated by: https://openapi-generator.tech
"""
import pprint
import re # noqa: F401
import six
from petstore_api.configuration import Configuration
class BigCat(object):
"""NOTE: This class is auto generated by OpenAPI Generator.
Ref: https://openapi-generator.tech
Do not edit the class manually.
"""
"""
Attributes:
openapi_types (dict): The key is attribute name
and the value is attribute type.
attribute_map (dict): The key is attribute name
and the value is json key in definition.
"""
openapi_types = {
'kind': 'str'
}
attribute_map = {
'kind': 'kind'
}
def __init__(self, kind=None, local_vars_configuration=None): # noqa: E501
"""BigCat - a model defined in OpenAPI""" # noqa: E501
if local_vars_configuration is None:
local_vars_configuration = Configuration()
self.local_vars_configuration = local_vars_configuration
self._kind = None
self.discriminator = None
if kind is not None:
self.kind = kind
@property
def kind(self):
"""Gets the kind of this BigCat. # noqa: E501
:return: The kind of this BigCat. # noqa: E501
:rtype: str
"""
return self._kind
@kind.setter
def kind(self, kind):
"""Sets the kind of this BigCat.
:param kind: The kind of this BigCat. # noqa: E501
:type: str
"""
allowed_values = ["lions", "tigers", "leopards", "jaguars"] # noqa: E501
if self.local_vars_configuration.client_side_validation and kind not in allowed_values: # noqa: E501
raise ValueError(
"Invalid value for `kind` ({0}), must be one of {1}" # noqa: E501
.format(kind, allowed_values)
)
self._kind = kind
def to_dict(self):
"""Returns the model properties as a dict"""
result = {}
for attr, _ in six.iteritems(self.openapi_types):
value = getattr(self, attr)
if isinstance(value, list):
result[attr] = list(map(
lambda x: x.to_dict() if hasattr(x, "to_dict") else x,
value
))
elif hasattr(value, "to_dict"):
result[attr] = value.to_dict()
elif isinstance(value, dict):
result[attr] = dict(map(
lambda item: (item[0], item[1].to_dict())
if hasattr(item[1], "to_dict") else item,
value.items()
))
else:
result[attr] = value
return result
def to_str(self):
"""Returns the string representation of the model"""
return pprint.pformat(self.to_dict())
def __repr__(self):
"""For `print` and `pprint`"""
return self.to_str()
def __eq__(self, other):
"""Returns true if both objects are equal"""
if not isinstance(other, BigCat):
return False
return self.to_dict() == other.to_dict()
def __ne__(self, other):
"""Returns true if both objects are not equal"""
if not isinstance(other, BigCat):
return True
return self.to_dict() != other.to_dict()

View File

@@ -0,0 +1,126 @@
# coding: utf-8
"""
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: \" \\ # noqa: E501
The version of the OpenAPI document: 1.0.0
Generated by: https://openapi-generator.tech
"""
import pprint
import re # noqa: F401
import six
from petstore_api.configuration import Configuration
class BigCatAllOf(object):
"""NOTE: This class is auto generated by OpenAPI Generator.
Ref: https://openapi-generator.tech
Do not edit the class manually.
"""
"""
Attributes:
openapi_types (dict): The key is attribute name
and the value is attribute type.
attribute_map (dict): The key is attribute name
and the value is json key in definition.
"""
openapi_types = {
'kind': 'str'
}
attribute_map = {
'kind': 'kind'
}
def __init__(self, kind=None, local_vars_configuration=None): # noqa: E501
"""BigCatAllOf - a model defined in OpenAPI""" # noqa: E501
if local_vars_configuration is None:
local_vars_configuration = Configuration()
self.local_vars_configuration = local_vars_configuration
self._kind = None
self.discriminator = None
if kind is not None:
self.kind = kind
@property
def kind(self):
"""Gets the kind of this BigCatAllOf. # noqa: E501
:return: The kind of this BigCatAllOf. # noqa: E501
:rtype: str
"""
return self._kind
@kind.setter
def kind(self, kind):
"""Sets the kind of this BigCatAllOf.
:param kind: The kind of this BigCatAllOf. # noqa: E501
:type: str
"""
allowed_values = ["lions", "tigers", "leopards", "jaguars"] # noqa: E501
if self.local_vars_configuration.client_side_validation and kind not in allowed_values: # noqa: E501
raise ValueError(
"Invalid value for `kind` ({0}), must be one of {1}" # noqa: E501
.format(kind, allowed_values)
)
self._kind = kind
def to_dict(self):
"""Returns the model properties as a dict"""
result = {}
for attr, _ in six.iteritems(self.openapi_types):
value = getattr(self, attr)
if isinstance(value, list):
result[attr] = list(map(
lambda x: x.to_dict() if hasattr(x, "to_dict") else x,
value
))
elif hasattr(value, "to_dict"):
result[attr] = value.to_dict()
elif isinstance(value, dict):
result[attr] = dict(map(
lambda item: (item[0], item[1].to_dict())
if hasattr(item[1], "to_dict") else item,
value.items()
))
else:
result[attr] = value
return result
def to_str(self):
"""Returns the string representation of the model"""
return pprint.pformat(self.to_dict())
def __repr__(self):
"""For `print` and `pprint`"""
return self.to_str()
def __eq__(self, other):
"""Returns true if both objects are equal"""
if not isinstance(other, BigCatAllOf):
return False
return self.to_dict() == other.to_dict()
def __ne__(self, other):
"""Returns true if both objects are not equal"""
if not isinstance(other, BigCatAllOf):
return True
return self.to_dict() != other.to_dict()

View File

@@ -0,0 +1,2 @@
[flake8]
max-line-length=99

View File

@@ -1,5 +1,3 @@
pytest>=3.6.0
pytest-cov>=2.6.1
pluggy>=0.3.1
py>=1.4.31
randomize>=0.13
pytest~=4.6.7 # needed for python 2.7+3.4
pytest-cov>=2.8.1
pytest-randomly==1.2.3 # needed for python 2.7+3.4

View File

@@ -0,0 +1,39 @@
# coding: utf-8
"""
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: \" \\ # noqa: E501
The version of the OpenAPI document: 1.0.0
Generated by: https://openapi-generator.tech
"""
from __future__ import absolute_import
import unittest
import petstore_api
from petstore_api.models.big_cat import BigCat # noqa: E501
from petstore_api.rest import ApiException
class TestBigCat(unittest.TestCase):
"""BigCat unit test stubs"""
def setUp(self):
pass
def tearDown(self):
pass
def testBigCat(self):
"""Test BigCat"""
# FIXME: construct object with mandatory attributes with example values
# model = petstore_api.models.big_cat.BigCat() # noqa: E501
pass
if __name__ == '__main__':
unittest.main()

View File

@@ -0,0 +1,39 @@
# coding: utf-8
"""
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: \" \\ # noqa: E501
The version of the OpenAPI document: 1.0.0
Generated by: https://openapi-generator.tech
"""
from __future__ import absolute_import
import unittest
import petstore_api
from petstore_api.models.big_cat_all_of import BigCatAllOf # noqa: E501
from petstore_api.rest import ApiException
class TestBigCatAllOf(unittest.TestCase):
"""BigCatAllOf unit test stubs"""
def setUp(self):
pass
def tearDown(self):
pass
def testBigCatAllOf(self):
"""Test BigCatAllOf"""
# FIXME: construct object with mandatory attributes with example values
# model = petstore_api.models.big_cat_all_of.BigCatAllOf() # noqa: E501
pass
if __name__ == '__main__':
unittest.main()

View File

@@ -18,7 +18,6 @@ fi
### install dependencies
pip install -r $REQUIREMENTS_FILE | tee -a $REQUIREMENTS_OUT
python setup.py develop
### run tests
tox || exit 1

View File

@@ -6,4 +6,4 @@ deps=-r{toxinidir}/requirements.txt
-r{toxinidir}/test-requirements.txt
commands=
pytest -v --cov petstore_api
pytest --cov=petstore_api