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

Method test_register_archive_format

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

Source from the content-addressed store, hash-verified

2069 self.assertEqual(called_args, [('basename', 'basedir', root_dir)])
2070
2071 def test_register_archive_format(self):
2072
2073 self.assertRaises(TypeError, register_archive_format, 'xxx', 1)
2074 self.assertRaises(TypeError, register_archive_format, 'xxx', lambda: x,
2075 1)
2076 self.assertRaises(TypeError, register_archive_format, 'xxx', lambda: x,
2077 [(1, 2), (1, 2, 3)])
2078
2079 register_archive_format('xxx', lambda: x, [(1, 2)], 'xxx file')
2080 formats = [name for name, params in get_archive_formats()]
2081 self.assertIn('xxx', formats)
2082
2083 unregister_archive_format('xxx')
2084 formats = [name for name, params in get_archive_formats()]
2085 self.assertNotIn('xxx', formats)
2086
2087 def test_make_tarfile_rootdir_nodir(self):
2088 # GH-99203: Test with root_dir is not a real directory.

Callers

nothing calls this directly

Calls 6

register_archive_formatFunction · 0.90
get_archive_formatsFunction · 0.90
assertInMethod · 0.80
assertNotInMethod · 0.80
assertRaisesMethod · 0.45

Tested by

no test coverage detected