summaryrefslogtreecommitdiff
path: root/glanceclient/tests
diff options
context:
space:
mode:
authorJenkins <jenkins@review.openstack.org>2016-03-09 17:30:23 +0000
committerGerrit Code Review <review@openstack.org>2016-03-09 17:30:23 +0000
commit26d2a0f4c29d15208b426443e7a5f8570abdc323 (patch)
tree9abe306dd9e6732f55eb1265b050fd83b09231c3 /glanceclient/tests
parent8d87a244e04e623495f2e9c0a0f239d47faf8e0e (diff)
parentc077858dd6e0cd827af2418e1a05ca1f27937764 (diff)
downloadpython-glanceclient-1.1.1.tar.gz
Merge "Fix the download error when the image locations are blank" into stable/liberty1.1.1
Diffstat (limited to 'glanceclient/tests')
-rw-r--r--glanceclient/tests/unit/v2/test_images.py8
1 files changed, 7 insertions, 1 deletions
diff --git a/glanceclient/tests/unit/v2/test_images.py b/glanceclient/tests/unit/v2/test_images.py
index 7260f47..5b18e04 100644
--- a/glanceclient/tests/unit/v2/test_images.py
+++ b/glanceclient/tests/unit/v2/test_images.py
@@ -14,7 +14,7 @@
# under the License.
import errno
-
+import mock
import testtools
from glanceclient import exc
@@ -844,6 +844,12 @@ class TestController(testtools.TestCase):
body = ''.join([b for b in body])
self.assertEqual('CCC', body)
+ def test_download_no_data(self):
+ resp = utils.FakeResponse(headers={}, status_code=204)
+ self.controller.http_client.get = mock.Mock(return_value=(resp, None))
+ body = self.controller.data('image_id')
+ self.assertEqual(None, body)
+
def test_update_replace_prop(self):
image_id = '3a4560a1-e585-443e-9b39-553b46ec92d1'
params = {'name': 'pong'}