summaryrefslogtreecommitdiff
path: root/openstackclient/tests/unit/compute
diff options
context:
space:
mode:
authorReedip <reedip14@gmail.com>2016-12-28 01:45:42 -0500
committerDean Troyer <dtroyer@gmail.com>2017-02-13 15:16:09 +0000
commit6a3c7c2a68dd2aeb8a0a05143de3b14e4beea99d (patch)
tree8557966775e9d0dd2d4484977365dd2b90ffc70c /openstackclient/tests/unit/compute
parent1e3dc48c64304eb378660ceb531aab3d42ac0710 (diff)
downloadpython-openstackclient-6a3c7c2a68dd2aeb8a0a05143de3b14e4beea99d.tar.gz
Overwrite/Clear Flavor property
This patch adds support to overwrite/clear the flavor's property using the new ``--no-property`` option in the ``flavor set`` command. Change-Id: I873c96fcf223bbd638a19b908766d904a84e8431 Implements: blueprint allow-overwrite-set-options Co-Authored By: zhiyong.dai@easystack.cn
Diffstat (limited to 'openstackclient/tests/unit/compute')
-rw-r--r--openstackclient/tests/unit/compute/v2/test_flavor.py17
1 files changed, 17 insertions, 0 deletions
diff --git a/openstackclient/tests/unit/compute/v2/test_flavor.py b/openstackclient/tests/unit/compute/v2/test_flavor.py
index 632fcda1..4cdbb25b 100644
--- a/openstackclient/tests/unit/compute/v2/test_flavor.py
+++ b/openstackclient/tests/unit/compute/v2/test_flavor.py
@@ -528,6 +528,23 @@ class TestFlavorSet(TestFlavor):
self.flavor.set_keys.assert_called_with({'FOO': '"B A R"'})
self.assertIsNone(result)
+ def test_flavor_set_no_property(self):
+ arglist = [
+ '--no-property',
+ 'baremetal'
+ ]
+ verifylist = [
+ ('no_property', True),
+ ('flavor', 'baremetal')
+ ]
+ parsed_args = self.check_parser(self.cmd, arglist, verifylist)
+
+ result = self.cmd.take_action(parsed_args)
+ self.flavors_mock.find.assert_called_with(name=parsed_args.flavor,
+ is_public=None)
+ self.flavor.unset_keys.assert_called_with(['property'])
+ self.assertIsNone(result)
+
def test_flavor_set_project(self):
arglist = [
'--project', self.project.id,