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

Method test_bad_json_body

tests/test_errors.py:92–101  ·  view source on GitHub ↗

Test handling of bodies with invalid json.

(self)

Source from the content-addressed store, hash-verified

90 )
91
92 def test_bad_json_body(self):
93 """Test handling of bodies with invalid json."""
94 resp, content = fake_response(
95 b"{", {"status": "400", "content-type": "application/json"}, reason="Failed"
96 )
97 error = HttpError(resp, content)
98 self.assertEqual(
99 str(error),
100 '<HttpError 400 when requesting None returned "Failed". Details: "{">',
101 )
102
103 def test_with_uri(self):
104 """Test handling of passing in the request uri."""

Callers

nothing calls this directly

Calls 2

HttpErrorClass · 0.90
fake_responseFunction · 0.85

Tested by

no test coverage detected