def _do_upload_helper(self, chunk_size=None, num_retries=None):
    blob = self._make_one(u'blob-name', bucket=None)
    response = mock.Mock(spec=[u'json'])
    response.json.return_value = mock.sentinel.json
    blob._do_multipart_upload = mock.Mock(return_value=response, spec=[])
    blob._do_resumable_upload = mock.Mock(return_value=response, spec=[])
    if (chunk_size is None):
        self.assertIsNone(blob.chunk_size)
    else:
        blob.chunk_size = chunk_size
        self.assertIsNotNone(blob.chunk_size)
    client = mock.sentinel.client
    stream = mock.sentinel.stream
    content_type = u'video/mp4'
    size = 12345654321
    created_json = blob._do_upload(client, stream, content_type, size, num_retries)
    self.assertIs(created_json, mock.sentinel.json)
    response.json.assert_called_once_with()
    if (chunk_size is None):
        blob._do_multipart_upload.assert_called_once_with(client, stream, content_type, size, num_retries)
        blob._do_resumable_upload.assert_not_called()
    else:
        blob._do_multipart_upload.assert_not_called()
        blob._do_resumable_upload.assert_called_once_with(client, stream, content_type, size, num_retries)
def _do_upload_helper(self, chunk_size=None, num_retries=None):
    blob = self._make_one(u'blob-name', bucket=None)
    response = mock.Mock(spec=[u'json'])
    response.json.return_value = mock.sentinel.json
    blob._do_multipart_upload = mock.Mock(return_value=response, spec=[])
    blob._do_resumable_upload = mock.Mock(return_value=response, spec=[])
    if (chunk_size is None):
        self.assertIsNone(blob.chunk_size)
    else:
        blob.chunk_size = chunk_size
        self.assertIsNotNone(blob.chunk_size)
    client = mock.sentinel.client
    stream = mock.sentinel.stream
    content_type = u'video/mp4'
    size = 12345654321
    created_json = blob._do_upload(client, stream, content_type, size, num_retries)
    self.assertIs(created_json, mock.sentinel.json)
    response.json.assert_called_once_with()
    if (chunk_size is None):
        blob._do_multipart_upload.assert_called_once_with(client, stream, content_type, size, num_retries)
        blob._do_resumable_upload.assert_not_called()
    else:
        blob._do_multipart_upload.assert_not_called()
        blob._do_resumable_upload.assert_called_once_with(client, stream, content_type, size, num_retries)