MCPcopy Index your code
hub / github.com/RustPython/RustPython / test_register_archive_format

Method test_register_archive_format

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

Source from the content-addressed store, hash-verified

2043 self.assertTrue(os.path.isfile('test.zip'))
2044
2045 def test_register_archive_format(self):
2046
2047 self.assertRaises(TypeError, register_archive_format, 'xxx', 1)
2048 self.assertRaises(TypeError, register_archive_format, 'xxx', lambda: x,
2049 1)
2050 self.assertRaises(TypeError, register_archive_format, 'xxx', lambda: x,
2051 [(1, 2), (1, 2, 3)])
2052
2053 register_archive_format('xxx', lambda: x, [(1, 2)], 'xxx file')
2054 formats = [name for name, params in get_archive_formats()]
2055 self.assertIn('xxx', formats)
2056
2057 unregister_archive_format('xxx')
2058 formats = [name for name, params in get_archive_formats()]
2059 self.assertNotIn('xxx', formats)
2060
2061 def test_make_tarfile_rootdir_nodir(self):
2062 # 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