Test reading exactly 64KB (common pipe buffer size)
(self)
| 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)""" |
nothing calls this directly
no test coverage detected