summaryrefslogtreecommitdiff
path: root/tests/v1
diff options
context:
space:
mode:
authorBrian Waldon <bcwaldon@gmail.com>2012-07-11 19:34:28 -0700
committerBrian Waldon <bcwaldon@gmail.com>2012-07-11 19:55:02 -0700
commitda360462a54501178753571cdfec800e899f38ae (patch)
treeafb6cc0c42ae3169003db24eceb83e166a760d6a /tests/v1
parenta814c154652312e6c5f40674933275a0a6d2c647 (diff)
downloadpython-glanceclient-da360462a54501178753571cdfec800e899f38ae.tar.gz
Wrap image data in iterator
This is establishing the API for a future optimization. We want to be able to offer true socket-level caching, but can't do that with httplib2 right now. For now, we will just fake the optimization by returning an iterator over the image body, which happens to already be fully loaded into a string. Change-Id: I2d36e3cdd45b26d7c7c27ba050bf6a4b5765df6c
Diffstat (limited to 'tests/v1')
-rw-r--r--tests/v1/test_images.py4
1 files changed, 2 insertions, 2 deletions
diff --git a/tests/v1/test_images.py b/tests/v1/test_images.py
index b3fe128..dc2f2c1 100644
--- a/tests/v1/test_images.py
+++ b/tests/v1/test_images.py
@@ -131,7 +131,7 @@ class ImageManagerTest(unittest.TestCase):
self.assertEqual(image.name, 'image-1')
def test_data(self):
- data = self.mgr.data('1')
+ data = ''.join([b for b in self.mgr.data('1')])
expect = [('GET', '/v1/images/1', {}, None)]
self.assertEqual(self.api.calls, expect)
self.assertEqual(data, 'XXX')
@@ -256,7 +256,7 @@ class ImageTest(unittest.TestCase):
def test_data(self):
image = self.mgr.get('1')
- data = image.data()
+ data = ''.join([b for b in image.data()])
expect = [
('HEAD', '/v1/images/1', {}, None),
('GET', '/v1/images/1', {}, None),