(self)
| 1672 | ZstdFile(io.BytesIO(COMPRESSED_100_PLUS_32KB), "r", level=12) |
| 1673 | |
| 1674 | def test_init_bad_check(self): |
| 1675 | with self.assertRaises(TypeError): |
| 1676 | ZstdFile(io.BytesIO(), "w", level='asd') |
| 1677 | # CHECK_UNKNOWN and anything above CHECK_ID_MAX should be invalid. |
| 1678 | with self.assertRaises(ValueError): |
| 1679 | ZstdFile(io.BytesIO(), "w", options={999:9999}) |
| 1680 | with self.assertRaises(ValueError): |
| 1681 | ZstdFile(io.BytesIO(), "w", options={CompressionParameter.window_log:99}) |
| 1682 | |
| 1683 | with self.assertRaises(TypeError): |
| 1684 | ZstdFile(io.BytesIO(COMPRESSED_100_PLUS_32KB), "r", options=33) |
| 1685 | |
| 1686 | with self.assertRaises(OverflowError): |
| 1687 | ZstdFile(io.BytesIO(COMPRESSED_100_PLUS_32KB), |
| 1688 | options={DecompressionParameter.window_log_max:2**31}) |
| 1689 | |
| 1690 | with self.assertRaises(ValueError): |
| 1691 | ZstdFile(io.BytesIO(COMPRESSED_100_PLUS_32KB), |
| 1692 | options={444:333}) |
| 1693 | |
| 1694 | with self.assertRaises(TypeError): |
| 1695 | ZstdFile(io.BytesIO(COMPRESSED_100_PLUS_32KB), zstd_dict={1:2}) |
| 1696 | |
| 1697 | with self.assertRaises(TypeError): |
| 1698 | ZstdFile(io.BytesIO(COMPRESSED_100_PLUS_32KB), zstd_dict=b'dict123456') |
| 1699 | |
| 1700 | def test_init_close_fp(self): |
| 1701 | # get a temp file name |
nothing calls this directly
no test coverage detected