def test_toplevel(tmpdir): path = ArchivePath( archive_path=sdist_path, cache_path=Path(str(tmpdir)), ) assert path.is_dir() assert not path.is_file() assert path.exists() with pytest.raises(IsADirectoryError): with path.open(): pass
def test_toplevel_missing_cache_path(tmpdir): path = ArchivePath( archive_path=sdist_path, cache_path=Path(str(tmpdir), 'missing'), ) assert path.is_dir() assert not path.is_file() assert path.exists() with pytest.raises(IsADirectoryError): with path.open(): pass with pytest.raises(NotImplementedError): with path.open('w'): pass