MCPcopy Index your code
hub / github.com/googleapis/google-api-python-client / test_non_json

Method test_non_json

tests/test_errors.py:126–133  ·  view source on GitHub ↗

Test handling of non-JSON bodies

(self)

Source from the content-addressed store, hash-verified

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."""

Callers

nothing calls this directly

Calls 2

HttpErrorClass · 0.90
fake_responseFunction · 0.85

Tested by

no test coverage detected