Test handling of non-JSON bodies
(self)
| 124 | self.assertEqual(str(error), '<HttpError 400 "Failed">') |
| 125 | |
| 126 | def test_non_json(self): |
| 127 | """Test handling of non-JSON bodies""" |
| 128 | resp, content = fake_response(b"Invalid request", {"status": "400"}) |
| 129 | error = HttpError(resp, content) |
| 130 | self.assertEqual( |
| 131 | str(error), |
| 132 | '<HttpError 400 when requesting None returned "Ok". Details: "Invalid request">', |
| 133 | ) |
| 134 | |
| 135 | def test_missing_reason(self): |
| 136 | """Test an empty dict with a missing resp.reason.""" |
nothing calls this directly
no test coverage detected