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

Method test_write_bad_args

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

Source from the content-addressed store, hash-verified

1251 unlink(TESTFN)
1252
1253 def test_write_bad_args(self):
1254 f = LZMAFile(BytesIO(), "w")
1255 f.close()
1256 self.assertRaises(ValueError, f.write, b"foo")
1257 with LZMAFile(BytesIO(COMPRESSED_XZ), "r") as f:
1258 self.assertRaises(ValueError, f.write, b"bar")
1259 with LZMAFile(BytesIO(), "w") as f:
1260 self.assertRaises(TypeError, f.write, None)
1261 self.assertRaises(TypeError, f.write, "text")
1262 self.assertRaises(TypeError, f.write, 789)
1263
1264 def test_writelines(self):
1265 with BytesIO(INPUT) 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