def test_http_exceptions(self):
     """Test the exceptions raised for each HTTP 4xx code."""
     b = BaseRequest('www.example.com')
     for code, klass in b.errors.iteritems():
         self.assertIs(b._exception_for(code), klass)
     self.assertIs(b._exception_for(499), UnknownError)
     for code in (500, 501, 502, ):
         self.assertIs(b._exception_for(code), RemoteServerError)
 def test_http_exceptions(self):
     """Test the exceptions raised for each HTTP 4xx code."""
     b = BaseRequest('www.example.com')
     for code in b.errors:
         klass = b.errors[code]
         assert b._exception_for(code) is klass
         assert b._exception_for(499) is UnknownError
     for code in (500, 501, 502, ):
         assert b._exception_for(code) is RemoteServerError
Exemple #3
0
 def test_http_exceptions(self):
     """Test the exceptions raised for each HTTP 4xx code."""
     b = BaseRequest('www.example.com')
     for code, klass in b.errors.iteritems():
         self.assertIs(b._exception_for(code), klass)
     self.assertIs(b._exception_for(499), UnknownError)
     for code in (
             500,
             501,
             502,
     ):
         self.assertIs(b._exception_for(code), RemoteServerError)
 def test_http_exceptions(self):
     """Test the exceptions raised for each HTTP 4xx code."""
     b = BaseRequest('www.example.com')
     for code in b.errors:
         klass = b.errors[code]
         assert b._exception_for(code) is klass
         assert b._exception_for(499) is UnknownError
     for code in (
             500,
             501,
             502,
     ):
         assert b._exception_for(code) is RemoteServerError