(self)
| 1635 | os.remove(filename) |
| 1636 | |
| 1637 | def test_init_bad_mode(self): |
| 1638 | with self.assertRaises(ValueError): |
| 1639 | ZstdFile(io.BytesIO(COMPRESSED_100_PLUS_32KB), (3, "x")) |
| 1640 | with self.assertRaises(ValueError): |
| 1641 | ZstdFile(io.BytesIO(COMPRESSED_100_PLUS_32KB), "") |
| 1642 | with self.assertRaises(ValueError): |
| 1643 | ZstdFile(io.BytesIO(COMPRESSED_100_PLUS_32KB), "xt") |
| 1644 | with self.assertRaises(ValueError): |
| 1645 | ZstdFile(io.BytesIO(COMPRESSED_100_PLUS_32KB), "x+") |
| 1646 | with self.assertRaises(ValueError): |
| 1647 | ZstdFile(io.BytesIO(COMPRESSED_100_PLUS_32KB), "rx") |
| 1648 | with self.assertRaises(ValueError): |
| 1649 | ZstdFile(io.BytesIO(COMPRESSED_100_PLUS_32KB), "wx") |
| 1650 | with self.assertRaises(ValueError): |
| 1651 | ZstdFile(io.BytesIO(COMPRESSED_100_PLUS_32KB), "rt") |
| 1652 | with self.assertRaises(ValueError): |
| 1653 | ZstdFile(io.BytesIO(COMPRESSED_100_PLUS_32KB), "r+") |
| 1654 | with self.assertRaises(ValueError): |
| 1655 | ZstdFile(io.BytesIO(COMPRESSED_100_PLUS_32KB), "wt") |
| 1656 | with self.assertRaises(ValueError): |
| 1657 | ZstdFile(io.BytesIO(COMPRESSED_100_PLUS_32KB), "w+") |
| 1658 | with self.assertRaises(ValueError): |
| 1659 | ZstdFile(io.BytesIO(COMPRESSED_100_PLUS_32KB), "rw") |
| 1660 | |
| 1661 | with self.assertRaisesRegex(TypeError, |
| 1662 | r"not be a CompressionParameter"): |
| 1663 | ZstdFile(io.BytesIO(), 'rb', |
| 1664 | options={CompressionParameter.compression_level:5}) |
| 1665 | with self.assertRaisesRegex(TypeError, |
| 1666 | r"not be a DecompressionParameter"): |
| 1667 | ZstdFile(io.BytesIO(), 'wb', |
| 1668 | options={DecompressionParameter.window_log_max:21}) |
| 1669 | |
| 1670 | with self.assertRaises(TypeError): |
| 1671 | ZstdFile(io.BytesIO(COMPRESSED_100_PLUS_32KB), "r", level=12) |
| 1672 | |
| 1673 | def test_init_bad_check(self): |
| 1674 | with self.assertRaises(TypeError): |
nothing calls this directly
no test coverage detected