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

Method test_seekable

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

Source from the content-addressed store, hash-verified

755 self.assertRaises(ValueError, f.fileno)
756
757 def test_seekable(self):
758 f = LZMAFile(BytesIO(COMPRESSED_XZ))
759 try:
760 self.assertTrue(f.seekable())
761 f.read()
762 self.assertTrue(f.seekable())
763 finally:
764 f.close()
765 self.assertRaises(ValueError, f.seekable)
766
767 f = LZMAFile(BytesIO(), "w")
768 try:
769 self.assertFalse(f.seekable())
770 finally:
771 f.close()
772 self.assertRaises(ValueError, f.seekable)
773
774 src = BytesIO(COMPRESSED_XZ)
775 src.seekable = lambda: False
776 f = LZMAFile(src)
777 try:
778 self.assertFalse(f.seekable())
779 finally:
780 f.close()
781 self.assertRaises(ValueError, f.seekable)
782
783 def test_readable(self):
784 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