summaryrefslogtreecommitdiff
path: root/openstackclient/tests/network/v2/test_router.py
diff options
context:
space:
mode:
authorTang Chen <chen.tang@easystack.cn>2016-06-03 12:21:45 +0800
committerTang Chen <chen.tang@easystack.cn>2016-06-08 14:31:17 +0800
commite3270cdfd8fce895b8f32b8e23e48399be6ac85c (patch)
tree638ab2ef59028c1f01ed8d9a4d53cfbbb27ba1a3 /openstackclient/tests/network/v2/test_router.py
parent84506a6b71c103b50bbf5b5f0b534e2d35950780 (diff)
downloadpython-openstackclient-e3270cdfd8fce895b8f32b8e23e48399be6ac85c.tar.gz
Make set/unset commands in network return normally when nothing specified
set/unset commands should ends up normally instead of raising an exception when nothing is specified to modify. The main reason is: When nothing is specified, the command sets/unsets nothing, which is a normal behavior, and ends up normally. No API call fails. No error happens. This patch also adds a releasenote for both network, and volume commands that fix patch has been merged. Change-Id: I78c348066078decd350417a431f3b8bea8fcf9ef Partial-bug: #1588588
Diffstat (limited to 'openstackclient/tests/network/v2/test_router.py')
-rw-r--r--openstackclient/tests/network/v2/test_router.py17
1 files changed, 12 insertions, 5 deletions
diff --git a/openstackclient/tests/network/v2/test_router.py b/openstackclient/tests/network/v2/test_router.py
index 99b41d2d..b25381ef 100644
--- a/openstackclient/tests/network/v2/test_router.py
+++ b/openstackclient/tests/network/v2/test_router.py
@@ -13,7 +13,6 @@
import mock
-from openstackclient.common import exceptions
from openstackclient.common import utils as osc_utils
from openstackclient.network.v2 import router
from openstackclient.tests.network.v2 import fakes as network_fakes
@@ -568,12 +567,20 @@ class TestSetRouter(TestRouter):
self.cmd, arglist, verifylist)
def test_set_nothing(self):
- arglist = [self._router.name, ]
- verifylist = [('router', self._router.name), ]
+ arglist = [
+ self._router.name,
+ ]
+ verifylist = [
+ ('router', self._router.name),
+ ]
parsed_args = self.check_parser(self.cmd, arglist, verifylist)
- self.assertRaises(exceptions.CommandError, self.cmd.take_action,
- parsed_args)
+ result = self.cmd.take_action(parsed_args)
+
+ attrs = {}
+ self.network.update_router.assert_called_once_with(
+ self._router, **attrs)
+ self.assertIsNone(result)
class TestShowRouter(TestRouter):