(self)
| 651 | LZMAFile(BytesIO(COMPRESSED_XZ), check=lzma.CHECK_UNKNOWN) |
| 652 | |
| 653 | def test_init_bad_preset(self): |
| 654 | with self.assertRaises(TypeError): |
| 655 | LZMAFile(BytesIO(), "w", preset=4.39) |
| 656 | with self.assertRaises(LZMAError): |
| 657 | LZMAFile(BytesIO(), "w", preset=10) |
| 658 | with self.assertRaises(LZMAError): |
| 659 | LZMAFile(BytesIO(), "w", preset=23) |
| 660 | with self.assertRaises(ValueError): |
| 661 | LZMAFile(BytesIO(), "w", preset=-1) |
| 662 | with self.assertRaises(ValueError): |
| 663 | LZMAFile(BytesIO(), "w", preset=-7) |
| 664 | with self.assertRaises(OverflowError): |
| 665 | LZMAFile(BytesIO(), "w", preset=2**1000) |
| 666 | with self.assertRaises(TypeError): |
| 667 | LZMAFile(BytesIO(), "w", preset="foo") |
| 668 | # Cannot specify a preset with mode="r". |
| 669 | with self.assertRaises(ValueError): |
| 670 | LZMAFile(BytesIO(COMPRESSED_XZ), preset=3) |
| 671 | |
| 672 | def test_init_bad_filter_spec(self): |
| 673 | with self.assertRaises(TypeError): |
nothing calls this directly
no test coverage detected