mirror of
https://github.com/jlengrand/openapi-generator.git
synced 2026-05-18 00:21:20 +00:00
added test case for 500 response of python client
This commit is contained in:
@@ -190,7 +190,10 @@ class ApiException(Exception):
|
||||
"""
|
||||
Custom error response messages
|
||||
"""
|
||||
return "({0})\nReason: {1}\nHeader: {2}\nBody: {3}\n".\
|
||||
return "({0})\n"\
|
||||
"Reason: {1}\n"\
|
||||
"HTTP response headers: {2}\n"\
|
||||
"HTTP response body: {3}\n".\
|
||||
format(self.status, self.reason, self.headers, self.body)
|
||||
|
||||
class RESTClient(object):
|
||||
|
||||
@@ -1,6 +1,12 @@
|
||||
# coding: utf-8
|
||||
|
||||
from six import iteritems
|
||||
|
||||
def remove_none(obj):
|
||||
"""
|
||||
Remove None from `list`, `tuple`, `set`.
|
||||
Remove None value from `dict`.
|
||||
"""
|
||||
if isinstance(obj, (list, tuple, set)):
|
||||
return type(obj)(remove_none(x) for x in obj if x is not None)
|
||||
elif isinstance(obj, dict):
|
||||
@@ -8,10 +14,3 @@ def remove_none(obj):
|
||||
for k, v in iteritems(obj) if k is not None and v is not None)
|
||||
else:
|
||||
return obj
|
||||
|
||||
|
||||
def inspect_vars(obj):
|
||||
if not hasattr(obj, '__dict__'):
|
||||
return obj
|
||||
else:
|
||||
return {k: inspect_vars(getattr(obj, k)) for k in dir(obj)}
|
||||
|
||||
Reference in New Issue
Block a user