コード例 #1
0
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
コード例 #2
0
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