summaryrefslogtreecommitdiff
path: root/openstackclient/tests/unit
diff options
context:
space:
mode:
authorJenkins <jenkins@review.openstack.org>2017-04-17 15:18:20 +0000
committerGerrit Code Review <review@openstack.org>2017-04-17 15:18:20 +0000
commit62d71aa2435b2257670480dce73d2192652bb14d (patch)
treeeb4812cea53bf6f5c64333700d80c0635e814df2 /openstackclient/tests/unit
parentb168f2d998b70c16685a11b1e964aa9222ed363b (diff)
parentfe59e339ae6dd6a5e9075773fb5c2a0fea9c2e53 (diff)
downloadpython-openstackclient-62d71aa2435b2257670480dce73d2192652bb14d.tar.gz
Merge "Allow override of distributed router flag"
Diffstat (limited to 'openstackclient/tests/unit')
-rw-r--r--openstackclient/tests/unit/network/v2/test_router.py29
1 files changed, 29 insertions, 0 deletions
diff --git a/openstackclient/tests/unit/network/v2/test_router.py b/openstackclient/tests/unit/network/v2/test_router.py
index a4f91997..02e0be94 100644
--- a/openstackclient/tests/unit/network/v2/test_router.py
+++ b/openstackclient/tests/unit/network/v2/test_router.py
@@ -211,6 +211,35 @@ class TestCreateRouter(TestRouter):
def test_create_with_no_ha_option(self):
self._test_create_with_ha_options('--no-ha', False)
+ def _test_create_with_distributed_options(self, option, distributed):
+ arglist = [
+ option,
+ self.new_router.name,
+ ]
+ verifylist = [
+ ('name', self.new_router.name),
+ ('enable', True),
+ ('distributed', distributed),
+ ('centralized', not distributed),
+ ]
+ parsed_args = self.check_parser(self.cmd, arglist, verifylist)
+
+ columns, data = (self.cmd.take_action(parsed_args))
+
+ self.network.create_router.assert_called_once_with(**{
+ 'admin_state_up': True,
+ 'name': self.new_router.name,
+ 'distributed': distributed,
+ })
+ self.assertEqual(self.columns, columns)
+ self.assertEqual(self.data, data)
+
+ def test_create_with_distributed_option(self):
+ self._test_create_with_distributed_options('--distributed', True)
+
+ def test_create_with_centralized_option(self):
+ self._test_create_with_distributed_options('--centralized', False)
+
def test_create_with_AZ_hints(self):
arglist = [
self.new_router.name,