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

Method _test

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

Source from the content-addressed store, hash-verified

2198class PaxWriteTest(GNUWriteTest):
2199
2200 def _test(self, name, link=None):
2201 # See GNUWriteTest.
2202 tarinfo = tarfile.TarInfo(name)
2203 if link:
2204 tarinfo.linkname = link
2205 tarinfo.type = tarfile.LNKTYPE
2206
2207 tar = tarfile.open(tmpname, "w", format=tarfile.PAX_FORMAT)
2208 try:
2209 tar.addfile(tarinfo)
2210 finally:
2211 tar.close()
2212
2213 tar = tarfile.open(tmpname)
2214 try:
2215 if link:
2216 l = tar.getmembers()[0].linkname
2217 self.assertEqual(link, l, "PAX longlink creation failed")
2218 else:
2219 n = tar.getmembers()[0].name
2220 self.assertEqual(name, n, "PAX longname creation failed")
2221 finally:
2222 tar.close()
2223
2224 def test_pax_global_header(self):
2225 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