forked from loafle/openapi-generator-original
[python-flask] adopt python3.5+ syntax (#16375)
* adopt python3.5+ syntax removing some residual python2 code, since it is not supported anymore, like: - no need for `six` anymore - no need for encoding utf8 in top file - remove `object` inheritance in base model - remove absolute import `__future__` * generate samples applying the new templates * update python ignore pattern ignore all the `.venv` folders
This commit is contained in:
@@ -1,10 +1,6 @@
|
||||
# coding: utf-8
|
||||
|
||||
from __future__ import absolute_import
|
||||
import unittest
|
||||
|
||||
from flask import json
|
||||
from six import BytesIO
|
||||
|
||||
from openapi_server.models.api_response import ApiResponse # noqa: E501
|
||||
from openapi_server.models.pet import Pet # noqa: E501
|
||||
@@ -20,23 +16,7 @@ class TestPetController(BaseTestCase):
|
||||
|
||||
Add a new pet to the store
|
||||
"""
|
||||
body = {
|
||||
"photoUrls" : [ "photoUrls", "photoUrls" ],
|
||||
"name" : "doggie",
|
||||
"id" : 0,
|
||||
"category" : {
|
||||
"name" : "name",
|
||||
"id" : 6
|
||||
},
|
||||
"tags" : [ {
|
||||
"name" : "name",
|
||||
"id" : 1
|
||||
}, {
|
||||
"name" : "name",
|
||||
"id" : 1
|
||||
} ],
|
||||
"status" : "available"
|
||||
}
|
||||
body = {"photoUrls":["photoUrls","photoUrls"],"name":"doggie","id":0,"category":{"name":"name","id":6},"tags":[{"name":"name","id":1},{"name":"name","id":1}],"status":"available"}
|
||||
headers = {
|
||||
'Content-Type': 'application/json',
|
||||
'Authorization': 'Bearer special-key',
|
||||
@@ -71,7 +51,7 @@ class TestPetController(BaseTestCase):
|
||||
|
||||
Finds Pets by status
|
||||
"""
|
||||
query_string = [('status', 'available')]
|
||||
query_string = [('status', ['status_example'])]
|
||||
headers = {
|
||||
'Accept': 'application/json',
|
||||
'Authorization': 'Bearer special-key',
|
||||
@@ -124,23 +104,7 @@ class TestPetController(BaseTestCase):
|
||||
|
||||
Update an existing pet
|
||||
"""
|
||||
body = {
|
||||
"photoUrls" : [ "photoUrls", "photoUrls" ],
|
||||
"name" : "doggie",
|
||||
"id" : 0,
|
||||
"category" : {
|
||||
"name" : "name",
|
||||
"id" : 6
|
||||
},
|
||||
"tags" : [ {
|
||||
"name" : "name",
|
||||
"id" : 1
|
||||
}, {
|
||||
"name" : "name",
|
||||
"id" : 1
|
||||
} ],
|
||||
"status" : "available"
|
||||
}
|
||||
body = {"photoUrls":["photoUrls","photoUrls"],"name":"doggie","id":0,"category":{"name":"name","id":6},"tags":[{"name":"name","id":1},{"name":"name","id":1}],"status":"available"}
|
||||
headers = {
|
||||
'Content-Type': 'application/json',
|
||||
'Authorization': 'Bearer special-key',
|
||||
|
||||
@@ -1,10 +1,6 @@
|
||||
# coding: utf-8
|
||||
|
||||
from __future__ import absolute_import
|
||||
import unittest
|
||||
|
||||
from flask import json
|
||||
from six import BytesIO
|
||||
|
||||
from openapi_server.models.order import Order # noqa: E501
|
||||
from openapi_server.test import BaseTestCase
|
||||
@@ -52,7 +48,7 @@ class TestStoreController(BaseTestCase):
|
||||
'Accept': 'application/json',
|
||||
}
|
||||
response = self.client.open(
|
||||
'/v2/store/order/{order_id}'.format(order_id=1),
|
||||
'/v2/store/order/{order_id}'.format(order_id=56),
|
||||
method='GET',
|
||||
headers=headers)
|
||||
self.assert200(response,
|
||||
|
||||
@@ -1,10 +1,6 @@
|
||||
# coding: utf-8
|
||||
|
||||
from __future__ import absolute_import
|
||||
import unittest
|
||||
|
||||
from flask import json
|
||||
from six import BytesIO
|
||||
|
||||
from openapi_server.models.user import User # noqa: E501
|
||||
from openapi_server.test import BaseTestCase
|
||||
|
||||
Reference in New Issue
Block a user