def check_extract(self, test_function, test_file, expected, expected_warnings=None, check_all=False):
    '\n        Run the extraction `test_function` on `test_file` checking that a map of\n        expected paths --> size exist in the extracted target directory.\n        Does not test the presence of all files unless `check_all` is True.\n        '
    from extractcode import archive
    test_file = self.get_test_loc(test_file)
    test_dir = self.get_temp_dir()
    warnings = test_function(test_file, test_dir)
    if (expected_warnings is not None):
        assert (expected_warnings == warnings)
    if check_all:
        len_test_dir = len(test_dir)
        extracted = {path[len_test_dir:]: filetype.get_size(path) for path in fileutils.resource_iter(test_dir, with_dirs=False)}
        expected = {os.path.join(test_dir, exp_path): exp_size for (exp_path, exp_size) in expected.items()}
        assert (sorted(expected.items()) == sorted(extracted.items()))
    else:
        for (exp_path, exp_size) in expected.items():
            exp_loc = os.path.join(test_dir, exp_path)
            msg = 'When extracting: %(test_file)s\n                    With function: %(test_function)r\n                    Failed to find expected path: %(exp_loc)s'
            assert os.path.exists(exp_loc), (msg % locals())
            if (exp_size is not None):
                res_size = os.stat(exp_loc).st_size
                msg = 'When extracting: %(test_file)s\n                        With function: %(test_function)r\n                        Failed to assert the correct size %(exp_size)d\n                        Got instead: %(res_size)d\n                        for expected path: %(exp_loc)s'
                assert (exp_size == res_size), (msg % locals())
Run the extraction `test_function` on `test_file` checking that a map of
expected paths --> size exist in the extracted target directory.
Does not test the presence of all files unless `check_all` is True.
def check_extract(self, test_function, test_file, expected, expected_warnings=None, check_all=False):
    '\n        Run the extraction `test_function` on `test_file` checking that a map of\n        expected paths --> size exist in the extracted target directory.\n        Does not test the presence of all files unless `check_all` is True.\n        '
    from extractcode import archive
    test_file = self.get_test_loc(test_file)
    test_dir = self.get_temp_dir()
    warnings = test_function(test_file, test_dir)
    if (expected_warnings is not None):
        assert (expected_warnings == warnings)
    if check_all:
        len_test_dir = len(test_dir)
        extracted = {path[len_test_dir:]: filetype.get_size(path) for path in fileutils.resource_iter(test_dir, with_dirs=False)}
        expected = {os.path.join(test_dir, exp_path): exp_size for (exp_path, exp_size) in expected.items()}
        assert (sorted(expected.items()) == sorted(extracted.items()))
    else:
        for (exp_path, exp_size) in expected.items():
            exp_loc = os.path.join(test_dir, exp_path)
            msg = 'When extracting: %(test_file)s\n                    With function: %(test_function)r\n                    Failed to find expected path: %(exp_loc)s'
            assert os.path.exists(exp_loc), (msg % locals())
            if (exp_size is not None):
                res_size = os.stat(exp_loc).st_size
                msg = 'When extracting: %(test_file)s\n                        With function: %(test_function)r\n                        Failed to assert the correct size %(exp_size)d\n                        Got instead: %(res_size)d\n                        for expected path: %(exp_loc)s'
                assert (exp_size == res_size), (msg % locals())