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

Method _test

Lib/test/test_tarfile.py:2217–2239  ·  view source on GitHub ↗
(self, name, link=None)

Source from the content-addressed store, hash-verified

2215class PaxWriteTest(GNUWriteTest):
2216
2217 def _test(self, name, link=None):
2218 # See GNUWriteTest.
2219 tarinfo = tarfile.TarInfo(name)
2220 if link:
2221 tarinfo.linkname = link
2222 tarinfo.type = tarfile.LNKTYPE
2223
2224 tar = tarfile.open(tmpname, "w", format=tarfile.PAX_FORMAT)
2225 try:
2226 tar.addfile(tarinfo)
2227 finally:
2228 tar.close()
2229
2230 tar = tarfile.open(tmpname)
2231 try:
2232 if link:
2233 l = tar.getmembers()[0].linkname
2234 self.assertEqual(link, l, "PAX longlink creation failed")
2235 else:
2236 n = tar.getmembers()[0].name
2237 self.assertEqual(name, n, "PAX longname creation failed")
2238 finally:
2239 tar.close()
2240
2241 def test_pax_global_header(self):
2242 pax_headers = {

Callers

nothing calls this directly

Calls 5

addfileMethod · 0.80
getmembersMethod · 0.80
openMethod · 0.45
closeMethod · 0.45
assertEqualMethod · 0.45

Tested by

no test coverage detected