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

Method test_cwd

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

Source from the content-addressed store, hash-verified

1709 self._test_pathname("///foo", "foo")
1710
1711 def test_cwd(self):
1712 # Test adding the current working directory.
1713 with os_helper.change_cwd(TEMPDIR):
1714 tar = tarfile.open(tmpname, self.mode)
1715 try:
1716 tar.add(".")
1717 finally:
1718 tar.close()
1719
1720 tar = tarfile.open(tmpname, "r")
1721 try:
1722 for t in tar:
1723 if t.name != ".":
1724 self.assertStartsWith(t.name, "./")
1725 finally:
1726 tar.close()
1727
1728 def test_open_nonwritable_fileobj(self):
1729 for exctype in OSError, EOFError, RuntimeError:

Callers

nothing calls this directly

Calls 4

assertStartsWithMethod · 0.80
openMethod · 0.45
addMethod · 0.45
closeMethod · 0.45

Tested by

no test coverage detected