From 8a12a39ece3882af56b42898ffee0d537c96edc8 Mon Sep 17 00:00:00 2001 From: sunyajing Date: Tue, 14 Jun 2016 15:44:41 +0800 Subject: Make set/unset command in identity and image pass normally when nothing specified Also update its unit tests. Change-Id: I82b90658b0d4247cdc9a650f14aceda640a32059 Partial-bug: #1588588 --- openstackclient/tests/image/v2/test_image.py | 26 ++++++++++++++++++++++++++ 1 file changed, 26 insertions(+) (limited to 'openstackclient/tests/image') diff --git a/openstackclient/tests/image/v2/test_image.py b/openstackclient/tests/image/v2/test_image.py index 92e0660f..3dbf504a 100644 --- a/openstackclient/tests/image/v2/test_image.py +++ b/openstackclient/tests/image/v2/test_image.py @@ -811,6 +811,19 @@ class TestImageSet(TestImage): # Get the command object to test self.cmd = image.SetImage(self.app, None) + def test_image_set_no_options(self): + arglist = [ + image_fakes.image_id, + ] + verifylist = [ + ('image', image_fakes.image_id) + ] + parsed_args = self.check_parser(self.cmd, arglist, verifylist) + + result = self.cmd.take_action(parsed_args) + + self.assertIsNone(result) + def test_image_set_options(self): arglist = [ '--name', 'new-name', @@ -1211,6 +1224,19 @@ class TestImageUnset(TestImage): # Get the command object to test self.cmd = image.UnsetImage(self.app, None) + def test_image_unset_no_options(self): + arglist = [ + image_fakes.image_id, + ] + verifylist = [ + ('image', image_fakes.image_id) + ] + parsed_args = self.check_parser(self.cmd, arglist, verifylist) + + result = self.cmd.take_action(parsed_args) + + self.assertIsNone(result) + def test_image_unset_tag_option(self): arglist = [ -- cgit v1.2.1