Skip to content

Commit be720f4

Browse files
committed
fixup! Add support for "upload-ID" parameter to initiate_resumable
After failing file API tests, it became apparent it was needed a more thorough check for combination(s) of `to_resume` and `upload_id` when either or both may contain uploading identifier. This commit resolves cause for the failing tests in the file API.
1 parent ac0d0eb commit be720f4

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

tsdapiclient/fileapi.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -849,7 +849,8 @@ def initiate_resumable(
849849
if dev_url:
850850
dev_url = dev_url.replace('resumables', 'stream')
851851
if to_resume:
852-
assert not upload_id # `to_resume`, as passed to `_continue_resumable`, is expected to contain an uploading ID, so if `upload_id` is specified it's an ambiguity, which we choose not to resolve
852+
if 'id' in to_resume:
853+
assert not upload_id or upload_id == to_resume['id'] # `to_resume` contains an uploading ID and so may `upload_id`, if it does then a mismatch would make for an ambiguity which we choose not to resolve
853854
try:
854855
return _continue_resumable(
855856
env,

0 commit comments

Comments
 (0)