summaryrefslogtreecommitdiff
path: root/tests/unit/test_swiftclient.py
diff options
context:
space:
mode:
authorStuart McLaren <stuart.mclaren@hp.com>2015-12-15 16:54:04 +0000
committerStuart McLaren <stuart.mclaren@hp.com>2015-12-15 17:15:27 +0000
commit0103465fcb5d0119459569e7952cc1c580d045e2 (patch)
tree364f3f888661d755813aa2b2bdc2bc9bebbeaaf2 /tests/unit/test_swiftclient.py
parent4d9b1e760d48aba570ccf07281ddaad110ed9a6a (diff)
downloadpython-swiftclient-0103465fcb5d0119459569e7952cc1c580d045e2.tar.gz
Test 'string' behaviour of get_object
Add a unit test to test the 'string' like behaviour of get_object when it is called without resp_chunk_size set. Co-Authored-By: Clay Gerrard <clay.gerrard@gmail.com> Change-Id: I496032a76036141d027c30b076c810b34bc6bef0
Diffstat (limited to 'tests/unit/test_swiftclient.py')
-rw-r--r--tests/unit/test_swiftclient.py6
1 files changed, 6 insertions, 0 deletions
diff --git a/tests/unit/test_swiftclient.py b/tests/unit/test_swiftclient.py
index e39e05f..317a6b5 100644
--- a/tests/unit/test_swiftclient.py
+++ b/tests/unit/test_swiftclient.py
@@ -769,6 +769,12 @@ class TestGetObject(MockHttpTest):
'x-auth-token': 'asdf'}),
])
+ def test_get_object_as_string(self):
+ c.http_connection = self.fake_http_connection(200, body='abcde')
+ __, resp = c.get_object('http://storage.example.com', 'TOKEN',
+ 'container_name', 'object_name')
+ self.assertEqual(resp, 'abcde')
+
def test_request_headers(self):
c.http_connection = self.fake_http_connection(200)
conn = c.http_connection('http://www.test.com')