def test_error_reason_text(self): resp = "<html><title>404</title><body><p>Error 404</p></body></html>" self.assertEquals( Connection._get_error_reason(Response(204, resp)), resp)
def test_error_reason_text(self): resp = "<html><title>404</title><body><p>Error 404</p></body></html>" self.assertEquals(Connection._get_error_reason(Response(204, resp)), resp)
def test_error_reason_json(self): resp = {"reason": "message"} self.assertEquals( Connection._get_error_reason(Response(204, json.dumps(resp))), resp['reason'])