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

Method testWriteBytesIO

Lib/test/test_bz2.py:784–793  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

782 self.assertEqual(bz2f.read(), self.TEXT)
783
784 def testWriteBytesIO(self):
785 with BytesIO() as bio:
786 with BZ2File(bio, "w") as bz2f:
787 self.assertRaises(TypeError, bz2f.write)
788 bz2f.write(self.TEXT)
789 with self.assertRaises(AttributeError):
790 bz2.name
791 self.assertEqual(bz2f.mode, 'wb')
792 self.assertEqual(ext_decompress(bio.getvalue()), self.TEXT)
793 self.assertFalse(bio.closed)
794
795 def testSeekForwardBytesIO(self):
796 with BytesIO(self.DATA) as bio:

Callers

nothing calls this directly

Calls 8

BytesIOClass · 0.90
BZ2FileClass · 0.90
ext_decompressFunction · 0.85
assertFalseMethod · 0.80
assertRaisesMethod · 0.45
writeMethod · 0.45
assertEqualMethod · 0.45
getvalueMethod · 0.45

Tested by

no test coverage detected