(self)
| 2213 | self.assertRaises(TypeError, f.write, 789) |
| 2214 | |
| 2215 | def test_writelines(self): |
| 2216 | def comp(data): |
| 2217 | comp = ZstdCompressor() |
| 2218 | return comp.compress(data) + comp.flush() |
| 2219 | |
| 2220 | with io.BytesIO(THIS_FILE_BYTES) as f: |
| 2221 | lines = f.readlines() |
| 2222 | with io.BytesIO() as dst: |
| 2223 | with ZstdFile(dst, "w") as f: |
| 2224 | f.writelines(lines) |
| 2225 | expected = comp(THIS_FILE_BYTES) |
| 2226 | self.assertEqual(dst.getvalue(), expected) |
| 2227 | |
| 2228 | def test_seek_forward(self): |
| 2229 | with ZstdFile(io.BytesIO(COMPRESSED_100_PLUS_32KB)) as f: |
nothing calls this directly
no test coverage detected