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

Method test_read_state

tests/jsonrpc/test_jsonrpc.py:207–219  ·  view source on GitHub ↗

Assert read states are valid.

(self)

Source from the content-addressed store, hash-verified

205 self.assertEqual(len(json_rpc_reader.buffer), 16347)
206
207 def test_read_state(self):
208 """
209 Assert read states are valid.
210 """
211 test_stream = io.BytesIO(b'Content-Length: 15\r\n\r\n')
212 json_rpc_reader = jsonrpc.JsonRpcReader(test_stream)
213 self.assertEqual(json_rpc_reader.read_state, jsonrpc.ReadState.Header)
214
215 json_rpc_reader.read_next_chunk()
216 header_read = json_rpc_reader.try_read_headers()
217
218 self.assertTrue(header_read)
219 self.assertEqual(json_rpc_reader.read_state, jsonrpc.ReadState.Content)
220
221 def test_case_insensitive_header(self):
222 """

Callers

nothing calls this directly

Calls 2

read_next_chunkMethod · 0.95
try_read_headersMethod · 0.95

Tested by

no test coverage detected