Skip to content

Commit

Permalink
Add more s3 tests (#191)
Browse files Browse the repository at this point in the history
* tests: add s3 test with hash and space characters

Close #164.

* tests: ensure joinpath behavior on s3 consistent with pathlib

Close #167.
  • Loading branch information
ap-- authored Feb 18, 2024
1 parent 7270708 commit 4e2afca
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions upath/tests/implementations/test_s3.py
Original file line number Diff line number Diff line change
Expand Up @@ -113,3 +113,14 @@ def s3_with_plus_chr_name(s3_server):
for dir, _, keys in s3.walk(bucket):
for key in keys:
s3.rm(f"{dir}/{key}")


def test_path_with_hash_and_space():
assert "with#hash and space" in UPath("s3://bucket/with#hash and space/abc").parts


def test_pathlib_consistent_join():
b0 = UPath("s3://mybucket/withkey/").joinpath("subfolder/myfile.txt")
b1 = UPath("s3://mybucket/withkey").joinpath("subfolder/myfile.txt")
assert b0 == b1
assert "s3://mybucket/withkey/subfolder/myfile.txt" == str(b0) == str(b1)

0 comments on commit 4e2afca

Please sign in to comment.