def _make_resumable_transport(self, headers1, headers2, headers3, total_bytes):
    from google import resumable_media
    fake_transport = mock.Mock(spec=['request'])
    fake_response1 = self._mock_requests_response(http_client.OK, headers1)
    fake_response2 = self._mock_requests_response(resumable_media.PERMANENT_REDIRECT, headers2)
    json_body = '{{"size": "{:d}"}}'.format(total_bytes)
    fake_response3 = self._mock_requests_response(http_client.OK, headers3, content=json_body.encode('utf-8'))
    responses = [fake_response1, fake_response2, fake_response3]
    fake_transport.request.side_effect = responses
    return (fake_transport, responses)
def _make_resumable_transport(self, headers1, headers2, headers3, total_bytes):
    from google import resumable_media
    fake_transport = mock.Mock(spec=['request'])
    fake_response1 = self._mock_requests_response(http_client.OK, headers1)
    fake_response2 = self._mock_requests_response(resumable_media.PERMANENT_REDIRECT, headers2)
    json_body = '{{"size": "{:d}"}}'.format(total_bytes)
    fake_response3 = self._mock_requests_response(http_client.OK, headers3, content=json_body.encode('utf-8'))
    responses = [fake_response1, fake_response2, fake_response3]
    fake_transport.request.side_effect = responses
    return (fake_transport, responses)