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

Method test_make_zipfile_with_explicit_curdir

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

Source from the content-addressed store, hash-verified

1841
1842 @support.requires_zlib()
1843 def test_make_zipfile_with_explicit_curdir(self):
1844 # Test with base_dir=os.curdir.
1845 root_dir, base_dir = self._create_files()
1846 with os_helper.temp_cwd(), no_chdir:
1847 base_name = os.path.join('dst', 'archive')
1848 archive = make_archive(base_name, 'zip', root_dir, os.curdir)
1849 self.assertEqual(archive, os.path.abspath(base_name) + '.zip')
1850 self.assertTrue(os.path.isfile(archive))
1851 self.assertTrue(zipfile.is_zipfile(archive))
1852 with zipfile.ZipFile(archive) as zf:
1853 self.assertCountEqual(zf.namelist(),
1854 ['dist/', 'dist/sub/', 'dist/sub2/',
1855 'dist/file1', 'dist/file2', 'dist/sub/file3',
1856 'outer'])
1857
1858 @support.requires_zlib()
1859 @unittest.skipUnless(shutil.which('zip'),

Callers

nothing calls this directly

Calls 9

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

Tested by

no test coverage detected