Skip to content

Commit

Permalink
tests: add test for mkdir with existing gcs bucket
Browse files Browse the repository at this point in the history
  • Loading branch information
ap-- committed Aug 31, 2024
1 parent 162dd2f commit 6115c21
Showing 1 changed file with 14 additions and 0 deletions.
14 changes: 14 additions & 0 deletions upath/tests/implementations/test_gcs.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import fsspec
import pytest

from upath import UPath
Expand Down Expand Up @@ -34,3 +35,16 @@ def test_rmdir(self):
@pytest.mark.skip
def test_makedirs_exist_ok_false(self):
pass


def test_mkdir_in_empty_bucket(docker_gcs):
fs = fsspec.filesystem("gcs", endpoint_url=docker_gcs)
fs.mkdir("my-fresh-bucket")
assert "my-fresh-bucket/" in fs.buckets
fs.invalidate_cache()
del fs

UPath(
"gs://my-fresh-bucket/some-dir/another-dir/file",
endpoint_url=docker_gcs,
).parent.mkdir(parents=True, exist_ok=True)

0 comments on commit 6115c21

Please sign in to comment.