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

Method test_create_existing

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

Source from the content-addressed store, hash-verified

2064 self.assertIn('spameggs42', names[0])
2065
2066 def test_create_existing(self):
2067 with tarfile.open(tmpname, self.mode) as tobj:
2068 tobj.add(self.file_path)
2069
2070 with self.assertRaises(FileExistsError):
2071 tobj = tarfile.open(tmpname, self.mode)
2072
2073 with self.taropen(tmpname) as tobj:
2074 names = tobj.getnames()
2075 self.assertEqual(len(names), 1)
2076 self.assertIn('spameggs42', names[0])
2077
2078 def test_create_taropen(self):
2079 with self.taropen(tmpname, "x") as tobj:

Callers

nothing calls this directly

Calls 7

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

Tested by

no test coverage detected