MCPcopy Create free account
hub / github.com/github/copilot-sdk / test_read_exact_at_64kb_boundary

Method test_read_exact_at_64kb_boundary

python/test_jsonrpc.py:108–120  ·  view source on GitHub ↗

Test reading exactly 64KB (common pipe buffer size)

(self)

Source from the content-addressed store, hash-verified

106 assert len(result) == 100000
107
108 def test_read_exact_at_64kb_boundary(self):
109 """Test reading exactly 64KB (common pipe buffer size)"""
110 content = b"y" * 65536 # Exactly 64KB
111 mock_stream = ShortReadStream(content, chunk_size=65536)
112
113 process = MockProcess()
114 process.stdout = mock_stream
115
116 client = JsonRpcClient(process)
117 result = client._read_exact(len(content))
118
119 assert result == content
120 assert len(result) == 65536
121
122 def test_read_exact_exceeds_64kb(self):
123 """Test reading data that exceeds 64KB (triggers the bug without fix)"""

Callers

nothing calls this directly

Calls 4

_read_exactMethod · 0.95
JsonRpcClientClass · 0.90
ShortReadStreamClass · 0.85
MockProcessClass · 0.85

Tested by

no test coverage detected