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

Method test_fileobj_iter

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

Source from the content-addressed store, hash-verified

153 "fileobj.readlines() failed")
154
155 def test_fileobj_iter(self):
156 self.tar.extract("ustar/regtype", TEMPDIR, filter='data')
157 tarinfo = self.tar.getmember("ustar/regtype")
158 with open(os.path.join(TEMPDIR, "ustar/regtype"), "r") as fobj1:
159 lines1 = fobj1.readlines()
160 with self.tar.extractfile(tarinfo) as fobj2:
161 lines2 = list(io.TextIOWrapper(fobj2))
162 self.assertEqual(lines1, lines2,
163 "fileobj.__iter__() failed")
164
165 def test_fileobj_seek(self):
166 self.tar.extract("ustar/regtype", TEMPDIR,

Callers

nothing calls this directly

Calls 8

listClass · 0.85
getmemberMethod · 0.80
extractfileMethod · 0.80
openFunction · 0.50
extractMethod · 0.45
joinMethod · 0.45
readlinesMethod · 0.45
assertEqualMethod · 0.45

Tested by

no test coverage detected