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

Method test_fileobj_readlines

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

Source from the content-addressed store, hash-verified

137 "regular file extraction failed")
138
139 def test_fileobj_readlines(self):
140 self.tar.extract("ustar/regtype", TEMPDIR, filter='data')
141 tarinfo = self.tar.getmember("ustar/regtype")
142 with open(os.path.join(TEMPDIR, "ustar/regtype"), "r") as fobj1:
143 lines1 = fobj1.readlines()
144
145 with self.tar.extractfile(tarinfo) as fobj:
146 fobj2 = io.TextIOWrapper(fobj)
147 lines2 = fobj2.readlines()
148 self.assertEqual(lines1, lines2,
149 "fileobj.readlines() failed")
150 self.assertEqual(len(lines2), 114,
151 "fileobj.readlines() failed")
152 self.assertEqual(lines2[83],
153 "I will gladly admit that Python is not the fastest "
154 "running scripting language.\n",
155 "fileobj.readlines() failed")
156
157 def test_fileobj_iter(self):
158 self.tar.extract("ustar/regtype", TEMPDIR, filter='data')

Callers

nothing calls this directly

Calls 8

lenFunction · 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