Fix/remove support python2 option in flask aiohttp generators (#13585)

* fix: remove option supportPython2.
[python-flask][python-aiohttp][python-blueplanet]

* fix: update samples

* test only python servers

* fix(tests): downgrade pytest version to ensure compatibility with python3.6 [python-flask][python-aiohttp]

* Revert "fix(tests): downgrade pytest version to ensure compatibility with python3.6 [python-flask][python-aiohttp]"

This reverts commit 9f47db2f87.

* test in circlei

* run commands directly

* test in node 1

* update makefile

* fix Makefile

* fix test

* revert some changes, remove python server tests from travis

Co-authored-by: Kevin Bannier <kevinbannier1@gmail.com>
This commit is contained in:
William Cheng
2022-10-04 15:24:26 +08:00
committed by GitHub
parent 57f5cc4000
commit 085e1e58e5
47 changed files with 83 additions and 185 deletions

View File

@@ -12,7 +12,7 @@ clean:
find . -name "__pycache__" -delete
venv:
python -m venv $(VENV)
python3 -m venv $(VENV)
test: clean venv
bash ./test_python3.sh

View File

@@ -5,5 +5,5 @@ connexion[aiohttp,swagger-ui] <= 2.3.0; python_version=="3.5" or python_version=
# we must peg werkzeug versions below to fix connexion
# https://github.com/zalando/connexion/pull/1044
werkzeug == 0.16.1; python_version=="3.5" or python_version=="3.4"
swagger-ui-bundle == 0.0.6
aiohttp_jinja2 == 1.2.0
swagger-ui-bundle == 0.0.9
aiohttp_jinja2 == 1.5.0

View File

@@ -14,9 +14,9 @@ VERSION = "1.0.0"
# http://pypi.python.org/pypi/setuptools
REQUIRES = [
"connexion==2.6.0",
"swagger-ui-bundle==0.0.6",
"aiohttp_jinja2==1.2.0",
"connexion==2.14.1",
"swagger-ui-bundle==0.0.9",
"aiohttp_jinja2==1.5.0",
]
setup(

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
pytest-randomly>=1.2.3
pytest-aiohttp>=0.3.0

View File

@@ -9,7 +9,7 @@ from openapi_server.models.api_response import ApiResponse
from openapi_server.models.pet import Pet
@pytest.mark.skip("Connexion does not support multiple consummes. See https://github.com/zalando/connexion/pull/760")
@pytest.mark.skip("Connexion does not support multiple consumes. See https://github.com/zalando/connexion/pull/760")
async def test_add_pet(client):
"""Test case for add_pet
@@ -67,7 +67,7 @@ async def test_find_pets_by_status(client):
Finds Pets by status
"""
params = [('status', 'available')]
params = [('status', ['available'])]
headers = {
'Accept': 'application/json',
'Authorization': 'Bearer special-key',
@@ -86,7 +86,7 @@ async def test_find_pets_by_tags(client):
Finds Pets by tags
"""
params = [('tags', 'tags_example')]
params = [('tags', ['tags_example'])]
headers = {
'Accept': 'application/json',
'Authorization': 'Bearer special-key',
@@ -117,7 +117,7 @@ async def test_get_pet_by_id(client):
assert response.status == 200, 'Response body is : ' + (await response.read()).decode('utf-8')
@pytest.mark.skip("Connexion does not support multiple consummes. See https://github.com/zalando/connexion/pull/760")
@pytest.mark.skip("Connexion does not support multiple consumes. See https://github.com/zalando/connexion/pull/760")
async def test_update_pet(client):
"""Test case for update_pet
@@ -189,7 +189,7 @@ async def test_upload_file(client):
}
data = FormData()
data.add_field('additional_metadata', 'additional_metadata_example')
data.add_field('file', (BytesIO(b'some file data'), 'file.txt'))
data.add_field('file', '/path/to/file')
response = await client.request(
method='POST',
path='/v2/pet/{pet_id}/uploadImage'.format(pet_id=56),

View File

@@ -49,7 +49,7 @@ async def test_get_order_by_id(client):
}
response = await client.request(
method='GET',
path='/v2/store/order/{order_id}'.format(order_id=5),
path='/v2/store/order/{order_id}'.format(order_id=1),
headers=headers,
)
assert response.status == 200, 'Response body is : ' + (await response.read()).decode('utf-8')
@@ -61,7 +61,7 @@ async def test_place_order(client):
Place an order for a pet
"""
body = {}
body = openapi_server.Order()
headers = {
'Accept': 'application/json',
'Content-Type': 'application/json',

View File

@@ -13,7 +13,7 @@ async def test_create_user(client):
Create user
"""
body = {}
body = openapi_server.User()
headers = {
'Content-Type': 'application/json',
}
@@ -32,7 +32,7 @@ async def test_create_users_with_array_input(client):
Creates list of users with given input array
"""
body = [{}]
body = [openapi_server.User()]
headers = {
'Content-Type': 'application/json',
}
@@ -51,7 +51,7 @@ async def test_create_users_with_list_input(client):
Creates list of users with given input array
"""
body = [{}]
body = [openapi_server.User()]
headers = {
'Content-Type': 'application/json',
}
@@ -135,7 +135,7 @@ async def test_update_user(client):
Updated user
"""
body = {}
body = openapi_server.User()
headers = {
'Content-Type': 'application/json',
}