def _data_test(filename, *args, **kwargs): with util.directory_created("data_scratch") as directory: yield directory # Files are now created with util.archive_created("data.xar", "./data_scratch", *args, **kwargs) as path: _process_toc(path) with util.directory_created("data_extracted") as extracted: subprocess.check_call(["xar", "-x", "-f", path, "-C", extracted]) util.assert_identical_directories(directory, os.path.join(extracted, "data_scratch"))
def _check_compression(filename, *args, **kwargs): with util.archive_created(filename, "/bin", *args, **kwargs) as path: with util.directory_created("extracted") as directory: subprocess.check_call(["xar", "-x", "-f", path, "-C", directory]) util.assert_identical_directories("/bin", os.path.join(directory, "bin"))