@@ -868,28 +868,36 @@ def test_resumable_multipart_media_good_upload(self):
868
868
({'status' : '200' ,
869
869
'location' : 'http://upload.example.com' }, '' ),
870
870
({'status' : '308' ,
871
- 'location' : 'http://upload.example.com/2' ,
872
- 'range' : '0-12' }, '' ),
871
+ 'location' : 'http://upload.example.com/2' }, '' ),
873
872
({'status' : '308' ,
874
873
'location' : 'http://upload.example.com/3' ,
874
+ 'range' : '0-12' }, '' ),
875
+ ({'status' : '308' ,
876
+ 'location' : 'http://upload.example.com/4' ,
875
877
'range' : '0-%d' % (media_upload .size () - 2 )}, '' ),
876
878
({'status' : '200' }, '{"foo": "bar"}' ),
877
879
])
878
880
879
881
status , body = request .next_chunk (http = http )
880
882
self .assertEquals (None , body )
881
883
self .assertTrue (isinstance (status , MediaUploadProgress ))
882
- self .assertEquals (13 , status .resumable_progress )
884
+ self .assertEquals (0 , status .resumable_progress )
883
885
884
886
# Two requests should have been made and the resumable_uri should have been
885
887
# updated for each one.
886
888
self .assertEquals (request .resumable_uri , 'http://upload.example.com/2' )
887
-
889
+ self .assertEquals (media_upload , request .resumable )
890
+ self .assertEquals (0 , request .resumable_progress )
891
+
892
+ # This next chuck call should upload the first chunk
893
+ status , body = request .next_chunk (http = http )
894
+ self .assertEquals (request .resumable_uri , 'http://upload.example.com/3' )
888
895
self .assertEquals (media_upload , request .resumable )
889
896
self .assertEquals (13 , request .resumable_progress )
890
897
898
+ # This call will upload the next chunk
891
899
status , body = request .next_chunk (http = http )
892
- self .assertEquals (request .resumable_uri , 'http://upload.example.com/3 ' )
900
+ self .assertEquals (request .resumable_uri , 'http://upload.example.com/4 ' )
893
901
self .assertEquals (media_upload .size ()- 1 , request .resumable_progress )
894
902
self .assertEquals ('{"data": {}}' , request .body )
895
903
0 commit comments