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

Method test_add_self

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

Source from the content-addressed store, hash-verified

1571 os_helper.unlink(path)
1572
1573 def test_add_self(self):
1574 # Test for #1257255.
1575 dstname = os.path.abspath(tmpname)
1576 tar = tarfile.open(tmpname, self.mode)
1577 try:
1578 self.assertEqual(tar.name, dstname,
1579 "archive name must be absolute")
1580 tar.add(dstname)
1581 self.assertEqual(tar.getnames(), [],
1582 "added the archive to itself")
1583
1584 with os_helper.change_cwd(TEMPDIR):
1585 tar.add(dstname)
1586 self.assertEqual(tar.getnames(), [],
1587 "added the archive to itself")
1588 finally:
1589 tar.close()
1590
1591 def test_filter(self):
1592 tempdir = os.path.join(TEMPDIR, "filter")

Callers

nothing calls this directly

Calls 6

getnamesMethod · 0.80
abspathMethod · 0.45
openMethod · 0.45
assertEqualMethod · 0.45
addMethod · 0.45
closeMethod · 0.45

Tested by

no test coverage detected