Beispiel #1
0
 def test_error_with_response(self):
     resp = HTTPResponse(HTTPRequest('http://example.com/'), 403)
     with self.assertRaises(HTTPError) as cm:
         resp.rethrow()
     e = cm.exception
     self.assertEqual(str(e), "HTTP 403: Forbidden")
     self.assertEqual(repr(e), "HTTP 403: Forbidden")
Beispiel #2
0
 def test_error_with_response(self):
     resp = HTTPResponse(HTTPRequest('http://example.com/'), 403)
     with self.assertRaises(HTTPError) as cm:
         resp.rethrow()
     e = cm.exception
     self.assertEqual(str(e), "HTTP 403: Forbidden")
     self.assertEqual(repr(e), "HTTP 403: Forbidden")