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

Method test_add_self

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

Source from the content-addressed store, hash-verified

1554 os_helper.unlink(path)
1555
1556 def test_add_self(self):
1557 # Test for #1257255.
1558 dstname = os.path.abspath(tmpname)
1559 tar = tarfile.open(tmpname, self.mode)
1560 try:
1561 self.assertEqual(tar.name, dstname,
1562 "archive name must be absolute")
1563 tar.add(dstname)
1564 self.assertEqual(tar.getnames(), [],
1565 "added the archive to itself")
1566
1567 with os_helper.change_cwd(TEMPDIR):
1568 tar.add(dstname)
1569 self.assertEqual(tar.getnames(), [],
1570 "added the archive to itself")
1571 finally:
1572 tar.close()
1573
1574 def test_filter(self):
1575 tempdir = os.path.join(TEMPDIR, "filter")

Callers

nothing calls this directly

Calls 5

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

Tested by

no test coverage detected