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

Method test_create_existing

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

Source from the content-addressed store, hash-verified

2047 self.assertIn('spameggs42', names[0])
2048
2049 def test_create_existing(self):
2050 with tarfile.open(tmpname, self.mode) as tobj:
2051 tobj.add(self.file_path)
2052
2053 with self.assertRaises(FileExistsError):
2054 tobj = tarfile.open(tmpname, self.mode)
2055
2056 with self.taropen(tmpname) as tobj:
2057 names = tobj.getnames()
2058 self.assertEqual(len(names), 1)
2059 self.assertIn('spameggs42', names[0])
2060
2061 def test_create_taropen(self):
2062 with self.taropen(tmpname, "x") as tobj:

Callers

nothing calls this directly

Calls 8

lenFunction · 0.85
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