Skip to content

CI: Test #923

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 2 commits into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions s3fs/tests/test_s3fs.py
Original file line number Diff line number Diff line change
Expand Up @@ -1408,13 +1408,15 @@ def test_append(s3):
pass # append, no write, big file
data = s3.cat(a)
assert len(data) == 10 * 2**20 and set(data) == set(b"a")
time.sleep(0.1)

with s3.open(a, "ab") as f:
assert f.parts is None
f._initiate_upload()
assert f.parts
assert f.tell() == 10 * 2**20
f.write(b"extra") # append, small write, big file
time.sleep(0.1)
data = s3.cat(a)
assert len(data) == 10 * 2**20 + len(b"extra")
assert data[-5:] == b"extra"
Expand All @@ -1423,6 +1425,7 @@ def test_append(s3):
assert f.tell() == 10 * 2**20 + 5
f.write(b"b" * 10 * 2**20) # append, big write, big file
assert f.tell() == 20 * 2**20 + 5
time.sleep(0.1)
data = s3.cat(a)
assert len(data) == 10 * 2**20 + len(b"extra") + 10 * 2**20
assert data[10 * 2**20 : 10 * 2**20 + 5] == b"extra"
Expand Down
Loading