MCPcopy Index your code
hub / github.com/RustPython/RustPython / test_read_bad_args

Method test_read_bad_args

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

Source from the content-addressed store, hash-verified

982 self.assertRaises(EOFError, f.read, 1)
983
984 def test_read_bad_args(self):
985 f = LZMAFile(BytesIO(COMPRESSED_XZ))
986 f.close()
987 self.assertRaises(ValueError, f.read)
988 with LZMAFile(BytesIO(), "w") as f:
989 self.assertRaises(ValueError, f.read)
990 with LZMAFile(BytesIO(COMPRESSED_XZ)) as f:
991 self.assertRaises(TypeError, f.read, float())
992
993 def test_read_bad_data(self):
994 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