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

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

Issue 1377933002: [catapult] - Copy Telemetry's gsutilz over to third_party. (Closed) Base URL: https://github.com/catapult-project/catapult.git@master
Patch Set: Rename to gsutil. Created 5 years, 3 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: third_party/gsutil/third_party/boto/tests/unit/mturk/test_connection.py
diff --git a/third_party/gsutil/third_party/boto/tests/unit/mturk/test_connection.py b/third_party/gsutil/third_party/boto/tests/unit/mturk/test_connection.py
new file mode 100644
index 0000000000000000000000000000000000000000..05f6be259ec1279348476b87da12bed32d815c7d
--- /dev/null
+++ b/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