MCPcopy Create free account
hub / github.com/dbcli/mssql-cli / test_invalid_json_response

Method test_invalid_json_response

tests/jsonrpc/test_jsonrpc.py:124–132  ·  view source on GitHub ↗

Assert expected exception reading response with invalid json.

(self)

Source from the content-addressed store, hash-verified

122 self.assertTrue(test_stream.closed)
123
124 def test_invalid_json_response(self):
125 """
126 Assert expected exception reading response with invalid json.
127 """
128 # Verify error thrown with invalid JSON.
129 test_stream = io.BytesIO(b'Content-Length: 14\r\n\r\n{"key":"value"')
130 json_rpc_reader = jsonrpc.JsonRpcReader(test_stream)
131 with self.assertRaises(ValueError):
132 json_rpc_reader.read_response()
133
134 def test_invalid_content_length_value_response(self):
135 """

Callers

nothing calls this directly

Calls 1

read_responseMethod · 0.95

Tested by

no test coverage detected