summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorDaniel G. Taylor <dan@programmer-art.org>2014-08-07 12:28:03 -0700
committerDaniel G. Taylor <dan@programmer-art.org>2014-08-07 12:28:03 -0700
commit75519b5565fcc895a567cf2c2a43338e9f8d9f52 (patch)
treeaae2bf365ac9da437605c9e006ac15703aecd100 /tests
parente91134ed19d1bd741ecc7868775206c3d1c0e32a (diff)
parent317597f06c453383a77c96efc32d2c8176684f5a (diff)
downloadboto-75519b5565fcc895a567cf2c2a43338e9f8d9f52.tar.gz
Merge pull request #2463 from truveris/develop
Add support for MTurk's GetFileUploadURL. Fixes #2463.
Diffstat (limited to 'tests')
-rw-r--r--tests/unit/mturk/__init__.py0
-rw-r--r--tests/unit/mturk/test_connection.py28
2 files changed, 28 insertions, 0 deletions
diff --git a/tests/unit/mturk/__init__.py b/tests/unit/mturk/__init__.py
new file mode 100644
index 00000000..e69de29b
--- /dev/null
+++ b/tests/unit/mturk/__init__.py
diff --git a/tests/unit/mturk/test_connection.py b/tests/unit/mturk/test_connection.py
new file mode 100644
index 00000000..05f6be25
--- /dev/null
+++ b/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')