Пример #1
0
 def actual_exception_cause(self):
     try:
         return content_json(self.actual_response)['reason']
     except ValueError:
         return 'not a json response'
     except KeyError:
         return 'no error reason'
Пример #2
0
 def actual_exception_cause(self):
     try:
         return content_json(self.actual_response)['reason']
     except ValueError:
         return 'not a json response'
     except KeyError:
         return 'no error reason'
Пример #3
0
 def _get_response_json_content():
     try:
         return content_json(self.actual_response)
     except ValueError:
         testcase.fail(
             'expected a json response, got: "{}"'.format(self.actual_response.content.decode('utf-8')))
Пример #4
0
 def _get_response_json_content():
     try:
         return content_json(self.actual_response)
     except ValueError:
         testcase.fail('expected a json response, got: "{}"'.format(
             self.actual_response.content.decode('utf-8')))