[Python] Fix issue with CI due to dependency (#4716)

* Issue 4637 Fix for ci build (#4643)

* [Python] update python requirement.txt and use single quote for safe characters (#4702)

* update python requirement

* update petstore sample
This commit is contained in:
wing328 2017-02-05 23:51:35 +08:00 committed by GitHub
parent 8e036f24f9
commit 64d0c403d0
13 changed files with 297 additions and 415 deletions

View File

@ -1,5 +1,5 @@
certifi >= 14.05.14
six == 1.8.0
six >= 1.10
python_dateutil >= 2.5.3
setuptools >= 21.0.0
urllib3 >= 1.15.1

View File

@ -104,6 +104,7 @@ Class | Method | HTTP request | Description
- [ArrayOfArrayOfNumberOnly](docs/ArrayOfArrayOfNumberOnly.md)
- [ArrayOfNumberOnly](docs/ArrayOfNumberOnly.md)
- [ArrayTest](docs/ArrayTest.md)
- [Capitalization](docs/Capitalization.md)
- [Cat](docs/Cat.md)
- [Category](docs/Category.md)
- [ClassModel](docs/ClassModel.md)

View File

@ -0,0 +1,15 @@
# Capitalization
## Properties
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**small_camel** | **str** | | [optional]
**capital_camel** | **str** | | [optional]
**small_snake** | **str** | | [optional]
**capital_snake** | **str** | | [optional]
**sca_eth_flow_points** | **str** | | [optional]
**att_name** | **str** | Name of the pet | [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

@ -21,6 +21,7 @@ from .models.api_response import ApiResponse
from .models.array_of_array_of_number_only import ArrayOfArrayOfNumberOnly
from .models.array_of_number_only import ArrayOfNumberOnly
from .models.array_test import ArrayTest
from .models.capitalization import Capitalization
from .models.cat import Cat
from .models.category import Category
from .models.class_model import ClassModel

View File

@ -116,7 +116,7 @@ class ApiClient(object):
collection_formats)
for k, v in path_params:
resource_path = resource_path.replace(
'{%s}' % k, quote(str(v)))
'{%s}' % k, quote(str(v), safe='')) # no safe chars, encode everything
# query parameters
if query_params:

View File

@ -105,8 +105,6 @@ class StoreApi(object):
if ('order_id' not in params) or (params['order_id'] is None):
raise ValueError("Missing the required parameter `order_id` when calling `delete_order`")
if 'order_id' in params and params['order_id'] < 1.0:
raise ValueError("Invalid value for parameter `order_id` when calling `delete_order`, must be a value greater than or equal to `1.0`")
collection_formats = {}

View File

@ -21,6 +21,7 @@ from .api_response import ApiResponse
from .array_of_array_of_number_only import ArrayOfArrayOfNumberOnly
from .array_of_number_only import ArrayOfNumberOnly
from .array_test import ArrayTest
from .capitalization import Capitalization
from .cat import Cat
from .category import Category
from .class_model import ClassModel

View File

@ -0,0 +1,234 @@
# coding: utf-8
"""
Swagger 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: \" \\
OpenAPI spec version: 1.0.0
Contact: apiteam@swagger.io
Generated by: https://github.com/swagger-api/swagger-codegen.git
"""
from pprint import pformat
from six import iteritems
import re
class Capitalization(object):
"""
NOTE: This class is auto generated by the swagger code generator program.
Do not edit the class manually.
"""
def __init__(self, small_camel=None, capital_camel=None, small_snake=None, capital_snake=None, sca_eth_flow_points=None, att_name=None):
"""
Capitalization - a model defined in Swagger
:param dict swaggerTypes: The key is attribute name
and the value is attribute type.
:param dict attributeMap: The key is attribute name
and the value is json key in definition.
"""
self.swagger_types = {
'small_camel': 'str',
'capital_camel': 'str',
'small_snake': 'str',
'capital_snake': 'str',
'sca_eth_flow_points': 'str',
'att_name': 'str'
}
self.attribute_map = {
'small_camel': 'smallCamel',
'capital_camel': 'CapitalCamel',
'small_snake': 'small_Snake',
'capital_snake': 'Capital_Snake',
'sca_eth_flow_points': 'SCA_ETH_Flow_Points',
'att_name': 'ATT_NAME'
}
self._small_camel = small_camel
self._capital_camel = capital_camel
self._small_snake = small_snake
self._capital_snake = capital_snake
self._sca_eth_flow_points = sca_eth_flow_points
self._att_name = att_name
@property
def small_camel(self):
"""
Gets the small_camel of this Capitalization.
:return: The small_camel of this Capitalization.
:rtype: str
"""
return self._small_camel
@small_camel.setter
def small_camel(self, small_camel):
"""
Sets the small_camel of this Capitalization.
:param small_camel: The small_camel of this Capitalization.
:type: str
"""
self._small_camel = small_camel
@property
def capital_camel(self):
"""
Gets the capital_camel of this Capitalization.
:return: The capital_camel of this Capitalization.
:rtype: str
"""
return self._capital_camel
@capital_camel.setter
def capital_camel(self, capital_camel):
"""
Sets the capital_camel of this Capitalization.
:param capital_camel: The capital_camel of this Capitalization.
:type: str
"""
self._capital_camel = capital_camel
@property
def small_snake(self):
"""
Gets the small_snake of this Capitalization.
:return: The small_snake of this Capitalization.
:rtype: str
"""
return self._small_snake
@small_snake.setter
def small_snake(self, small_snake):
"""
Sets the small_snake of this Capitalization.
:param small_snake: The small_snake of this Capitalization.
:type: str
"""
self._small_snake = small_snake
@property
def capital_snake(self):
"""
Gets the capital_snake of this Capitalization.
:return: The capital_snake of this Capitalization.
:rtype: str
"""
return self._capital_snake
@capital_snake.setter
def capital_snake(self, capital_snake):
"""
Sets the capital_snake of this Capitalization.
:param capital_snake: The capital_snake of this Capitalization.
:type: str
"""
self._capital_snake = capital_snake
@property
def sca_eth_flow_points(self):
"""
Gets the sca_eth_flow_points of this Capitalization.
:return: The sca_eth_flow_points of this Capitalization.
:rtype: str
"""
return self._sca_eth_flow_points
@sca_eth_flow_points.setter
def sca_eth_flow_points(self, sca_eth_flow_points):
"""
Sets the sca_eth_flow_points of this Capitalization.
:param sca_eth_flow_points: The sca_eth_flow_points of this Capitalization.
:type: str
"""
self._sca_eth_flow_points = sca_eth_flow_points
@property
def att_name(self):
"""
Gets the att_name of this Capitalization.
Name of the pet
:return: The att_name of this Capitalization.
:rtype: str
"""
return self._att_name
@att_name.setter
def att_name(self, att_name):
"""
Sets the att_name of this Capitalization.
Name of the pet
:param att_name: The att_name of this Capitalization.
:type: str
"""
self._att_name = att_name
def to_dict(self):
"""
Returns the model properties as a dict
"""
result = {}
for attr, _ in iteritems(self.swagger_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 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
"""
return self.__dict__ == other.__dict__
def __ne__(self, other):
"""
Returns true if both objects are not equal
"""
return not self == other

View File

@ -1,5 +1,5 @@
certifi >= 14.05.14
six == 1.8.0
six >= 1.10
python_dateutil >= 2.5.3
setuptools >= 21.0.0
urllib3 >= 1.15.1

View File

@ -1,120 +0,0 @@
# coding: utf-8
"""
Copyright 2016 SmartBear Software
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
Ref: https://github.com/swagger-api/swagger-codegen
"""
from pprint import pformat
from six import iteritems
class Animal(object):
"""
NOTE: This class is auto generated by the swagger code generator program.
Do not edit the class manually.
"""
def __init__(self):
"""
Animal - a model defined in Swagger
:param dict swaggerTypes: The key is attribute name
and the value is attribute type.
:param dict attributeMap: The key is attribute name
and the value is json key in definition.
"""
self.swagger_types = {
'class_name': 'str'
}
self.attribute_map = {
'class_name': 'className'
}
self._class_name = None
@property
def class_name(self):
"""
Gets the class_name of this Animal.
:return: The class_name of this Animal.
:rtype: str
"""
return self._class_name
@class_name.setter
def class_name(self, class_name):
"""
Sets the class_name of this Animal.
:param class_name: The class_name of this Animal.
:type: str
"""
self._class_name = class_name
def to_dict(self):
"""
Returns the model properties as a dict
"""
result = {}
for attr, _ in iteritems(self.swagger_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 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
"""
return self.__dict__ == other.__dict__
def __ne__(self, other):
"""
Returns true if both objects are not equal
"""
return not self == other

View File

@ -1,145 +0,0 @@
# coding: utf-8
"""
Copyright 2016 SmartBear Software
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
Ref: https://github.com/swagger-api/swagger-codegen
"""
from pprint import pformat
from six import iteritems
class Cat(object):
"""
NOTE: This class is auto generated by the swagger code generator program.
Do not edit the class manually.
"""
def __init__(self):
"""
Cat - a model defined in Swagger
:param dict swaggerTypes: The key is attribute name
and the value is attribute type.
:param dict attributeMap: The key is attribute name
and the value is json key in definition.
"""
self.swagger_types = {
'class_name': 'str',
'declawed': 'bool'
}
self.attribute_map = {
'class_name': 'className',
'declawed': 'declawed'
}
self._class_name = None
self._declawed = None
@property
def class_name(self):
"""
Gets the class_name of this Cat.
:return: The class_name of this Cat.
:rtype: str
"""
return self._class_name
@class_name.setter
def class_name(self, class_name):
"""
Sets the class_name of this Cat.
:param class_name: The class_name of this Cat.
:type: str
"""
self._class_name = class_name
@property
def declawed(self):
"""
Gets the declawed of this Cat.
:return: The declawed of this Cat.
:rtype: bool
"""
return self._declawed
@declawed.setter
def declawed(self, declawed):
"""
Sets the declawed of this Cat.
:param declawed: The declawed of this Cat.
:type: bool
"""
self._declawed = declawed
def to_dict(self):
"""
Returns the model properties as a dict
"""
result = {}
for attr, _ in iteritems(self.swagger_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 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
"""
return self.__dict__ == other.__dict__
def __ne__(self, other):
"""
Returns true if both objects are not equal
"""
return not self == other

View File

@ -1,145 +0,0 @@
# coding: utf-8
"""
Copyright 2016 SmartBear Software
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
Ref: https://github.com/swagger-api/swagger-codegen
"""
from pprint import pformat
from six import iteritems
class Dog(object):
"""
NOTE: This class is auto generated by the swagger code generator program.
Do not edit the class manually.
"""
def __init__(self):
"""
Dog - a model defined in Swagger
:param dict swaggerTypes: The key is attribute name
and the value is attribute type.
:param dict attributeMap: The key is attribute name
and the value is json key in definition.
"""
self.swagger_types = {
'class_name': 'str',
'breed': 'str'
}
self.attribute_map = {
'class_name': 'className',
'breed': 'breed'
}
self._class_name = None
self._breed = None
@property
def class_name(self):
"""
Gets the class_name of this Dog.
:return: The class_name of this Dog.
:rtype: str
"""
return self._class_name
@class_name.setter
def class_name(self, class_name):
"""
Sets the class_name of this Dog.
:param class_name: The class_name of this Dog.
:type: str
"""
self._class_name = class_name
@property
def breed(self):
"""
Gets the breed of this Dog.
:return: The breed of this Dog.
:rtype: str
"""
return self._breed
@breed.setter
def breed(self, breed):
"""
Sets the breed of this Dog.
:param breed: The breed of this Dog.
:type: str
"""
self._breed = breed
def to_dict(self):
"""
Returns the model properties as a dict
"""
result = {}
for attr, _ in iteritems(self.swagger_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 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
"""
return self.__dict__ == other.__dict__
def __ne__(self, other):
"""
Returns true if both objects are not equal
"""
return not self == other

View File

@ -0,0 +1,42 @@
# coding: utf-8
"""
Swagger 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: \" \\
OpenAPI spec version: 1.0.0
Contact: apiteam@swagger.io
Generated by: https://github.com/swagger-api/swagger-codegen.git
"""
from __future__ import absolute_import
import os
import sys
import unittest
import petstore_api
from petstore_api.rest import ApiException
from petstore_api.models.capitalization import Capitalization
class TestCapitalization(unittest.TestCase):
""" Capitalization unit test stubs """
def setUp(self):
pass
def tearDown(self):
pass
def testCapitalization(self):
"""
Test Capitalization
"""
model = petstore_api.models.capitalization.Capitalization()
if __name__ == '__main__':
unittest.main()