Пример #1
0
def test_api_resolve(with_adapter, bucket: str):
    path = Pathy(f"gs://{bucket}/fake-key")
    assert path.resolve() == path
    path = Pathy(f"gs://{bucket}/dir/../fake-key")
    assert path.resolve() == Pathy(f"gs://{bucket}/fake-key")
Пример #2
0
def test_base_not_supported(monkeypatch):
    monkeypatch.setattr(Pathy._flavour, "is_supported", False)
    with pytest.raises(NotImplementedError):
        Pathy()
Пример #3
0
def test_base_symlink_to():
    path = Pathy("/fake-bucket/fake-key")
    with pytest.raises(NotImplementedError):
        path.symlink_to("file_name")
Пример #4
0
def test_api_is_path_instance(with_adapter):
    blob = Pathy("gs://fake/blob")
    assert isinstance(blob, Path)
Пример #5
0
def test_base_lstat():
    path = Pathy("/fake-bucket/fake-key")
    with pytest.raises(NotImplementedError):
        path.lstat()