Assert expected exception reading response with invalid json.
(self)
| 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 | """ |
nothing calls this directly
no test coverage detected