MCPcopy Index your code
hub / github.com/python/cpython / test_init_bad_check

Method test_init_bad_check

Lib/test/test_zstd.py:1673–1697  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

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

Callers

nothing calls this directly

Calls 2

ZstdFileClass · 0.90
assertRaisesMethod · 0.45

Tested by

no test coverage detected