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

Method test_make_archive_cwd_default

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

Source from the content-addressed store, hash-verified

1967 archive.close()
1968
1969 def test_make_archive_cwd_default(self):
1970 current_dir = os.getcwd()
1971 def archiver(base_name, base_dir, **kw):
1972 self.assertNotIn('root_dir', kw)
1973 self.assertEqual(base_name, 'basename')
1974 self.assertEqual(os.getcwd(), current_dir)
1975 raise RuntimeError()
1976
1977 register_archive_format('xxx', archiver, [], 'xxx file')
1978 try:
1979 with no_chdir:
1980 with self.assertRaises(RuntimeError):
1981 make_archive('basename', 'xxx')
1982 self.assertEqual(os.getcwd(), current_dir)
1983 finally:
1984 unregister_archive_format('xxx')
1985
1986 def test_make_archive_cwd(self):
1987 current_dir = os.getcwd()

Callers

nothing calls this directly

Calls 5

register_archive_formatFunction · 0.90
make_archiveFunction · 0.90
assertRaisesMethod · 0.45
assertEqualMethod · 0.45

Tested by

no test coverage detected