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

Method test_create_existing_taropen

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

Source from the content-addressed store, hash-verified

2085 self.assertIn('spameggs42', names[0])
2086
2087 def test_create_existing_taropen(self):
2088 with self.taropen(tmpname, "x") as tobj:
2089 tobj.add(self.file_path)
2090
2091 with self.assertRaises(FileExistsError):
2092 with self.taropen(tmpname, "x"):
2093 pass
2094
2095 with self.taropen(tmpname) as tobj:
2096 names = tobj.getnames()
2097 self.assertEqual(len(names), 1)
2098 self.assertIn("spameggs42", names[0])
2099
2100 def test_create_pathlike_name(self):
2101 with tarfile.open(os_helper.FakePath(tmpname), self.mode) as tobj:

Callers

nothing calls this directly

Calls 6

taropenMethod · 0.80
getnamesMethod · 0.80
assertInMethod · 0.80
addMethod · 0.45
assertRaisesMethod · 0.45
assertEqualMethod · 0.45

Tested by

no test coverage detected