summaryrefslogtreecommitdiff
path: root/openstackclient/tests
diff options
context:
space:
mode:
authorZuul <zuul@review.openstack.org>2018-07-25 00:42:32 +0000
committerGerrit Code Review <review@openstack.org>2018-07-25 00:42:32 +0000
commitd838c696059719d285d431e3d47bc018c93b2ea5 (patch)
tree047dc3ef19e2e1447398e8f678f2c87701949723 /openstackclient/tests
parentc42b8552a89e3dea293b4cde21349fdc8a952182 (diff)
parent4a9cb8eea8e47950cb30ecaa7572a23d80d5bfcd (diff)
downloadpython-openstackclient-d838c696059719d285d431e3d47bc018c93b2ea5.tar.gz
Merge "Support filtering port with IP address substring"
Diffstat (limited to 'openstackclient/tests')
-rw-r--r--openstackclient/tests/unit/network/v2/test_port.py18
1 files changed, 18 insertions, 0 deletions
diff --git a/openstackclient/tests/unit/network/v2/test_port.py b/openstackclient/tests/unit/network/v2/test_port.py
index 03e1d841..78d7fd6c 100644
--- a/openstackclient/tests/unit/network/v2/test_port.py
+++ b/openstackclient/tests/unit/network/v2/test_port.py
@@ -867,6 +867,24 @@ class TestListPort(TestPort):
self.assertEqual(self.columns, columns)
self.assertEqual(self.data, list(data))
+ def test_port_list_fixed_ip_opt_ip_address_substr(self):
+ ip_address_ss = self._ports[0].fixed_ips[0]['ip_address'][:-1]
+ arglist = [
+ '--fixed-ip', "ip-substring=%s" % ip_address_ss,
+ ]
+ verifylist = [
+ ('fixed_ip', [{'ip-substring': ip_address_ss}])
+ ]
+
+ parsed_args = self.check_parser(self.cmd, arglist, verifylist)
+
+ columns, data = self.cmd.take_action(parsed_args)
+
+ self.network.ports.assert_called_once_with(**{
+ 'fixed_ips': ['ip_address_substr=%s' % ip_address_ss]})
+ self.assertEqual(self.columns, columns)
+ self.assertEqual(self.data, list(data))
+
def test_port_list_fixed_ip_opt_subnet_id(self):
subnet_id = self._ports[0].fixed_ips[0]['subnet_id']
arglist = [