Skip to content

Commit 2f699da

Browse files
authored
Add test for size API (#196)
1 parent d92e317 commit 2f699da

File tree

1 file changed

+11
-0
lines changed

1 file changed

+11
-0
lines changed

tosfs/tests/test_fsspec.py

+11
Original file line numberDiff line numberDiff line change
@@ -875,3 +875,14 @@ def test_tail(fsspecfs: Any, bucket: str, temporary_workspace: str):
875875

876876
with pytest.raises(IsADirectoryError):
877877
fsspecfs.tail(path, 3)
878+
879+
880+
def test_size(fsspecfs: Any, bucket: str, temporary_workspace: str):
881+
file_name = random_str()
882+
path = f"{bucket}/{temporary_workspace}/{file_name}"
883+
content = "hello world"
884+
with fsspecfs.open(path, "w") as f:
885+
f.write(content)
886+
887+
assert fsspecfs.size(path) == len(content)
888+
assert fsspecfs.size(f"{bucket}/{temporary_workspace}") == 0

0 commit comments

Comments
 (0)