Skip to content

Commit

Permalink
Run test cases on hns
Browse files Browse the repository at this point in the history
  • Loading branch information
yanghua committed Oct 19, 2024
1 parent 066f9d3 commit 37435ec
Showing 1 changed file with 10 additions and 1 deletion.
11 changes: 10 additions & 1 deletion tosfs/tests/test_tosfs.py
Original file line number Diff line number Diff line change
Expand Up @@ -857,11 +857,20 @@ def test_big_file_append(
f.write(content)

append_content = "a" * 1024 * 1024
with pytest.raises(TosServerError):
if tosfs._is_fns_bucket(bucket):
with pytest.raises(TosServerError):
with tosfs.open(f"{bucket}/{temporary_workspace}/{file_name}", "a") as f:
f.write(append_content)
else:
with tosfs.open(f"{bucket}/{temporary_workspace}/{file_name}", "a") as f:
f.write(append_content)

with tosfs.open(f"{bucket}/{temporary_workspace}/{file_name}", "r") as f:
assert f.read() == content + append_content

another_file = random_str()
if tosfs._is_hns_bucket(bucket):
tosfs.touch(f"{bucket}/{temporary_workspace}/{another_file}")
with tosfs.open(f"{bucket}/{temporary_workspace}/{another_file}", "a") as f:
f.write(content)

Expand Down

0 comments on commit 37435ec

Please sign in to comment.