diff options
| author | Abhishek Raut <rauta@vmware.com> | 2016-11-17 16:14:40 -0800 |
|---|---|---|
| committer | Abhishek Raut <rauta@vmware.com> | 2016-11-19 22:38:36 -0800 |
| commit | 11560a0527f4533a65942b7291c7c76a81602a00 (patch) | |
| tree | 3a65f4024a770a3af4102ee8494c6b1371e2f270 /openstackclient/tests | |
| parent | d6e058fa1f6323ef73354f0aea0e09efb647bc7e (diff) | |
| download | python-openstackclient-11560a0527f4533a65942b7291c7c76a81602a00.tar.gz | |
SDK Refactor: Prepare subnet commands
Prepare the OSC "subnet" commands for the SDK refactor.
See [1] for details.
[1] https://etherpad.openstack.org/p/osc-network-command-sdk-support
Partially-Implements: blueprint network-command-sdk-support
Change-Id: I5d58b189e822b2ee61c9c95ccf909113ff59de46
Diffstat (limited to 'openstackclient/tests')
| -rw-r--r-- | openstackclient/tests/unit/network/v2/fakes.py | 2 | ||||
| -rw-r--r-- | openstackclient/tests/unit/network/v2/test_subnet.py | 8 |
2 files changed, 6 insertions, 4 deletions
diff --git a/openstackclient/tests/unit/network/v2/fakes.py b/openstackclient/tests/unit/network/v2/fakes.py index 37f10147..797da4f9 100644 --- a/openstackclient/tests/unit/network/v2/fakes.py +++ b/openstackclient/tests/unit/network/v2/fakes.py @@ -1064,6 +1064,8 @@ class FakeSubnet(object): loaded=True) # Set attributes with special mappings in OpenStack SDK. + subnet.is_dhcp_enabled = subnet_attrs['enable_dhcp'] + subnet.subnet_pool_id = subnet_attrs['subnetpool_id'] subnet.project_id = subnet_attrs['tenant_id'] return subnet diff --git a/openstackclient/tests/unit/network/v2/test_subnet.py b/openstackclient/tests/unit/network/v2/test_subnet.py index 2d51aa4a..d477c4a4 100644 --- a/openstackclient/tests/unit/network/v2/test_subnet.py +++ b/openstackclient/tests/unit/network/v2/test_subnet.py @@ -636,7 +636,7 @@ class TestListSubnet(TestSubnet): parsed_args = self.check_parser(self.cmd, arglist, verifylist) columns, data = self.cmd.take_action(parsed_args) - filters = {'enable_dhcp': True} + filters = {'enable_dhcp': True, 'is_dhcp_enabled': True} self.network.subnets.assert_called_once_with(**filters) self.assertEqual(self.columns, columns) @@ -652,7 +652,7 @@ class TestListSubnet(TestSubnet): parsed_args = self.check_parser(self.cmd, arglist, verifylist) columns, data = self.cmd.take_action(parsed_args) - filters = {'enable_dhcp': False} + filters = {'enable_dhcp': False, 'is_dhcp_enabled': False} self.network.subnets.assert_called_once_with(**filters) self.assertEqual(self.columns, columns) @@ -685,7 +685,7 @@ class TestListSubnet(TestSubnet): 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.subnets.assert_called_once_with(**filters) self.assertEqual(self.columns, columns) @@ -723,7 +723,7 @@ class TestListSubnet(TestSubnet): 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.subnets.assert_called_once_with(**filters) self.assertEqual(self.columns, columns) |
