summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorJenkins <jenkins@review.openstack.org>2013-04-04 23:08:25 +0000
committerGerrit Code Review <review@openstack.org>2013-04-04 23:08:25 +0000
commit2d97609a52bef2f437c15ff72dced29663c570ff (patch)
tree76d77ecbd0d7da9bfa9fdedeba73f08f63f66e38 /tests
parentfab61c8275893c7ab7279336b9d64d1154264059 (diff)
parent2b3d1719073fa58b651ca82f64a366e3f737d71a (diff)
downloadpython-swiftclient-2d97609a52bef2f437c15ff72dced29663c570ff.tar.gz
Merge "Static large object support."1.4.0
Diffstat (limited to 'tests')
-rw-r--r--tests/test_swiftclient.py23
1 files changed, 22 insertions, 1 deletions
diff --git a/tests/test_swiftclient.py b/tests/test_swiftclient.py
index 8bc8861..5fd1e28 100644
--- a/tests/test_swiftclient.py
+++ b/tests/test_swiftclient.py
@@ -121,12 +121,15 @@ class MockHttpTest(testtools.TestCase):
def fake_http_connection(*args, **kwargs):
_orig_http_connection = c.http_connection
return_read = kwargs.get('return_read')
+ query_string = kwargs.get('query_string')
def wrapper(url, proxy=None):
parsed, _conn = _orig_http_connection(url, proxy=proxy)
conn = fake_http_connect(*args, **kwargs)()
- def request(*args, **kwargs):
+ def request(method, url, *args, **kwargs):
+ if query_string:
+ self.assert_(url.endswith('?' + query_string))
return
conn.request = request
@@ -430,6 +433,12 @@ class TestGetObject(MockHttpTest):
self.assertRaises(c.ClientException, c.get_object,
'http://www.test.com', 'asdf', 'asdf', 'asdf')
+ def test_query_string(self):
+ c.http_connection = self.fake_http_connection(200,
+ query_string="hello=20")
+ c.get_object('http://www.test.com', 'asdf', 'asdf', 'asdf',
+ query_string="hello=20")
+
class TestHeadObject(MockHttpTest):
@@ -496,6 +505,12 @@ class TestPutObject(MockHttpTest):
except c.ClientException as e:
self.assertEquals(e.http_response_content, body)
+ def test_query_string(self):
+ c.http_connection = self.fake_http_connection(200,
+ query_string="hello=20")
+ c.put_object('http://www.test.com', 'asdf', 'asdf', 'asdf',
+ query_string="hello=20")
+
class TestPostObject(MockHttpTest):
@@ -543,6 +558,12 @@ class TestDeleteObject(MockHttpTest):
self.assertRaises(c.ClientException, c.delete_object,
'http://www.test.com', 'asdf', 'asdf', 'asdf')
+ def test_query_string(self):
+ c.http_connection = self.fake_http_connection(200,
+ query_string="hello=20")
+ c.delete_object('http://www.test.com', 'asdf', 'asdf', 'asdf',
+ query_string="hello=20")
+
class TestConnection(MockHttpTest):