(self)
| 2353 | self.assertEqual(dat, SAMPLES[0]) |
| 2354 | |
| 2355 | def test_UnsupportedOperation(self): |
| 2356 | # 1 |
| 2357 | with ZstdFile(io.BytesIO(), 'r') as f: |
| 2358 | with self.assertRaises(io.UnsupportedOperation): |
| 2359 | f.write(b'1234') |
| 2360 | |
| 2361 | # 2 |
| 2362 | class T: |
| 2363 | def read(self, size): |
| 2364 | return b'a' * size |
| 2365 | |
| 2366 | with self.assertRaises(TypeError): # on creation |
| 2367 | with ZstdFile(T(), 'w') as f: |
| 2368 | pass |
| 2369 | |
| 2370 | # 3 |
| 2371 | with ZstdFile(io.BytesIO(), 'w') as f: |
| 2372 | with self.assertRaises(io.UnsupportedOperation): |
| 2373 | f.read(100) |
| 2374 | with self.assertRaises(io.UnsupportedOperation): |
| 2375 | f.seek(100) |
| 2376 | self.assertEqual(f.closed, True) |
| 2377 | with self.assertRaises(ValueError): |
| 2378 | f.readable() |
| 2379 | with self.assertRaises(ValueError): |
| 2380 | f.tell() |
| 2381 | with self.assertRaises(ValueError): |
| 2382 | f.read(100) |
| 2383 | |
| 2384 | def test_read_readinto_readinto1(self): |
| 2385 | lst = [] |
nothing calls this directly
no test coverage detected