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

Method test_read_bad_args

Lib/test/test_lzma.py:974–981  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

972 self.assertRaises(EOFError, f.read, 1)
973
974 def test_read_bad_args(self):
975 f = LZMAFile(BytesIO(COMPRESSED_XZ))
976 f.close()
977 self.assertRaises(ValueError, f.read)
978 with LZMAFile(BytesIO(), "w") as f:
979 self.assertRaises(ValueError, f.read)
980 with LZMAFile(BytesIO(COMPRESSED_XZ)) as f:
981 self.assertRaises(TypeError, f.read, float())
982
983 def test_read_bad_data(self):
984 with LZMAFile(BytesIO(COMPRESSED_BOGUS)) as f:

Callers

nothing calls this directly

Calls 4

closeMethod · 0.95
LZMAFileClass · 0.90
BytesIOClass · 0.90
assertRaisesMethod · 0.45

Tested by

no test coverage detected