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

Method test_basic_response

tests/jsonrpc/test_jsonrpc.py:16–27  ·  view source on GitHub ↗

Verify json rpc reader can read a valid response.

(self)

Source from the content-addressed store, hash-verified

14 """
15
16 def test_basic_response(self):
17 """
18 Verify json rpc reader can read a valid response.
19 """
20 test_stream = io.BytesIO(b'Content-Length: 15\r\n\r\n{"key":"value"}')
21 json_rpc_reader = jsonrpc.JsonRpcReader(test_stream)
22 response = json_rpc_reader.read_response()
23 baseline = {u'key': u'value'}
24 self.assertEqual(response, baseline)
25
26 json_rpc_reader.close()
27 self.assertTrue(test_stream.closed)
28
29 def test_basic_request(self):
30 """

Callers

nothing calls this directly

Calls 2

read_responseMethod · 0.95
closeMethod · 0.95

Tested by

no test coverage detected