Test reading data that fits in a single chunk
(self)
| 77 | """Tests for the _read_exact() method that handles short reads""" |
| 78 | |
| 79 | def test_read_exact_single_chunk(self): |
| 80 | """Test reading data that fits in a single chunk""" |
| 81 | content = b"Hello, World!" |
| 82 | mock_stream = ShortReadStream(content, chunk_size=1024) |
| 83 | |
| 84 | process = MockProcess() |
| 85 | process.stdout = mock_stream |
| 86 | |
| 87 | client = JsonRpcClient(process) |
| 88 | result = client._read_exact(len(content)) |
| 89 | |
| 90 | assert result == content |
| 91 | |
| 92 | def test_read_exact_multiple_chunks(self): |
| 93 | """Test reading data that requires multiple chunks (short reads)""" |
nothing calls this directly
no test coverage detected