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

Method test_read_through

Lib/test/test_tarfile.py:917–931  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

915 is_stream = True
916
917 def test_read_through(self):
918 # Issue #11224: A poorly designed _FileInFile.read() method
919 # caused seeking errors with stream tar files.
920 for tarinfo in self.tar:
921 if not tarinfo.isreg():
922 continue
923 with self.tar.extractfile(tarinfo) as fobj:
924 while True:
925 try:
926 buf = fobj.read(512)
927 except tarfile.StreamError:
928 self.fail("simple read-through using "
929 "TarFile.extractfile() failed")
930 if not buf:
931 break
932
933 def test_fileobj_regular_file(self):
934 tarinfo = self.tar.next() # get "regtype" (can't use getmember)

Callers

nothing calls this directly

Calls 4

isregMethod · 0.80
extractfileMethod · 0.80
readMethod · 0.45
failMethod · 0.45

Tested by

no test coverage detected