forked from loafle/openapi-generator-original
[python-nextgen] Fix binary response (#15076)
* fix binary response in python nextgen client * update samples
This commit is contained in:
@@ -14,6 +14,7 @@ from __future__ import absolute_import
|
||||
|
||||
import unittest
|
||||
import datetime
|
||||
import base64
|
||||
|
||||
import openapi_client
|
||||
from openapi_client.api.query_api import QueryApi # noqa: E501
|
||||
@@ -51,6 +52,13 @@ class TestManual(unittest.TestCase):
|
||||
e = EchoServerResponseParser(api_response)
|
||||
self.assertEqual(e.path, "/query/datetime/date/string?datetime_query=2013-10-20T19%3A20%3A30.000000-0500&date_query=2013-10-20&string_query=string_query_example")
|
||||
|
||||
def testBinaryGif(self):
|
||||
api_instance = openapi_client.BodyApi()
|
||||
|
||||
# Test binary response
|
||||
api_response = api_instance.test_binary_gif()
|
||||
self.assertEqual((base64.b64encode(api_response)).decode("utf-8"), "R0lGODlhAQABAIABAP///wAAACH5BAEKAAEALAAAAAABAAEAAAICTAEAOw==")
|
||||
|
||||
class EchoServerResponseParser():
|
||||
def __init__(self, http_response):
|
||||
if http_response is None:
|
||||
|
||||
Reference in New Issue
Block a user