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

Method test_create_existing_taropen

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

Source from the content-addressed store, hash-verified

2068 self.assertIn('spameggs42', names[0])
2069
2070 def test_create_existing_taropen(self):
2071 with self.taropen(tmpname, "x") as tobj:
2072 tobj.add(self.file_path)
2073
2074 with self.assertRaises(FileExistsError):
2075 with self.taropen(tmpname, "x"):
2076 pass
2077
2078 with self.taropen(tmpname) as tobj:
2079 names = tobj.getnames()
2080 self.assertEqual(len(names), 1)
2081 self.assertIn("spameggs42", names[0])
2082
2083 def test_create_pathlike_name(self):
2084 with tarfile.open(os_helper.FakePath(tmpname), self.mode) as tobj:

Callers

nothing calls this directly

Calls 7

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

Tested by

no test coverage detected