Merge "Compare against 'RequestIdProxy.wrapped'"
This commit is contained in:
@@ -581,11 +581,10 @@ class ShellV2Test(testtools.TestCase):
|
|||||||
args = self._make_args(
|
args = self._make_args(
|
||||||
{'id': 'IMG-01', 'file': 'test', 'progress': True})
|
{'id': 'IMG-01', 'file': 'test', 'progress': True})
|
||||||
|
|
||||||
with mock.patch.object(self.gc.images, 'data') as mocked_data:
|
with mock.patch.object(self.gc.images, 'data') as mocked_data, \
|
||||||
def _data():
|
mock.patch.object(utils, '_extract_request_id'):
|
||||||
for c in 'abcedf':
|
mocked_data.return_value = utils.RequestIdProxy(
|
||||||
yield c
|
[c for c in 'abcdef'])
|
||||||
mocked_data.return_value = utils.IterableWithLength(_data(), 5)
|
|
||||||
|
|
||||||
test_shell.do_image_download(self.gc, args)
|
test_shell.do_image_download(self.gc, args)
|
||||||
mocked_data.assert_called_once_with('IMG-01')
|
mocked_data.assert_called_once_with('IMG-01')
|
||||||
|
@@ -353,7 +353,7 @@ def do_image_download(gc, args):
|
|||||||
msg = "Unable to download image '%s'. (%s)" % (args.id, e)
|
msg = "Unable to download image '%s'. (%s)" % (args.id, e)
|
||||||
utils.exit(msg)
|
utils.exit(msg)
|
||||||
|
|
||||||
if body is None:
|
if body.wrapped is None:
|
||||||
msg = ('Image %s has no data.' % args.id)
|
msg = ('Image %s has no data.' % args.id)
|
||||||
utils.exit(msg)
|
utils.exit(msg)
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user