Skip to content

Commit e2451e9

Browse files
authored
tests: add test for mkdir with existing gcs bucket (#263)
* tests: add test for mkdir with existing gcs bucket * tests: skip gcs test on windows
1 parent 162dd2f commit e2451e9

File tree

1 file changed

+15
-0
lines changed

1 file changed

+15
-0
lines changed

upath/tests/implementations/test_gcs.py

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
import fsspec
12
import pytest
23

34
from upath import UPath
@@ -34,3 +35,17 @@ def test_rmdir(self):
3435
@pytest.mark.skip
3536
def test_makedirs_exist_ok_false(self):
3637
pass
38+
39+
40+
@skip_on_windows
41+
def test_mkdir_in_empty_bucket(docker_gcs):
42+
fs = fsspec.filesystem("gcs", endpoint_url=docker_gcs)
43+
fs.mkdir("my-fresh-bucket")
44+
assert "my-fresh-bucket/" in fs.buckets
45+
fs.invalidate_cache()
46+
del fs
47+
48+
UPath(
49+
"gs://my-fresh-bucket/some-dir/another-dir/file",
50+
endpoint_url=docker_gcs,
51+
).parent.mkdir(parents=True, exist_ok=True)

0 commit comments

Comments
 (0)