forked from loafle/openapi-generator-original
[python-nextgen] better sample code (#15248)
* better python-nextgen sample code * remove future import * fix signing doc * better test * use hasHttpBearerMethods instead
This commit is contained in:
@@ -31,6 +31,7 @@ class TestManual(unittest.TestCase):
|
||||
|
||||
def testDateTimeQueryWithDateTimeFormat(self):
|
||||
api_instance = openapi_client.QueryApi()
|
||||
datetime_format_backup = api_instance.api_client.configuration.datetime_format # backup dateime_format
|
||||
api_instance.api_client.configuration.datetime_format = "%Y-%m-%d %a %H:%M:%S%Z"
|
||||
datetime_query = datetime.datetime.fromisoformat('2013-10-20T19:20:30-05:00') # datetime | (optional)
|
||||
date_query = '2013-10-20' # date | (optional)
|
||||
@@ -41,6 +42,9 @@ class TestManual(unittest.TestCase):
|
||||
e = EchoServerResponseParser(api_response)
|
||||
self.assertEqual(e.path, "/query/datetime/date/string?datetime_query=2013-10-20%20Sun%2019%3A20%3A30UTC-05%3A00&date_query=2013-10-20&string_query=string_query_example")
|
||||
|
||||
# restore datetime format
|
||||
api_instance.api_client.configuration.datetime_format = datetime_format_backup
|
||||
|
||||
def testDateTimeQueryWithDateTime(self):
|
||||
api_instance = openapi_client.QueryApi()
|
||||
datetime_query = datetime.datetime.fromisoformat('2013-10-20T19:20:30-05:00') # datetime | (optional)
|
||||
|
||||
Reference in New Issue
Block a user