transfer_test_12.py 915 B

123456789101112131415161718192021222324
  1. def setUp(self):
  2. # Sample highly compressible data.
  3. self.sample_data = b'abc' * 200
  4. # Stream of the sample data.
  5. self.sample_stream = six.BytesIO(self.sample_data)
  6. # Sample url_builder.
  7. self.url_builder = base_api._UrlBuilder('http://www.uploads.com')
  8. # Sample request.
  9. self.request = http_wrapper.Request(
  10. 'http://www.uploads.com',
  11. headers={'content-type': 'text/plain'})
  12. # Sample successful response.
  13. self.response = http_wrapper.Response(
  14. info={'status': http_client.OK,
  15. 'location': 'http://www.uploads.com'},
  16. content='',
  17. request_url='http://www.uploads.com',)
  18. # Sample failure response.
  19. self.fail_response = http_wrapper.Response(
  20. info={'status': http_client.SERVICE_UNAVAILABLE,
  21. 'location': 'http://www.uploads.com'},
  22. content='',
  23. request_url='http://www.uploads.com',)