diff options
| author | Richard Theis <rtheis@us.ibm.com> | 2016-10-05 08:09:16 -0500 |
|---|---|---|
| committer | Richard Theis <rtheis@us.ibm.com> | 2016-10-05 08:50:58 -0500 |
| commit | d6cc50f0daac71fbe2a18059be94f6d01a26d78d (patch) | |
| tree | 35429ab484616f219957d2290a636678d79413bf /openstackclient/tests | |
| parent | 70cb628278642e0e275c3e8d294bb73c17a97f5e (diff) | |
| download | python-openstackclient-d6cc50f0daac71fbe2a18059be94f6d01a26d78d.tar.gz | |
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
Diffstat (limited to 'openstackclient/tests')
| -rw-r--r-- | openstackclient/tests/unit/network/v2/fakes.py | 5 | ||||
| -rw-r--r-- | openstackclient/tests/unit/network/v2/test_subnet_pool.py | 8 |
2 files changed, 9 insertions, 4 deletions
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) |
