def test_file_bucket_client_fs_open(with_adapter: str) -> None: client: BucketClientFS = get_client("gs") blob = Pathy("gs://foo/bar") with pytest.raises(ClientError): client.open(blob) blob.mkdir() blob.touch() assert client.open(blob) is not None
def test_file_bucket_client_fs_list_blobs(with_adapter: str) -> None: client: BucketClientFS = get_client("gs") root = Pathy("gs://bucket") root.mkdir(exist_ok=True) blob = Pathy("gs://bucket/foo/bar/baz") blob.touch() blobs = [b.name for b in client.list_blobs(root, prefix="foo/bar/")] assert blobs == ["foo/bar/baz"] blobs = [b.name for b in client.list_blobs(root, prefix="foo/bar/baz")] assert len(blobs) == 1