def test_extract_site_packages(self, tmpdir, zip_location, compile_pyc): zipfile = ZipFile(str(zip_location)) target = Path(tmpdir, "test") # Do the extraction (of our empty zip file) extract_site_packages(zipfile, target, compile_pyc) site_packages = target / "site-packages" assert site_packages.exists() assert site_packages.is_dir() assert Path(site_packages, "test").exists() assert Path(site_packages, "test").is_file()
def test_extract_site_packages(self, tmp_path, zip_location, nested, compile_pyc, force): zipfile = ZipFile(str(zip_location)) target = tmp_path / "test" if nested: # we want to test for not-yet-created shiv root dirs target = target / "nested" / "root" if force: # we want to make sure we overwrite if the target exists when using force target.mkdir(parents=True, exist_ok=True) # Do the extraction (of our empty zip file) extract_site_packages(zipfile, target, compile_pyc, force=force) site_packages = target / "site-packages" assert site_packages.exists() assert site_packages.is_dir() assert Path(site_packages, "test").exists() assert Path(site_packages, "test").is_file()