Skip to content

Commit 4e2afca

Browse files
authored
Add more s3 tests (#191)
* tests: add s3 test with hash and space characters Close #164. * tests: ensure joinpath behavior on s3 consistent with pathlib Close #167.
1 parent 7270708 commit 4e2afca

File tree

1 file changed

+11
-0
lines changed

1 file changed

+11
-0
lines changed

upath/tests/implementations/test_s3.py

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -113,3 +113,14 @@ def s3_with_plus_chr_name(s3_server):
113113
for dir, _, keys in s3.walk(bucket):
114114
for key in keys:
115115
s3.rm(f"{dir}/{key}")
116+
117+
118+
def test_path_with_hash_and_space():
119+
assert "with#hash and space" in UPath("s3://bucket/with#hash and space/abc").parts
120+
121+
122+
def test_pathlib_consistent_join():
123+
b0 = UPath("s3://mybucket/withkey/").joinpath("subfolder/myfile.txt")
124+
b1 = UPath("s3://mybucket/withkey").joinpath("subfolder/myfile.txt")
125+
assert b0 == b1
126+
assert "s3://mybucket/withkey/subfolder/myfile.txt" == str(b0) == str(b1)

0 commit comments

Comments
 (0)