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

Method test_response_multiple_headers

tests/jsonrpc/test_jsonrpc.py:83–95  ·  view source on GitHub ↗

Verify json rpc reader can read response with multiple headers.

(self)

Source from the content-addressed store, hash-verified

81 self.assertTrue(test_stream.closed)
82
83 def test_response_multiple_headers(self):
84 """
85 Verify json rpc reader can read response with multiple headers.
86 """
87 test_stream = io.BytesIO(
88 b'Content-Length: 15\r\nHeader2: content2\r\nHeader3: content3\r\n\r\n{"key":"value"}')
89 json_rpc_reader = jsonrpc.JsonRpcReader(test_stream)
90 response = json_rpc_reader.read_response()
91 baseline = {u'key': u'value'}
92 self.assertEqual(response, baseline)
93
94 json_rpc_reader.close()
95 self.assertTrue(test_stream.closed)
96
97 def test_incorrect_header_formats(self):
98 """

Callers

nothing calls this directly

Calls 2

read_responseMethod · 0.95
closeMethod · 0.95

Tested by

no test coverage detected