def setUp(self): super(TestUploadNonSeekableInputManager, self).setUp() self.upload_input_manager = UploadNonSeekableInputManager( self.osutil, self.transfer_coordinator) self.fileobj = NonSeekableReader(self.content) self.call_args = CallArgs(fileobj=self.fileobj, subscribers=self.subscribers) self.future = self.get_transfer_future(self.call_args)
def test_upload_for_non_seekable_filelike_obj(self): self.add_put_object_response_with_default_expected_params() body = NonSeekableReader(self.content) future = self.manager.upload(body, self.bucket, self.key, self.extra_args) future.result() self.assert_expected_client_calls_were_correct() self.assert_put_object_body_was_correct()
def test_upload_for_non_seekable_filelike_obj(self): self.add_create_multipart_response_with_default_expected_params() self.add_upload_part_responses_with_default_expected_params() self.add_complete_multipart_response_with_default_expected_params() stream = NonSeekableReader(self.content) future = self.manager.upload(stream, self.bucket, self.key, self.extra_args) future.result() self.assert_expected_client_calls_were_correct() self.assert_upload_part_bodies_were_correct()
def get_input_fileobj(self, size, name=''): return NonSeekableReader(b'0' * size)