예제 #1
0
 def test_error_response_multi_repr(self):
     value = api.APIError({
         'credentials': ['no api token'],
         'request': ['malformed request']
     })
     expectation = '<APIError [credentials, request]>'
     self.assertEqual(repr(value), expectation)
예제 #2
0
 def test_error_response_multi_str(self):
     value = api.APIError({
         'credentials': ['no api token'],
         'request': ['malformed request']
     })
     expectation = ('[credentials]: [\'no api token\'], '
                    '[request]: [\'malformed request\']')
     self.assertEqual(str(value), expectation)
예제 #3
0
 def test_error_response_str(self):
     value = api.APIError({'credentials': ['no api token']})
     expectation = '[credentials]: [\'no api token\']'
     self.assertEqual(str(value), expectation)
예제 #4
0
 def test_error_response_repr(self):
     value = api.APIError({'credentials': ['no api token']})
     expectation = '<APIError [credentials]>'
     self.assertEqual(repr(value), expectation)