MCPcopy Create free account
hub / github.com/python/cpython / test_make_tarfile_with_explicit_curdir

Method test_make_tarfile_with_explicit_curdir

Lib/test/test_shutil.py:1710–1723  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

1708 'dist/file1', 'dist/file2', 'dist/sub/file3'])
1709
1710 def test_make_tarfile_with_explicit_curdir(self):
1711 # Test with base_dir=os.curdir.
1712 root_dir, base_dir = self._create_files()
1713 with os_helper.temp_cwd(), no_chdir:
1714 base_name = os.path.join('dst', 'archive')
1715 archive = make_archive(base_name, 'tar', root_dir, os.curdir)
1716 self.assertEqual(archive, os.path.abspath(base_name) + '.tar')
1717 self.assertTrue(os.path.isfile(archive))
1718 self.assertTrue(tarfile.is_tarfile(archive))
1719 with tarfile.open(archive, 'r') as tf:
1720 self.assertCountEqual(tf.getnames(),
1721 ['.', './dist', './dist/sub', './dist/sub2',
1722 './dist/file1', './dist/file2', './dist/sub/file3',
1723 './outer'])
1724
1725 @support.requires_zlib()
1726 @unittest.skipUnless(shutil.which('tar'),

Callers

nothing calls this directly

Calls 10

_create_filesMethod · 0.95
make_archiveFunction · 0.90
assertTrueMethod · 0.80
assertCountEqualMethod · 0.80
getnamesMethod · 0.80
joinMethod · 0.45
assertEqualMethod · 0.45
abspathMethod · 0.45
isfileMethod · 0.45
openMethod · 0.45

Tested by

no test coverage detected