summaryrefslogtreecommitdiff
path: root/openstackclient/tests
diff options
context:
space:
mode:
authorjichenjc <jichenjc@cn.ibm.com>2016-02-22 13:38:44 +0800
committerSteve Martinelli <stevemar@ca.ibm.com>2016-03-09 05:19:41 +0000
commitb711c3a0ca622389b7f41021eb8ecd5d633b81d7 (patch)
treebfc1c8c18ab4d58e91c3a4c9bc78614269ce269a /openstackclient/tests
parentf9add0559c52bf3d0866cfbd320982c5143f6ef6 (diff)
downloadpython-openstackclient-b711c3a0ca622389b7f41021eb8ecd5d633b81d7.tar.gz
Add --reason for disable service
disbale service allow a reason to be input as disable reason. This patch add support for it. Change-Id: I59622c3970e055ebd46bf03c33c864b6d064db28
Diffstat (limited to 'openstackclient/tests')
-rw-r--r--openstackclient/tests/compute/v2/test_service.py26
1 files changed, 26 insertions, 0 deletions
diff --git a/openstackclient/tests/compute/v2/test_service.py b/openstackclient/tests/compute/v2/test_service.py
index 2f8b2e7d..0246fbc8 100644
--- a/openstackclient/tests/compute/v2/test_service.py
+++ b/openstackclient/tests/compute/v2/test_service.py
@@ -153,3 +153,29 @@ class TestServiceSet(TestService):
compute_fakes.service_binary,
)
self.assertIsNone(result)
+
+ def test_service_set_disable_with_reason(self):
+ reason = 'earthquake'
+ arglist = [
+ compute_fakes.service_host,
+ compute_fakes.service_binary,
+ '--disable',
+ '--disable-reason',
+ reason
+ ]
+ verifylist = [
+ ('host', compute_fakes.service_host),
+ ('service', compute_fakes.service_binary),
+ ('enabled', False),
+ ('disable_reason', reason)
+ ]
+ parsed_args = self.check_parser(self.cmd, arglist, verifylist)
+
+ result = self.cmd.take_action(parsed_args)
+
+ self.service_mock.disable_log_reason.assert_called_with(
+ compute_fakes.service_host,
+ compute_fakes.service_binary,
+ reason
+ )
+ self.assertIsNone(result)