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

Method test_seekable

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

Source from the content-addressed store, hash-verified

745 self.assertRaises(ValueError, f.fileno)
746
747 def test_seekable(self):
748 f = LZMAFile(BytesIO(COMPRESSED_XZ))
749 try:
750 self.assertTrue(f.seekable())
751 f.read()
752 self.assertTrue(f.seekable())
753 finally:
754 f.close()
755 self.assertRaises(ValueError, f.seekable)
756
757 f = LZMAFile(BytesIO(), "w")
758 try:
759 self.assertFalse(f.seekable())
760 finally:
761 f.close()
762 self.assertRaises(ValueError, f.seekable)
763
764 src = BytesIO(COMPRESSED_XZ)
765 src.seekable = lambda: False
766 f = LZMAFile(src)
767 try:
768 self.assertFalse(f.seekable())
769 finally:
770 f.close()
771 self.assertRaises(ValueError, f.seekable)
772
773 def test_readable(self):
774 f = LZMAFile(BytesIO(COMPRESSED_XZ))

Callers

nothing calls this directly

Calls 8

seekableMethod · 0.95
readMethod · 0.95
closeMethod · 0.95
LZMAFileClass · 0.90
BytesIOClass · 0.90
assertTrueMethod · 0.80
assertFalseMethod · 0.80
assertRaisesMethod · 0.45

Tested by

no test coverage detected