Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1100)

Unified Diff: tools/telemetry/third_party/gsutil/third_party/boto/tests/unit/mturk/test_connection.py

Issue 1258583006: Add gsutil 4.13 to telemetry/third_party (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Undo all other changes so this just add gsutil to third_party Created 5 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: tools/telemetry/third_party/gsutil/third_party/boto/tests/unit/mturk/test_connection.py
diff --git a/tools/telemetry/third_party/gsutil/third_party/boto/tests/unit/mturk/test_connection.py b/tools/telemetry/third_party/gsutil/third_party/boto/tests/unit/mturk/test_connection.py
new file mode 100644
index 0000000000000000000000000000000000000000..05f6be259ec1279348476b87da12bed32d815c7d
--- /dev/null
+++ b/tools/telemetry/third_party/gsutil/third_party/boto/tests/unit/mturk/test_connection.py
@@ -0,0 +1,28 @@
+# -*- coding: utf-8 -*-
+
+from tests.unit import AWSMockServiceTestCase
+
+from boto.mturk.connection import MTurkConnection
+
+
+GET_FILE_UPLOAD_URL = b"""
+<GetFileUploadURLResult>
+ <Request>
+ <IsValid>True</IsValid>
+ </Request>
+ <FileUploadURL>http://s3.amazonaws.com/myawsbucket/puppy.jpg</FileUploadURL>
+</GetFileUploadURLResult>"""
+
+
+class TestMTurkConnection(AWSMockServiceTestCase):
+ connection_class = MTurkConnection
+
+ def setUp(self):
+ super(TestMTurkConnection, self).setUp()
+
+ def test_get_file_upload_url_success(self):
+ self.set_http_response(status_code=200, body=GET_FILE_UPLOAD_URL)
+ rset = self.service_connection.get_file_upload_url('aid', 'qid')
+ self.assertEquals(len(rset), 1)
+ self.assertEquals(rset[0].FileUploadURL,
+ 'http://s3.amazonaws.com/myawsbucket/puppy.jpg')

Powered by Google App Engine
This is Rietveld 408576698