From 37435ecc6d132957c9661587602c775f51b51864 Mon Sep 17 00:00:00 2001 From: yanghua Date: Sat, 19 Oct 2024 14:22:54 +0800 Subject: [PATCH] Run test cases on hns --- tosfs/tests/test_tosfs.py | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/tosfs/tests/test_tosfs.py b/tosfs/tests/test_tosfs.py index 5a518ce..6432109 100644 --- a/tosfs/tests/test_tosfs.py +++ b/tosfs/tests/test_tosfs.py @@ -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)