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

Method test_create_taropen_pathlike_name

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

Source from the content-addressed store, hash-verified

2112 self.assertIn('spameggs42', names[0])
2113
2114 def test_create_taropen_pathlike_name(self):
2115 with self.taropen(os_helper.FakePath(tmpname), "x") as tobj:
2116 self.assertIsInstance(tobj.name, str)
2117 self.assertEqual(tobj.name, os.path.abspath(tmpname))
2118 tobj.add(os_helper.FakePath(self.file_path))
2119 names = tobj.getnames()
2120 self.assertEqual(len(names), 1)
2121 self.assertIn('spameggs42', names[0])
2122
2123 with self.taropen(tmpname) as tobj:
2124 names = tobj.getnames()
2125 self.assertEqual(len(names), 1)
2126 self.assertIn('spameggs42', names[0])
2127
2128
2129class GzipCreateTest(GzipTest, CreateTest):

Callers

nothing calls this directly

Calls 7

taropenMethod · 0.80
assertIsInstanceMethod · 0.80
getnamesMethod · 0.80
assertInMethod · 0.80
assertEqualMethod · 0.45
abspathMethod · 0.45
addMethod · 0.45

Tested by

no test coverage detected