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

Method test_fileobj_regular_file

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

Source from the content-addressed store, hash-verified

929 break
930
931 def test_fileobj_regular_file(self):
932 tarinfo = self.tar.next() # get "regtype" (can't use getmember)
933 with self.tar.extractfile(tarinfo) as fobj:
934 data = fobj.read()
935 self.assertEqual(len(data), tarinfo.size,
936 "regular file extraction failed")
937 self.assertEqual(sha256sum(data), sha256_regtype,
938 "regular file extraction failed")
939
940 def test_provoke_stream_error(self):
941 tarinfos = self.tar.getmembers()

Callers

nothing calls this directly

Calls 5

sha256sumFunction · 0.85
extractfileMethod · 0.80
nextMethod · 0.45
readMethod · 0.45
assertEqualMethod · 0.45

Tested by

no test coverage detected