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

Method test_read_through

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

Source from the content-addressed store, hash-verified

913 is_stream = True
914
915 def test_read_through(self):
916 # Issue #11224: A poorly designed _FileInFile.read() method
917 # caused seeking errors with stream tar files.
918 for tarinfo in self.tar:
919 if not tarinfo.isreg():
920 continue
921 with self.tar.extractfile(tarinfo) as fobj:
922 while True:
923 try:
924 buf = fobj.read(512)
925 except tarfile.StreamError:
926 self.fail("simple read-through using "
927 "TarFile.extractfile() failed")
928 if not buf:
929 break
930
931 def test_fileobj_regular_file(self):
932 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