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

Method test_fileobj_regular_file

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

Source from the content-addressed store, hash-verified

126class UstarReadTest(ReadTest, unittest.TestCase):
127
128 def test_fileobj_regular_file(self):
129 tarinfo = self.tar.getmember("ustar/regtype")
130 with self.tar.extractfile(tarinfo) as fobj:
131 data = fobj.read()
132 self.assertEqual(len(data), tarinfo.size,
133 "regular file extraction failed")
134 self.assertEqual(sha256sum(data), sha256_regtype,
135 "regular file extraction failed")
136
137 def test_fileobj_readlines(self):
138 self.tar.extract("ustar/regtype", TEMPDIR, filter='data')

Callers

nothing calls this directly

Calls 5

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

Tested by

no test coverage detected