def test_check_status_code(self): msg = 'Generic error' HttpClient.check_status_code(200, msg) with self.assertRaises(api_call_error.APICallError): HttpClient.check_status_code(400, msg) with self.assertRaises(api_response_error.UnauthorizedError): HttpClient.check_status_code(401, msg) with self.assertRaises(api_response_error.NotFoundError): HttpClient.check_status_code(404, msg) with self.assertRaises(api_call_error.BadGatewayError): HttpClient.check_status_code(502, msg) with self.assertRaises(api_call_error.APICallError): HttpClient.check_status_code(555, msg)
def test_check_status_code(self): msg = 'Generic error' HttpClient.check_status_code(200, msg) with self.assertRaises(pyowm.commons.exceptions.APIRequestError): HttpClient.check_status_code(400, msg) with self.assertRaises(pyowm.commons.exceptions.UnauthorizedError): HttpClient.check_status_code(401, msg) with self.assertRaises(pyowm.commons.exceptions.NotFoundError): HttpClient.check_status_code(404, msg) with self.assertRaises(pyowm.commons.exceptions.BadGatewayError): HttpClient.check_status_code(502, msg) with self.assertRaises(pyowm.commons.exceptions.APIRequestError): HttpClient.check_status_code(555, msg)