Skip to content

Commit

Permalink
test: Fix test for chunk upload 3
Browse files Browse the repository at this point in the history
  • Loading branch information
lukaszsocha2 committed Mar 3, 2023
1 parent 6f4ff0f commit 8380914
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion test/unit/object/test_chunked_upload.py
Expand Up @@ -252,6 +252,7 @@ def test_resume_in_process(test_file, mock_upload_session):
call(offset=2, part_bytes=b'cd', total_size=7),
call(offset=4, part_bytes=b'ef', total_size=7),
call(offset=6, part_bytes=b'g', total_size=7),
call(offset=4, part_bytes=b'ef', total_size=7),
]
try:
chunked_uploader.start()
Expand Down Expand Up @@ -321,7 +322,13 @@ def upload_mock_func(part_bytes, offset, total_size):
chunked_uploader.start()
except BoxAPIException:
uploaded_file = chunked_uploader.resume()
calls = [call(offset=4, part_bytes=b'ef', total_size=7)]
calls = [
call(offset=0, part_bytes=b'ab', total_size=7),
call(offset=2, part_bytes=b'cd', total_size=7),
call(offset=4, part_bytes=b'ef', total_size=7),
call(offset=6, part_bytes=b'g', total_size=7),
call(offset=4, part_bytes=b'ef', total_size=7),
]
mock_upload_session.upload_part_bytes.assert_has_calls(calls, any_order=True)
mock_upload_session.commit.assert_called_once_with(
content_sha1=b'/\xb5\xe14\x19\xfc\x89$he\xe7\xa3$\xf4v\xecbN\x87@',
Expand Down

0 comments on commit 8380914

Please sign in to comment.