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

Method test_fileobj_text

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

Source from the content-addressed store, hash-verified

212 "read() after readline() failed")
213
214 def test_fileobj_text(self):
215 with self.tar.extractfile("ustar/regtype") as fobj:
216 fobj = io.TextIOWrapper(fobj)
217 data = fobj.read().encode("iso8859-1")
218 self.assertEqual(sha256sum(data), sha256_regtype)
219 try:
220 fobj.seek(100)
221 except AttributeError:
222 # Issue #13815: seek() complained about a missing
223 # flush() method.
224 self.fail("seeking failed in text mode")
225
226 # Test if symbolic and hard links are resolved by extractfile(). The
227 # test link members each point to a regular member whose data is

Callers

nothing calls this directly

Calls 7

readMethod · 0.95
seekMethod · 0.95
sha256sumFunction · 0.85
extractfileMethod · 0.80
encodeMethod · 0.45
assertEqualMethod · 0.45
failMethod · 0.45

Tested by

no test coverage detected