Merge remote-tracking branch 'origin/6.3.x' into 7.0.x

This commit is contained in:
William Cheng
2022-10-16 21:27:53 +08:00
11745 changed files with 669618 additions and 201259 deletions

View File

@@ -37,9 +37,9 @@ class ApiResponse(Model):
'message': 'message'
}
self._code = code
self._type = type
self._message = message
self.code = code
self.type = type
self.message = message
@classmethod
def from_dict(cls, dikt) -> 'ApiResponse':

View File

@@ -8,7 +8,7 @@ from openapi_server import util
T = typing.TypeVar('T')
class Model():
class Model(object):
# openapiTypes: The key is attribute name and the
# value is attribute type.
openapi_types: typing.Dict[str, type] = {}

View File

@@ -33,8 +33,8 @@ class Category(Model):
'name': 'name'
}
self._id = id
self._name = name
self.id = id
self.name = name
@classmethod
def from_dict(cls, dikt) -> 'Category':

View File

@@ -49,12 +49,12 @@ class Order(Model):
'complete': 'complete'
}
self._id = id
self._pet_id = pet_id
self._quantity = quantity
self._ship_date = ship_date
self._status = status
self._complete = complete
self.id = id
self.pet_id = pet_id
self.quantity = quantity
self.ship_date = ship_date
self.status = status
self.complete = complete
@classmethod
def from_dict(cls, dikt) -> 'Order':

View File

@@ -53,12 +53,12 @@ class Pet(Model):
'status': 'status'
}
self._id = id
self._category = category
self._name = name
self._photo_urls = photo_urls
self._tags = tags
self._status = status
self.id = id
self.category = category
self.name = name
self.photo_urls = photo_urls
self.tags = tags
self.status = status
@classmethod
def from_dict(cls, dikt) -> 'Pet':

View File

@@ -33,8 +33,8 @@ class Tag(Model):
'name': 'name'
}
self._id = id
self._name = name
self.id = id
self.name = name
@classmethod
def from_dict(cls, dikt) -> 'Tag':

View File

@@ -57,14 +57,14 @@ class User(Model):
'user_status': 'userStatus'
}
self._id = id
self._username = username
self._first_name = first_name
self._last_name = last_name
self._email = email
self._password = password
self._phone = phone
self._user_status = user_status
self.id = id
self.username = username
self.first_name = first_name
self.last_name = last_name
self.email = email
self.password = password
self.phone = phone
self.user_status = user_status
@classmethod
def from_dict(cls, dikt) -> 'User':

View File

@@ -14,7 +14,7 @@ from openapi_server.test import BaseTestCase
class TestPetController(BaseTestCase):
"""PetController integration test stubs"""
@unittest.skip("Connexion does not support multiple consummes. See https://github.com/zalando/connexion/pull/760")
@unittest.skip("Connexion does not support multiple consumes. See https://github.com/zalando/connexion/pull/760")
def test_add_pet(self):
"""Test case for add_pet
@@ -89,7 +89,7 @@ class TestPetController(BaseTestCase):
Finds Pets by tags
"""
query_string = [('tags', 'tags_example')]
query_string = [('tags', ['tags_example'])]
headers = {
'Accept': 'application/json',
'Authorization': 'Bearer special-key',
@@ -118,7 +118,7 @@ class TestPetController(BaseTestCase):
self.assert200(response,
'Response body is : ' + response.data.decode('utf-8'))
@unittest.skip("Connexion does not support multiple consummes. See https://github.com/zalando/connexion/pull/760")
@unittest.skip("Connexion does not support multiple consumes. See https://github.com/zalando/connexion/pull/760")
def test_update_pet(self):
"""Test case for update_pet
@@ -187,7 +187,7 @@ class TestPetController(BaseTestCase):
'Authorization': 'Bearer special-key',
}
data = dict(additional_metadata='additional_metadata_example',
file=(BytesIO(b'some file data'), 'file.txt'))
file='/path/to/file')
response = self.client.open(
'/v2/pet/{pet_id}/uploadImage'.format(pet_id=56),
method='POST',

View File

@@ -52,7 +52,7 @@ class TestStoreController(BaseTestCase):
'Accept': 'application/json',
}
response = self.client.open(
'/v2/store/order/{order_id}'.format(order_id=5),
'/v2/store/order/{order_id}'.format(order_id=1),
method='GET',
headers=headers)
self.assert200(response,
@@ -64,7 +64,7 @@ class TestStoreController(BaseTestCase):
Place an order for a pet
"""
body = {}
body = openapi_server.Order()
headers = {
'Accept': 'application/json',
'Content-Type': 'application/json',

View File

@@ -19,7 +19,7 @@ class TestUserController(BaseTestCase):
Create user
"""
body = {}
body = openapi_server.User()
headers = {
'Content-Type': 'application/json',
}
@@ -38,7 +38,7 @@ class TestUserController(BaseTestCase):
Creates list of users with given input array
"""
body = [{}]
body = [openapi_server.User()]
headers = {
'Content-Type': 'application/json',
}
@@ -57,7 +57,7 @@ class TestUserController(BaseTestCase):
Creates list of users with given input array
"""
body = [{}]
body = [openapi_server.User()]
headers = {
'Content-Type': 'application/json',
}
@@ -137,7 +137,7 @@ class TestUserController(BaseTestCase):
Updated user
"""
body = {}
body = openapi_server.User()
headers = {
'Content-Type': 'application/json',
}

View File

@@ -8,4 +8,4 @@ werkzeug == 0.16.1; python_version=="3.5" or python_version=="3.4"
swagger-ui-bundle >= 0.0.2
python_dateutil >= 2.6.0
setuptools >= 21.0.0
Flask == 1.1.2
Flask == 2.1.1

View File

@@ -1,4 +1,4 @@
pytest~=4.6.7 # needed for python 2.7+3.4
pytest~=7.1.0
pytest-cov>=2.8.1
pytest-randomly==1.2.3 # needed for python 2.7+3.4
Flask-Testing==0.8.0
pytest-randomly>=1.2.3
Flask-Testing==0.8.1