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