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

Method test_write_bad_args

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

Source from the content-addressed store, hash-verified

2202 self.assertEqual(dst.getvalue(), expected)
2203
2204 def test_write_bad_args(self):
2205 f = ZstdFile(io.BytesIO(), "w")
2206 f.close()
2207 self.assertRaises(ValueError, f.write, b"foo")
2208 with ZstdFile(io.BytesIO(COMPRESSED_100_PLUS_32KB), "r") as f:
2209 self.assertRaises(ValueError, f.write, b"bar")
2210 with ZstdFile(io.BytesIO(), "w") as f:
2211 self.assertRaises(TypeError, f.write, None)
2212 self.assertRaises(TypeError, f.write, "text")
2213 self.assertRaises(TypeError, f.write, 789)
2214
2215 def test_writelines(self):
2216 def comp(data):

Callers

nothing calls this directly

Calls 3

closeMethod · 0.95
ZstdFileClass · 0.90
assertRaisesMethod · 0.45

Tested by

no test coverage detected