From d6cc50f0daac71fbe2a18059be94f6d01a26d78d Mon Sep 17 00:00:00 2001 From: Richard Theis Date: Wed, 5 Oct 2016 08:09:16 -0500 Subject: SDK Refactor: Prepare subnet pool commands Prepare the OSC "subnet pool" commands for the SDK refactor. See [1] for details. [1] https://etherpad.openstack.org/p/osc-network-command-sdk-support Change-Id: I6d8cb7a079cf115ee25d48d9175e31f0f995c502 Partially-Implements: blueprint network-command-sdk-support --- openstackclient/tests/unit/network/v2/fakes.py | 5 +++++ openstackclient/tests/unit/network/v2/test_subnet_pool.py | 8 ++++---- 2 files changed, 9 insertions(+), 4 deletions(-) (limited to 'openstackclient/tests/unit/network') diff --git a/openstackclient/tests/unit/network/v2/fakes.py b/openstackclient/tests/unit/network/v2/fakes.py index ed3579b7..667f76b8 100644 --- a/openstackclient/tests/unit/network/v2/fakes.py +++ b/openstackclient/tests/unit/network/v2/fakes.py @@ -1067,6 +1067,11 @@ class FakeSubnetPool(object): ) # Set attributes with special mapping in OpenStack SDK. + subnet_pool.default_prefix_length = \ + subnet_pool_attrs['default_prefixlen'] + subnet_pool.is_shared = subnet_pool_attrs['shared'] + subnet_pool.maximum_prefix_length = subnet_pool_attrs['max_prefixlen'] + subnet_pool.minimum_prefix_length = subnet_pool_attrs['min_prefixlen'] subnet_pool.project_id = subnet_pool_attrs['tenant_id'] return subnet_pool diff --git a/openstackclient/tests/unit/network/v2/test_subnet_pool.py b/openstackclient/tests/unit/network/v2/test_subnet_pool.py index fa6ffff3..f12537e7 100644 --- a/openstackclient/tests/unit/network/v2/test_subnet_pool.py +++ b/openstackclient/tests/unit/network/v2/test_subnet_pool.py @@ -435,7 +435,7 @@ class TestListSubnetPool(TestSubnetPool): parsed_args = self.check_parser(self.cmd, arglist, verifylist) columns, data = self.cmd.take_action(parsed_args) - filters = {'shared': False} + filters = {'shared': False, 'is_shared': False} self.network.subnet_pools.assert_called_once_with(**filters) self.assertEqual(self.columns, columns) @@ -451,7 +451,7 @@ class TestListSubnetPool(TestSubnetPool): parsed_args = self.check_parser(self.cmd, arglist, verifylist) columns, data = self.cmd.take_action(parsed_args) - filters = {'shared': True} + filters = {'shared': True, 'is_shared': True} self.network.subnet_pools.assert_called_once_with(**filters) self.assertEqual(self.columns, columns) @@ -501,7 +501,7 @@ class TestListSubnetPool(TestSubnetPool): parsed_args = self.check_parser(self.cmd, arglist, verifylist) columns, data = self.cmd.take_action(parsed_args) - filters = {'tenant_id': project.id} + filters = {'tenant_id': project.id, 'project_id': project.id} self.network.subnet_pools.assert_called_once_with(**filters) self.assertEqual(self.columns, columns) @@ -521,7 +521,7 @@ class TestListSubnetPool(TestSubnetPool): parsed_args = self.check_parser(self.cmd, arglist, verifylist) columns, data = self.cmd.take_action(parsed_args) - filters = {'tenant_id': project.id} + filters = {'tenant_id': project.id, 'project_id': project.id} self.network.subnet_pools.assert_called_once_with(**filters) self.assertEqual(self.columns, columns) -- cgit v1.2.1