Merge "network: Address nits for I3c313fc9329837dde67815901528a34dca98ebcc"

This commit is contained in:
Zuul 2021-01-12 13:54:11 +00:00 committed by Gerrit Code Review
commit d6646d714b
2 changed files with 4 additions and 9 deletions

View File

@ -36,10 +36,7 @@ def _get_columns(item):
def _format_addresses(addresses):
ret = []
for addr in addresses:
ret.append(str(netaddr.IPNetwork(addr)))
return ret
return [str(netaddr.IPNetwork(addr)) for addr in addresses]
def _get_attrs(client_manager, parsed_args):
@ -185,7 +182,6 @@ class ListAddressGroup(command.Lister):
parsed_args.project,
parsed_args.project_domain,
).id
attrs['tenant_id'] = project_id
attrs['project_id'] = project_id
data = client.address_groups(**attrs)

View File

@ -282,7 +282,7 @@ class TestListAddressGroup(TestAddressGroup):
columns, data = self.cmd.take_action(parsed_args)
self.network.address_groups.assert_called_once_with(
**{'tenant_id': project.id, 'project_id': project.id})
project_id=project.id)
self.assertEqual(self.columns, columns)
self.assertItemsEqual(self.data, list(data))
@ -297,11 +297,10 @@ class TestListAddressGroup(TestAddressGroup):
('project', project.id),
]
parsed_args = self.check_parser(self.cmd, arglist, verifylist)
columns, data = self.cmd.take_action(parsed_args)
filters = {'tenant_id': project.id, 'project_id': project.id}
self.network.address_groups.assert_called_once_with(**filters)
self.network.address_groups.assert_called_once_with(
project_id=project.id)
self.assertEqual(self.columns, columns)
self.assertItemsEqual(self.data, list(data))