Make use of comparable 'FormattableColumn' subclasses

This requires fixes found in cliff 3.5.0 [1] and osc-lib 2.3.0 [2]. With
these fixes in place, we can remove the icky, still broken
'assertItemEqual' and 'assertListItemEqual' helpers.

[1] https://review.opendev.org/761421
[2] https://review.opendev.org/761394

Change-Id: Id6c26b37c3c7d5ec6761361abca57f9219b76838
Signed-off-by: Stephen Finucane <sfinucan@redhat.com>
This commit is contained in:
Stephen Finucane 2020-11-04 16:16:58 +00:00
parent 0edd055f3f
commit f5b185c357
33 changed files with 295 additions and 306 deletions

View File

@ -5,7 +5,7 @@ Babel==2.6.0
bcrypt==3.2.0 bcrypt==3.2.0
cachetools==2.0.0 cachetools==2.0.0
cffi==1.14.0 cffi==1.14.0
cliff==3.4.0 cliff==3.5.0
cmd2==0.8.0 cmd2==0.8.0
coverage==4.0 coverage==4.0
cryptography==2.7 cryptography==2.7
@ -42,7 +42,7 @@ openstacksdk==0.52.0
os-client-config==2.1.0 os-client-config==2.1.0
os-service-types==1.7.0 os-service-types==1.7.0
os-testr==1.0.0 os-testr==1.0.0
osc-lib==2.2.0 osc-lib==2.3.0
oslo.concurrency==3.26.0 oslo.concurrency==3.26.0
oslo.config==5.2.0 oslo.config==5.2.0
oslo.context==2.19.2 oslo.context==2.19.2

View File

@ -91,7 +91,7 @@ class ShowCatalog(command.ShowOne):
for service in auth_ref.service_catalog.catalog: for service in auth_ref.service_catalog.catalog:
if (service.get('name') == parsed_args.service or if (service.get('name') == parsed_args.service or
service.get('type') == parsed_args.service): service.get('type') == parsed_args.service):
data = service data = service.copy()
data['endpoints'] = EndpointsColumn(data['endpoints']) data['endpoints'] = EndpointsColumn(data['endpoints'])
if 'endpoints_links' in data: if 'endpoints_links' in data:
data.pop('endpoints_links') data.pop('endpoints_links')

View File

@ -88,7 +88,7 @@ class TestAggregateAddHost(TestAggregate):
self.sdk_client.add_host_to_aggregate.assert_called_once_with( self.sdk_client.add_host_to_aggregate.assert_called_once_with(
self.fake_ag.id, parsed_args.host) self.fake_ag.id, parsed_args.host)
self.assertEqual(self.columns, columns) self.assertEqual(self.columns, columns)
self.assertItemEqual(self.data, data) self.assertItemsEqual(self.data, data)
class TestAggregateCreate(TestAggregate): class TestAggregateCreate(TestAggregate):
@ -112,7 +112,7 @@ class TestAggregateCreate(TestAggregate):
self.sdk_client.create_aggregate.assert_called_once_with( self.sdk_client.create_aggregate.assert_called_once_with(
name=parsed_args.name) name=parsed_args.name)
self.assertEqual(self.columns, columns) self.assertEqual(self.columns, columns)
self.assertItemEqual(self.data, data) self.assertItemsEqual(self.data, data)
def test_aggregate_create_with_zone(self): def test_aggregate_create_with_zone(self):
arglist = [ arglist = [
@ -129,7 +129,7 @@ class TestAggregateCreate(TestAggregate):
self.sdk_client.create_aggregate.assert_called_once_with( self.sdk_client.create_aggregate.assert_called_once_with(
name=parsed_args.name, availability_zone=parsed_args.zone) name=parsed_args.name, availability_zone=parsed_args.zone)
self.assertEqual(self.columns, columns) self.assertEqual(self.columns, columns)
self.assertItemEqual(self.data, data) self.assertItemsEqual(self.data, data)
def test_aggregate_create_with_property(self): def test_aggregate_create_with_property(self):
arglist = [ arglist = [
@ -148,7 +148,7 @@ class TestAggregateCreate(TestAggregate):
self.sdk_client.set_aggregate_metadata.assert_called_once_with( self.sdk_client.set_aggregate_metadata.assert_called_once_with(
self.fake_ag.id, parsed_args.property) self.fake_ag.id, parsed_args.property)
self.assertEqual(self.columns, columns) self.assertEqual(self.columns, columns)
self.assertItemEqual(self.data, data) self.assertItemsEqual(self.data, data)
class TestAggregateDelete(TestAggregate): class TestAggregateDelete(TestAggregate):
@ -265,7 +265,7 @@ class TestAggregateList(TestAggregate):
columns, data = self.cmd.take_action(parsed_args) columns, data = self.cmd.take_action(parsed_args)
self.assertEqual(self.list_columns, columns) self.assertEqual(self.list_columns, columns)
self.assertItemEqual(self.list_data, tuple(data)) self.assertItemsEqual(self.list_data, tuple(data))
def test_aggregate_list_with_long(self): def test_aggregate_list_with_long(self):
arglist = [ arglist = [
@ -278,7 +278,7 @@ class TestAggregateList(TestAggregate):
columns, data = self.cmd.take_action(parsed_args) columns, data = self.cmd.take_action(parsed_args)
self.assertEqual(self.list_columns_long, columns) self.assertEqual(self.list_columns_long, columns)
self.assertListItemEqual(self.list_data_long, tuple(data)) self.assertItemsEqual(self.list_data_long, tuple(data))
class TestAggregateRemoveHost(TestAggregate): class TestAggregateRemoveHost(TestAggregate):
@ -306,7 +306,7 @@ class TestAggregateRemoveHost(TestAggregate):
self.sdk_client.remove_host_from_aggregate.assert_called_once_with( self.sdk_client.remove_host_from_aggregate.assert_called_once_with(
self.fake_ag.id, parsed_args.host) self.fake_ag.id, parsed_args.host)
self.assertEqual(self.columns, columns) self.assertEqual(self.columns, columns)
self.assertItemEqual(self.data, data) self.assertItemsEqual(self.data, data)
class TestAggregateSet(TestAggregate): class TestAggregateSet(TestAggregate):
@ -492,7 +492,7 @@ class TestAggregateShow(TestAggregate):
parsed_args.aggregate, ignore_missing=False) parsed_args.aggregate, ignore_missing=False)
self.assertEqual(self.columns, columns) self.assertEqual(self.columns, columns)
self.assertItemEqual(self.data, tuple(data)) self.assertItemsEqual(self.data, tuple(data))
class TestAggregateUnset(TestAggregate): class TestAggregateUnset(TestAggregate):

View File

@ -133,7 +133,7 @@ class TestFlavorCreate(TestFlavor):
self.sdk_client.create_flavor.assert_called_once_with(**default_args) self.sdk_client.create_flavor.assert_called_once_with(**default_args)
self.assertEqual(self.columns, columns) self.assertEqual(self.columns, columns)
self.assertItemEqual(self.data, data) self.assertItemsEqual(self.data, data)
def test_flavor_create_all_options(self): def test_flavor_create_all_options(self):
@ -202,7 +202,7 @@ class TestFlavorCreate(TestFlavor):
self.sdk_client.get_flavor_access.assert_not_called() self.sdk_client.get_flavor_access.assert_not_called()
self.assertEqual(self.columns, columns) self.assertEqual(self.columns, columns)
self.assertItemEqual(tuple(cmp_data), data) self.assertItemsEqual(tuple(cmp_data), data)
def test_flavor_create_other_options(self): def test_flavor_create_other_options(self):
@ -277,7 +277,7 @@ class TestFlavorCreate(TestFlavor):
self.sdk_client.create_flavor_extra_specs.assert_called_with( self.sdk_client.create_flavor_extra_specs.assert_called_with(
create_flavor, props) create_flavor, props)
self.assertEqual(self.columns, columns) self.assertEqual(self.columns, columns)
self.assertItemEqual(cmp_data, data) self.assertItemsEqual(cmp_data, data)
def test_public_flavor_create_with_project(self): def test_public_flavor_create_with_project(self):
arglist = [ arglist = [
@ -350,7 +350,7 @@ class TestFlavorCreate(TestFlavor):
self.sdk_client.create_flavor.assert_called_once_with(**args) self.sdk_client.create_flavor.assert_called_once_with(**args)
self.assertEqual(self.columns, columns) self.assertEqual(self.columns, columns)
self.assertItemEqual(self.data_private, data) self.assertItemsEqual(self.data_private, data)
def test_flavor_create_with_description_api_older(self): def test_flavor_create_with_description_api_older(self):
arglist = [ arglist = [
@ -633,7 +633,7 @@ class TestFlavorList(TestFlavor):
) )
self.assertEqual(self.columns_long, columns) self.assertEqual(self.columns_long, columns)
self.assertListItemEqual(self.data_long, tuple(data)) self.assertItemsEqual(self.data_long, tuple(data))
class TestFlavorSet(TestFlavor): class TestFlavorSet(TestFlavor):
@ -920,7 +920,7 @@ class TestFlavorShow(TestFlavor):
columns, data = self.cmd.take_action(parsed_args) columns, data = self.cmd.take_action(parsed_args)
self.assertEqual(self.columns, columns) self.assertEqual(self.columns, columns)
self.assertItemEqual(self.data, data) self.assertItemsEqual(self.data, data)
def test_private_flavor_show(self): def test_private_flavor_show(self):
private_flavor = compute_fakes.FakeFlavor.create_one_flavor( private_flavor = compute_fakes.FakeFlavor.create_one_flavor(
@ -960,7 +960,7 @@ class TestFlavorShow(TestFlavor):
self.sdk_client.get_flavor_access.assert_called_with( self.sdk_client.get_flavor_access.assert_called_with(
flavor=private_flavor.id) flavor=private_flavor.id)
self.assertEqual(self.columns, columns) self.assertEqual(self.columns, columns)
self.assertItemEqual(data_with_project, data) self.assertItemsEqual(data_with_project, data)
class TestFlavorUnset(TestFlavor): class TestFlavorUnset(TestFlavor):

View File

@ -139,7 +139,7 @@ class TestServerBackupCreate(TestServerBackup):
) )
self.assertEqual(self.image_columns(images[0]), columns) self.assertEqual(self.image_columns(images[0]), columns)
self.assertItemEqual(self.image_data(images[0]), data) self.assertItemsEqual(self.image_data(images[0]), data)
def test_server_backup_create_options(self): def test_server_backup_create_options(self):
servers = self.setup_servers_mock(count=1) servers = self.setup_servers_mock(count=1)
@ -173,7 +173,7 @@ class TestServerBackupCreate(TestServerBackup):
) )
self.assertEqual(self.image_columns(images[0]), columns) self.assertEqual(self.image_columns(images[0]), columns)
self.assertItemEqual(self.image_data(images[0]), data) self.assertItemsEqual(self.image_data(images[0]), data)
@mock.patch.object(common_utils, 'wait_for_status', return_value=False) @mock.patch.object(common_utils, 'wait_for_status', return_value=False)
def test_server_backup_wait_fail(self, mock_wait_for_status): def test_server_backup_wait_fail(self, mock_wait_for_status):
@ -269,4 +269,4 @@ class TestServerBackupCreate(TestServerBackup):
) )
self.assertEqual(self.image_columns(images[0]), columns) self.assertEqual(self.image_columns(images[0]), columns)
self.assertItemEqual(self.image_data(images[0]), data) self.assertItemsEqual(self.image_data(images[0]), data)

View File

@ -133,7 +133,7 @@ class TestServerImageCreate(TestServerImage):
) )
self.assertEqual(self.image_columns(images[0]), columns) self.assertEqual(self.image_columns(images[0]), columns)
self.assertItemEqual(self.image_data(images[0]), data) self.assertItemsEqual(self.image_data(images[0]), data)
def test_server_image_create_options(self): def test_server_image_create_options(self):
servers = self.setup_servers_mock(count=1) servers = self.setup_servers_mock(count=1)
@ -161,7 +161,7 @@ class TestServerImageCreate(TestServerImage):
) )
self.assertEqual(self.image_columns(images[0]), columns) self.assertEqual(self.image_columns(images[0]), columns)
self.assertItemEqual(self.image_data(images[0]), data) self.assertItemsEqual(self.image_data(images[0]), data)
@mock.patch.object(common_utils, 'wait_for_status', return_value=False) @mock.patch.object(common_utils, 'wait_for_status', return_value=False)
def test_server_create_image_wait_fail(self, mock_wait_for_status): def test_server_create_image_wait_fail(self, mock_wait_for_status):
@ -229,4 +229,4 @@ class TestServerImageCreate(TestServerImage):
) )
self.assertEqual(self.image_columns(images[0]), columns) self.assertEqual(self.image_columns(images[0]), columns)
self.assertItemEqual(self.image_data(images[0]), data) self.assertItemsEqual(self.image_data(images[0]), data)

View File

@ -71,9 +71,10 @@ class TestCatalogList(TestCatalog):
datalist = (( datalist = ((
'supernova', 'supernova',
'compute', 'compute',
catalog.EndpointsColumn(self.service_catalog['endpoints']), catalog.EndpointsColumn(
auth_ref.service_catalog.catalog[0]['endpoints']),
), ) ), )
self.assertListItemEqual(datalist, tuple(data)) self.assertItemsEqual(datalist, tuple(data))
def test_catalog_list_with_endpoint_url(self): def test_catalog_list_with_endpoint_url(self):
attr = { attr = {
@ -113,9 +114,10 @@ class TestCatalogList(TestCatalog):
datalist = (( datalist = ((
'supernova', 'supernova',
'compute', 'compute',
catalog.EndpointsColumn(service_catalog['endpoints']), catalog.EndpointsColumn(
auth_ref.service_catalog.catalog[0]['endpoints']),
), ) ), )
self.assertListItemEqual(datalist, tuple(data)) self.assertItemsEqual(datalist, tuple(data))
class TestCatalogShow(TestCatalog): class TestCatalogShow(TestCatalog):
@ -150,16 +152,17 @@ class TestCatalogShow(TestCatalog):
collist = ('endpoints', 'id', 'name', 'type') collist = ('endpoints', 'id', 'name', 'type')
self.assertEqual(collist, columns) self.assertEqual(collist, columns)
datalist = ( datalist = (
catalog.EndpointsColumn(self.service_catalog['endpoints']), catalog.EndpointsColumn(
auth_ref.service_catalog.catalog[0]['endpoints']),
self.service_catalog.id, self.service_catalog.id,
'supernova', 'supernova',
'compute', 'compute',
) )
self.assertItemEqual(datalist, data) self.assertItemsEqual(datalist, data)
class TestFormatColumns(TestCatalog): class TestFormatColumns(TestCatalog):
def test_endpoints_column_human_readabale(self): def test_endpoints_column_human_readable(self):
col = catalog.EndpointsColumn(self.service_catalog['endpoints']) col = catalog.EndpointsColumn(self.service_catalog['endpoints'])
self.assertEqual( self.assertEqual(
'one\n publicURL: https://public.one.example.com\n ' 'one\n publicURL: https://public.one.example.com\n '

View File

@ -643,7 +643,7 @@ class TestProjectShow(TestProject):
self.fake_proj_show.name, self.fake_proj_show.name,
format_columns.DictColumn({}), format_columns.DictColumn({}),
) )
self.assertItemEqual(datalist, data) self.assertItemsEqual(datalist, data)
class TestProjectUnset(TestProject): class TestProjectUnset(TestProject):

View File

@ -482,7 +482,7 @@ class TestUserList(TestUser):
self.users_mock.list.assert_called_with(tenant_id=None) self.users_mock.list.assert_called_with(tenant_id=None)
self.assertEqual(self.columns, columns) self.assertEqual(self.columns, columns)
self.assertListItemEqual(self.datalist, tuple(data)) self.assertItemsEqual(self.datalist, tuple(data))
def test_user_list_project(self): def test_user_list_project(self):
arglist = [ arglist = [
@ -502,7 +502,7 @@ class TestUserList(TestUser):
self.users_mock.list.assert_called_with(tenant_id=project_id) self.users_mock.list.assert_called_with(tenant_id=project_id)
self.assertEqual(self.columns, columns) self.assertEqual(self.columns, columns)
self.assertListItemEqual(self.datalist, tuple(data)) self.assertItemsEqual(self.datalist, tuple(data))
def test_user_list_long(self): def test_user_list_long(self):
arglist = [ arglist = [
@ -531,7 +531,7 @@ class TestUserList(TestUser):
self.fake_user_l.email, self.fake_user_l.email,
True, True,
), ) ), )
self.assertListItemEqual(datalist, tuple(data)) self.assertItemsEqual(datalist, tuple(data))
class TestUserSet(TestUser): class TestUserSet(TestUser):
@ -819,4 +819,4 @@ class TestUserShow(TestUser):
self.fake_user.name, self.fake_user.name,
self.fake_project.id, self.fake_project.id,
) )
self.assertItemEqual(datalist, data) self.assertItemsEqual(datalist, data)

View File

@ -91,9 +91,10 @@ class TestCatalogList(TestCatalog):
datalist = (( datalist = ((
'supernova', 'supernova',
'compute', 'compute',
catalog.EndpointsColumn(self.fake_service['endpoints']), catalog.EndpointsColumn(
auth_ref.service_catalog.catalog[0]['endpoints']),
), ) ), )
self.assertListItemEqual(datalist, tuple(data)) self.assertItemsEqual(datalist, tuple(data))
class TestCatalogShow(TestCatalog): class TestCatalogShow(TestCatalog):
@ -128,12 +129,13 @@ class TestCatalogShow(TestCatalog):
collist = ('endpoints', 'id', 'name', 'type') collist = ('endpoints', 'id', 'name', 'type')
self.assertEqual(collist, columns) self.assertEqual(collist, columns)
datalist = ( datalist = (
catalog.EndpointsColumn(self.fake_service['endpoints']), catalog.EndpointsColumn(
auth_ref.service_catalog.catalog[0]['endpoints']),
'qwertyuiop', 'qwertyuiop',
'supernova', 'supernova',
'compute', 'compute',
) )
self.assertItemEqual(datalist, data) self.assertItemsEqual(datalist, data)
class TestFormatColumns(TestCatalog): class TestFormatColumns(TestCatalog):

View File

@ -89,7 +89,7 @@ class TestIdentityProviderCreate(TestIdentityProvider):
) )
self.assertEqual(self.columns, columns) self.assertEqual(self.columns, columns)
self.assertItemEqual(self.datalist, data) self.assertItemsEqual(self.datalist, data)
def test_create_identity_provider_description(self): def test_create_identity_provider_description(self):
arglist = [ arglist = [
@ -117,7 +117,7 @@ class TestIdentityProviderCreate(TestIdentityProvider):
) )
self.assertEqual(self.columns, columns) self.assertEqual(self.columns, columns)
self.assertItemEqual(self.datalist, data) self.assertItemsEqual(self.datalist, data)
def test_create_identity_provider_remote_id(self): def test_create_identity_provider_remote_id(self):
arglist = [ arglist = [
@ -145,7 +145,7 @@ class TestIdentityProviderCreate(TestIdentityProvider):
) )
self.assertEqual(self.columns, columns) self.assertEqual(self.columns, columns)
self.assertItemEqual(self.datalist, data) self.assertItemsEqual(self.datalist, data)
def test_create_identity_provider_remote_ids_multiple(self): def test_create_identity_provider_remote_ids_multiple(self):
arglist = [ arglist = [
@ -174,7 +174,7 @@ class TestIdentityProviderCreate(TestIdentityProvider):
) )
self.assertEqual(self.columns, columns) self.assertEqual(self.columns, columns)
self.assertItemEqual(self.datalist, data) self.assertItemsEqual(self.datalist, data)
def test_create_identity_provider_remote_ids_file(self): def test_create_identity_provider_remote_ids_file(self):
arglist = [ arglist = [
@ -207,7 +207,7 @@ class TestIdentityProviderCreate(TestIdentityProvider):
) )
self.assertEqual(self.columns, columns) self.assertEqual(self.columns, columns)
self.assertItemEqual(self.datalist, data) self.assertItemsEqual(self.datalist, data)
def test_create_identity_provider_disabled(self): def test_create_identity_provider_disabled(self):
@ -250,7 +250,7 @@ class TestIdentityProviderCreate(TestIdentityProvider):
identity_fakes.idp_id, identity_fakes.idp_id,
identity_fakes.formatted_idp_remote_ids identity_fakes.formatted_idp_remote_ids
) )
self.assertItemEqual(datalist, data) self.assertItemsEqual(datalist, data)
def test_create_identity_provider_domain_name(self): def test_create_identity_provider_domain_name(self):
arglist = [ arglist = [
@ -278,7 +278,7 @@ class TestIdentityProviderCreate(TestIdentityProvider):
) )
self.assertEqual(self.columns, columns) self.assertEqual(self.columns, columns)
self.assertItemEqual(self.datalist, data) self.assertItemsEqual(self.datalist, data)
def test_create_identity_provider_domain_id(self): def test_create_identity_provider_domain_id(self):
arglist = [ arglist = [
@ -306,7 +306,7 @@ class TestIdentityProviderCreate(TestIdentityProvider):
) )
self.assertEqual(self.columns, columns) self.assertEqual(self.columns, columns)
self.assertItemEqual(self.datalist, data) self.assertItemsEqual(self.datalist, data)
class TestIdentityProviderDelete(TestIdentityProvider): class TestIdentityProviderDelete(TestIdentityProvider):
@ -382,7 +382,7 @@ class TestIdentityProviderList(TestIdentityProvider):
identity_fakes.domain_id, identity_fakes.domain_id,
identity_fakes.idp_description, identity_fakes.idp_description,
), ) ), )
self.assertListItemEqual(datalist, tuple(data)) self.assertItemsEqual(datalist, tuple(data))
def test_identity_provider_list_ID_option(self): def test_identity_provider_list_ID_option(self):
arglist = ['--id', arglist = ['--id',
@ -410,7 +410,7 @@ class TestIdentityProviderList(TestIdentityProvider):
identity_fakes.domain_id, identity_fakes.domain_id,
identity_fakes.idp_description, identity_fakes.idp_description,
), ) ), )
self.assertListItemEqual(datalist, tuple(data)) self.assertItemsEqual(datalist, tuple(data))
def test_identity_provider_list_enabled_option(self): def test_identity_provider_list_enabled_option(self):
arglist = ['--enabled'] arglist = ['--enabled']
@ -437,7 +437,7 @@ class TestIdentityProviderList(TestIdentityProvider):
identity_fakes.domain_id, identity_fakes.domain_id,
identity_fakes.idp_description, identity_fakes.idp_description,
), ) ), )
self.assertListItemEqual(datalist, tuple(data)) self.assertItemsEqual(datalist, tuple(data))
class TestIdentityProviderSet(TestIdentityProvider): class TestIdentityProviderSet(TestIdentityProvider):
@ -722,4 +722,4 @@ class TestIdentityProviderShow(TestIdentityProvider):
identity_fakes.idp_id, identity_fakes.idp_id,
identity_fakes.formatted_idp_remote_ids identity_fakes.formatted_idp_remote_ids
) )
self.assertItemEqual(datalist, data) self.assertItemsEqual(datalist, data)

View File

@ -100,7 +100,7 @@ class TestImageCreate(TestImage):
self.assertEqual(self.client.update_image.call_args_list, []) self.assertEqual(self.client.update_image.call_args_list, [])
self.assertEqual(self.columns, columns) self.assertEqual(self.columns, columns)
self.assertItemEqual(self.data, data) self.assertItemsEqual(self.data, data)
@mock.patch('sys.stdin', side_effect=[None]) @mock.patch('sys.stdin', side_effect=[None])
def test_image_reserve_options(self, raw_input): def test_image_reserve_options(self, raw_input):
@ -149,7 +149,7 @@ class TestImageCreate(TestImage):
self.assertEqual(self.client.update_image.call_args_list, []) self.assertEqual(self.client.update_image.call_args_list, [])
self.assertEqual(self.columns, columns) self.assertEqual(self.columns, columns)
self.assertItemEqual(self.data, data) self.assertItemsEqual(self.data, data)
@mock.patch('openstackclient.image.v1.image.io.open', name='Open') @mock.patch('openstackclient.image.v1.image.io.open', name='Open')
def test_image_create_file(self, mock_open): def test_image_create_file(self, mock_open):
@ -205,7 +205,7 @@ class TestImageCreate(TestImage):
self.assertEqual(self.client.update_image.call_args_list, []) self.assertEqual(self.client.update_image.call_args_list, [])
self.assertEqual(self.columns, columns) self.assertEqual(self.columns, columns)
self.assertItemEqual(self.data, data) self.assertItemsEqual(self.data, data)
class TestImageDelete(TestImage): class TestImageDelete(TestImage):
@ -386,7 +386,7 @@ class TestImageList(TestImage):
format_columns.DictColumn( format_columns.DictColumn(
{'Alpha': 'a', 'Beta': 'b', 'Gamma': 'g'}), {'Alpha': 'a', 'Beta': 'b', 'Gamma': 'g'}),
), ) ), )
self.assertListItemEqual(datalist, tuple(data)) self.assertItemsEqual(datalist, tuple(data))
@mock.patch('osc_lib.api.utils.simple_filter') @mock.patch('osc_lib.api.utils.simple_filter')
def test_image_list_property_option(self, sf_mock): def test_image_list_property_option(self, sf_mock):
@ -737,7 +737,7 @@ class TestImageShow(TestImage):
) )
self.assertEqual(self.columns, columns) self.assertEqual(self.columns, columns)
self.assertItemEqual(self.data, data) self.assertItemsEqual(self.data, data)
def test_image_show_human_readable(self): def test_image_show_human_readable(self):
arglist = [ arglist = [

View File

@ -111,7 +111,7 @@ class TestImageCreate(TestImage):
self.assertEqual( self.assertEqual(
self.expected_columns, self.expected_columns,
columns) columns)
self.assertItemEqual( self.assertItemsEqual(
self.expected_data, self.expected_data,
data) data)
@ -166,7 +166,7 @@ class TestImageCreate(TestImage):
self.assertEqual( self.assertEqual(
self.expected_columns, self.expected_columns,
columns) columns)
self.assertItemEqual( self.assertItemsEqual(
self.expected_data, self.expected_data,
data) data)
@ -255,7 +255,7 @@ class TestImageCreate(TestImage):
self.assertEqual( self.assertEqual(
self.expected_columns, self.expected_columns,
columns) columns)
self.assertItemEqual( self.assertItemsEqual(
self.expected_data, self.expected_data,
data) data)
@ -513,7 +513,7 @@ class TestImageList(TestImage):
) )
self.assertEqual(self.columns, columns) self.assertEqual(self.columns, columns)
self.assertListItemEqual(self.datalist, tuple(data)) self.assertItemsEqual(self.datalist, tuple(data))
def test_image_list_public_option(self): def test_image_list_public_option(self):
arglist = [ arglist = [
@ -537,7 +537,7 @@ class TestImageList(TestImage):
) )
self.assertEqual(self.columns, columns) self.assertEqual(self.columns, columns)
self.assertListItemEqual(self.datalist, tuple(data)) self.assertItemsEqual(self.datalist, tuple(data))
def test_image_list_private_option(self): def test_image_list_private_option(self):
arglist = [ arglist = [
@ -561,7 +561,7 @@ class TestImageList(TestImage):
) )
self.assertEqual(self.columns, columns) self.assertEqual(self.columns, columns)
self.assertListItemEqual(self.datalist, tuple(data)) self.assertItemsEqual(self.datalist, tuple(data))
def test_image_list_community_option(self): def test_image_list_community_option(self):
arglist = [ arglist = [
@ -609,7 +609,7 @@ class TestImageList(TestImage):
) )
self.assertEqual(self.columns, columns) self.assertEqual(self.columns, columns)
self.assertListItemEqual(self.datalist, tuple(data)) self.assertItemsEqual(self.datalist, tuple(data))
def test_image_list_shared_member_status_option(self): def test_image_list_shared_member_status_option(self):
arglist = [ arglist = [
@ -697,7 +697,7 @@ class TestImageList(TestImage):
self._image.owner_id, self._image.owner_id,
format_columns.ListColumn(self._image.tags), format_columns.ListColumn(self._image.tags),
), ) ), )
self.assertListItemEqual(datalist, tuple(data)) self.assertItemsEqual(datalist, tuple(data))
@mock.patch('osc_lib.api.utils.simple_filter') @mock.patch('osc_lib.api.utils.simple_filter')
def test_image_list_property_option(self, sf_mock): def test_image_list_property_option(self, sf_mock):
@ -725,7 +725,7 @@ class TestImageList(TestImage):
) )
self.assertEqual(self.columns, columns) self.assertEqual(self.columns, columns)
self.assertListItemEqual(self.datalist, tuple(data)) self.assertItemsEqual(self.datalist, tuple(data))
@mock.patch('osc_lib.utils.sort_items') @mock.patch('osc_lib.utils.sort_items')
def test_image_list_sort_option(self, si_mock): def test_image_list_sort_option(self, si_mock):
@ -747,7 +747,7 @@ class TestImageList(TestImage):
str, str,
) )
self.assertEqual(self.columns, columns) self.assertEqual(self.columns, columns)
self.assertListItemEqual(self.datalist, tuple(data)) self.assertItemsEqual(self.datalist, tuple(data))
def test_image_list_limit_option(self): def test_image_list_limit_option(self):
ret_limit = 1 ret_limit = 1
@ -1472,7 +1472,7 @@ class TestImageShow(TestImage):
) )
self.assertEqual(self.columns, columns) self.assertEqual(self.columns, columns)
self.assertItemEqual(self.data, data) self.assertItemsEqual(self.data, data)
def test_image_show_human_readable(self): def test_image_show_human_readable(self):
self.client.find_image.return_value = self.new_image self.client.find_image.return_value = self.new_image

View File

@ -75,7 +75,7 @@ class TestListIPAvailability(TestIPAvailability):
self.network.network_ip_availabilities.assert_called_once_with( self.network.network_ip_availabilities.assert_called_once_with(
**filters) **filters)
self.assertEqual(self.columns, columns) self.assertEqual(self.columns, columns)
self.assertListItemEqual(self.data, list(data)) self.assertItemsEqual(self.data, list(data))
def test_list_ip_version(self): def test_list_ip_version(self):
arglist = [ arglist = [
@ -93,7 +93,7 @@ class TestListIPAvailability(TestIPAvailability):
self.network.network_ip_availabilities.assert_called_once_with( self.network.network_ip_availabilities.assert_called_once_with(
**filters) **filters)
self.assertEqual(self.columns, columns) self.assertEqual(self.columns, columns)
self.assertListItemEqual(self.data, list(data)) self.assertItemsEqual(self.data, list(data))
def test_list_project(self): def test_list_project(self):
arglist = [ arglist = [
@ -113,7 +113,7 @@ class TestListIPAvailability(TestIPAvailability):
self.network.network_ip_availabilities.assert_called_once_with( self.network.network_ip_availabilities.assert_called_once_with(
**filters) **filters)
self.assertEqual(self.columns, columns) self.assertEqual(self.columns, columns)
self.assertListItemEqual(self.data, list(data)) self.assertItemsEqual(self.data, list(data))
class TestShowIPAvailability(TestIPAvailability): class TestShowIPAvailability(TestIPAvailability):
@ -176,4 +176,4 @@ class TestShowIPAvailability(TestIPAvailability):
self._ip_availability.network_name, self._ip_availability.network_name,
ignore_missing=False) ignore_missing=False)
self.assertEqual(self.columns, columns) self.assertEqual(self.columns, columns)
self.assertItemEqual(self.data, data) self.assertItemsEqual(self.data, data)

View File

@ -146,7 +146,7 @@ class TestCreateNetworkIdentityV3(TestNetwork):
}) })
self.assertFalse(self.network.set_tags.called) self.assertFalse(self.network.set_tags.called)
self.assertEqual(self.columns, columns) self.assertEqual(self.columns, columns)
self.assertItemEqual(self.data, data) self.assertItemsEqual(self.data, data)
def test_create_all_options(self): def test_create_all_options(self):
arglist = [ arglist = [
@ -211,7 +211,7 @@ class TestCreateNetworkIdentityV3(TestNetwork):
'dns_domain': 'example.org.', 'dns_domain': 'example.org.',
}) })
self.assertEqual(self.columns, columns) self.assertEqual(self.columns, columns)
self.assertItemEqual(self.data, data) self.assertItemsEqual(self.data, data)
def test_create_other_options(self): def test_create_other_options(self):
arglist = [ arglist = [
@ -238,7 +238,7 @@ class TestCreateNetworkIdentityV3(TestNetwork):
'port_security_enabled': False, 'port_security_enabled': False,
}) })
self.assertEqual(self.columns, columns) self.assertEqual(self.columns, columns)
self.assertItemEqual(self.data, data) self.assertItemsEqual(self.data, data)
def _test_create_with_tag(self, add_tags=True): def _test_create_with_tag(self, add_tags=True):
arglist = [self._network.name] arglist = [self._network.name]
@ -270,7 +270,7 @@ class TestCreateNetworkIdentityV3(TestNetwork):
else: else:
self.assertFalse(self.network.set_tags.called) self.assertFalse(self.network.set_tags.called)
self.assertEqual(self.columns, columns) self.assertEqual(self.columns, columns)
self.assertItemEqual(self.data, data) self.assertItemsEqual(self.data, data)
def test_create_with_tags(self): def test_create_with_tags(self):
self._test_create_with_tag(add_tags=True) self._test_create_with_tag(add_tags=True)
@ -385,7 +385,7 @@ class TestCreateNetworkIdentityV2(TestNetwork):
}) })
self.assertFalse(self.network.set_tags.called) self.assertFalse(self.network.set_tags.called)
self.assertEqual(self.columns, columns) self.assertEqual(self.columns, columns)
self.assertItemEqual(self.data, data) self.assertItemsEqual(self.data, data)
def test_create_with_domain_identityv2(self): def test_create_with_domain_identityv2(self):
arglist = [ arglist = [
@ -577,7 +577,7 @@ class TestListNetwork(TestNetwork):
self.network.networks.assert_called_once_with() self.network.networks.assert_called_once_with()
self.assertEqual(self.columns, columns) self.assertEqual(self.columns, columns)
self.assertListItemEqual(self.data, list(data)) self.assertItemsEqual(self.data, list(data))
def test_list_external(self): def test_list_external(self):
arglist = [ arglist = [
@ -598,7 +598,7 @@ class TestListNetwork(TestNetwork):
**{'router:external': True, 'is_router_external': True} **{'router:external': True, 'is_router_external': True}
) )
self.assertEqual(self.columns, columns) self.assertEqual(self.columns, columns)
self.assertListItemEqual(self.data, list(data)) self.assertItemsEqual(self.data, list(data))
def test_list_internal(self): def test_list_internal(self):
arglist = [ arglist = [
@ -615,7 +615,7 @@ class TestListNetwork(TestNetwork):
**{'router:external': False, 'is_router_external': False} **{'router:external': False, 'is_router_external': False}
) )
self.assertEqual(self.columns, columns) self.assertEqual(self.columns, columns)
self.assertListItemEqual(self.data, list(data)) self.assertItemsEqual(self.data, list(data))
def test_network_list_long(self): def test_network_list_long(self):
arglist = [ arglist = [
@ -634,7 +634,7 @@ class TestListNetwork(TestNetwork):
self.network.networks.assert_called_once_with() self.network.networks.assert_called_once_with()
self.assertEqual(self.columns_long, columns) self.assertEqual(self.columns_long, columns)
self.assertListItemEqual(self.data_long, list(data)) self.assertItemsEqual(self.data_long, list(data))
def test_list_name(self): def test_list_name(self):
test_name = "fakename" test_name = "fakename"
@ -653,7 +653,7 @@ class TestListNetwork(TestNetwork):
**{'name': test_name} **{'name': test_name}
) )
self.assertEqual(self.columns, columns) self.assertEqual(self.columns, columns)
self.assertListItemEqual(self.data, list(data)) self.assertItemsEqual(self.data, list(data))
def test_network_list_enable(self): def test_network_list_enable(self):
arglist = [ arglist = [
@ -671,7 +671,7 @@ class TestListNetwork(TestNetwork):
**{'admin_state_up': True, 'is_admin_state_up': True} **{'admin_state_up': True, 'is_admin_state_up': True}
) )
self.assertEqual(self.columns, columns) self.assertEqual(self.columns, columns)
self.assertListItemEqual(self.data, list(data)) self.assertItemsEqual(self.data, list(data))
def test_network_list_disable(self): def test_network_list_disable(self):
arglist = [ arglist = [
@ -689,7 +689,7 @@ class TestListNetwork(TestNetwork):
**{'admin_state_up': False, 'is_admin_state_up': False} **{'admin_state_up': False, 'is_admin_state_up': False}
) )
self.assertEqual(self.columns, columns) self.assertEqual(self.columns, columns)
self.assertListItemEqual(self.data, list(data)) self.assertItemsEqual(self.data, list(data))
def test_network_list_project(self): def test_network_list_project(self):
project = identity_fakes_v3.FakeProject.create_one_project() project = identity_fakes_v3.FakeProject.create_one_project()
@ -708,7 +708,7 @@ class TestListNetwork(TestNetwork):
) )
self.assertEqual(self.columns, columns) self.assertEqual(self.columns, columns)
self.assertListItemEqual(self.data, list(data)) self.assertItemsEqual(self.data, list(data))
def test_network_list_project_domain(self): def test_network_list_project_domain(self):
project = identity_fakes_v3.FakeProject.create_one_project() project = identity_fakes_v3.FakeProject.create_one_project()
@ -727,7 +727,7 @@ class TestListNetwork(TestNetwork):
self.network.networks.assert_called_once_with(**filters) self.network.networks.assert_called_once_with(**filters)
self.assertEqual(self.columns, columns) self.assertEqual(self.columns, columns)
self.assertListItemEqual(self.data, list(data)) self.assertItemsEqual(self.data, list(data))
def test_network_list_share(self): def test_network_list_share(self):
arglist = [ arglist = [
@ -744,7 +744,7 @@ class TestListNetwork(TestNetwork):
**{'shared': True, 'is_shared': True} **{'shared': True, 'is_shared': True}
) )
self.assertEqual(self.columns, columns) self.assertEqual(self.columns, columns)
self.assertListItemEqual(self.data, list(data)) self.assertItemsEqual(self.data, list(data))
def test_network_list_no_share(self): def test_network_list_no_share(self):
arglist = [ arglist = [
@ -761,7 +761,7 @@ class TestListNetwork(TestNetwork):
**{'shared': False, 'is_shared': False} **{'shared': False, 'is_shared': False}
) )
self.assertEqual(self.columns, columns) self.assertEqual(self.columns, columns)
self.assertListItemEqual(self.data, list(data)) self.assertItemsEqual(self.data, list(data))
def test_network_list_status(self): def test_network_list_status(self):
choices = ['ACTIVE', 'BUILD', 'DOWN', 'ERROR'] choices = ['ACTIVE', 'BUILD', 'DOWN', 'ERROR']
@ -780,7 +780,7 @@ class TestListNetwork(TestNetwork):
**{'status': test_status} **{'status': test_status}
) )
self.assertEqual(self.columns, columns) self.assertEqual(self.columns, columns)
self.assertListItemEqual(self.data, list(data)) self.assertItemsEqual(self.data, list(data))
def test_network_list_provider_network_type(self): def test_network_list_provider_network_type(self):
network_type = self._network[0].provider_network_type network_type = self._network[0].provider_network_type
@ -798,7 +798,7 @@ class TestListNetwork(TestNetwork):
'provider_network_type': network_type} 'provider_network_type': network_type}
) )
self.assertEqual(self.columns, columns) self.assertEqual(self.columns, columns)
self.assertListItemEqual(self.data, list(data)) self.assertItemsEqual(self.data, list(data))
def test_network_list_provider_physical_network(self): def test_network_list_provider_physical_network(self):
physical_network = self._network[0].provider_physical_network physical_network = self._network[0].provider_physical_network
@ -816,7 +816,7 @@ class TestListNetwork(TestNetwork):
'provider_physical_network': physical_network} 'provider_physical_network': physical_network}
) )
self.assertEqual(self.columns, columns) self.assertEqual(self.columns, columns)
self.assertListItemEqual(self.data, list(data)) self.assertItemsEqual(self.data, list(data))
def test_network_list_provider_segment(self): def test_network_list_provider_segment(self):
segmentation_id = self._network[0].provider_segmentation_id segmentation_id = self._network[0].provider_segmentation_id
@ -834,7 +834,7 @@ class TestListNetwork(TestNetwork):
'provider_segmentation_id': segmentation_id} 'provider_segmentation_id': segmentation_id}
) )
self.assertEqual(self.columns, columns) self.assertEqual(self.columns, columns)
self.assertListItemEqual(self.data, list(data)) self.assertItemsEqual(self.data, list(data))
def test_network_list_dhcp_agent(self): def test_network_list_dhcp_agent(self):
arglist = [ arglist = [
@ -853,7 +853,7 @@ class TestListNetwork(TestNetwork):
*attrs) *attrs)
self.assertEqual(self.columns, columns) self.assertEqual(self.columns, columns)
self.assertListItemEqual(list(data), list(self.data)) self.assertItemsEqual(list(data), list(self.data))
def test_list_with_tag_options(self): def test_list_with_tag_options(self):
arglist = [ arglist = [
@ -878,7 +878,7 @@ class TestListNetwork(TestNetwork):
'not_any_tags': 'black,white'} 'not_any_tags': 'black,white'}
) )
self.assertEqual(self.columns, columns) self.assertEqual(self.columns, columns)
self.assertListItemEqual(self.data, list(data)) self.assertItemsEqual(self.data, list(data))
class TestSetNetwork(TestNetwork): class TestSetNetwork(TestNetwork):
@ -1111,7 +1111,7 @@ class TestShowNetwork(TestNetwork):
self._network.name, ignore_missing=False) self._network.name, ignore_missing=False)
self.assertEqual(self.columns, columns) self.assertEqual(self.columns, columns)
self.assertItemEqual(self.data, data) self.assertItemsEqual(self.data, data)
class TestUnsetNetwork(TestNetwork): class TestUnsetNetwork(TestNetwork):

View File

@ -246,7 +246,7 @@ class TestListNetworkAgent(TestNetworkAgent):
self.network.agents.assert_called_once_with(**{}) self.network.agents.assert_called_once_with(**{})
self.assertEqual(self.columns, columns) self.assertEqual(self.columns, columns)
self.assertListItemEqual(self.data, list(data)) self.assertItemsEqual(self.data, list(data))
def test_network_agents_list_agent_type(self): def test_network_agents_list_agent_type(self):
arglist = [ arglist = [
@ -263,7 +263,7 @@ class TestListNetworkAgent(TestNetworkAgent):
'agent_type': 'DHCP agent', 'agent_type': 'DHCP agent',
}) })
self.assertEqual(self.columns, columns) self.assertEqual(self.columns, columns)
self.assertListItemEqual(self.data, list(data)) self.assertItemsEqual(self.data, list(data))
def test_network_agents_list_host(self): def test_network_agents_list_host(self):
arglist = [ arglist = [
@ -280,7 +280,7 @@ class TestListNetworkAgent(TestNetworkAgent):
'host': self.network_agents[0].host, 'host': self.network_agents[0].host,
}) })
self.assertEqual(self.columns, columns) self.assertEqual(self.columns, columns)
self.assertListItemEqual(self.data, list(data)) self.assertItemsEqual(self.data, list(data))
def test_network_agents_list_networks(self): def test_network_agents_list_networks(self):
arglist = [ arglist = [
@ -298,7 +298,7 @@ class TestListNetworkAgent(TestNetworkAgent):
self.network.network_hosting_dhcp_agents.assert_called_once_with( self.network.network_hosting_dhcp_agents.assert_called_once_with(
*attrs) *attrs)
self.assertEqual(self.columns, columns) self.assertEqual(self.columns, columns)
self.assertListItemEqual(self.data, list(data)) self.assertItemsEqual(self.data, list(data))
def test_network_agents_list_routers(self): def test_network_agents_list_routers(self):
arglist = [ arglist = [
@ -318,7 +318,7 @@ class TestListNetworkAgent(TestNetworkAgent):
*attrs) *attrs)
self.assertEqual(self.columns, columns) self.assertEqual(self.columns, columns)
self.assertListItemEqual(self.data, list(data)) self.assertItemsEqual(self.data, list(data))
def test_network_agents_list_routers_with_long_option(self): def test_network_agents_list_routers_with_long_option(self):
arglist = [ arglist = [
@ -343,7 +343,7 @@ class TestListNetworkAgent(TestNetworkAgent):
router_agent_data = [d + ('',) for d in self.data] router_agent_data = [d + ('',) for d in self.data]
self.assertEqual(router_agent_columns, columns) self.assertEqual(router_agent_columns, columns)
self.assertListItemEqual(router_agent_data, list(data)) self.assertItemsEqual(router_agent_data, list(data))
class TestRemoveNetworkFromAgent(TestNetworkAgent): class TestRemoveNetworkFromAgent(TestNetworkAgent):
@ -571,4 +571,4 @@ class TestShowNetworkAgent(TestNetworkAgent):
self.network.get_agent.assert_called_once_with( self.network.get_agent.assert_called_once_with(
self._network_agent.id) self._network_agent.id)
self.assertEqual(self.columns, columns) self.assertEqual(self.columns, columns)
self.assertItemEqual(list(self.data), list(data)) self.assertItemsEqual(list(self.data), list(data))

View File

@ -151,7 +151,7 @@ class TestCreatePort(TestPort):
self.assertFalse(self.network.set_tags.called) self.assertFalse(self.network.set_tags.called)
self.assertEqual(self.columns, columns) self.assertEqual(self.columns, columns)
self.assertItemEqual(self.data, data) self.assertItemsEqual(self.data, data)
def test_create_full_options(self): def test_create_full_options(self):
arglist = [ arglist = [
@ -209,7 +209,7 @@ class TestCreatePort(TestPort):
}) })
self.assertEqual(self.columns, columns) self.assertEqual(self.columns, columns)
self.assertItemEqual(self.data, data) self.assertItemsEqual(self.data, data)
def test_create_invalid_json_binding_profile(self): def test_create_invalid_json_binding_profile(self):
arglist = [ arglist = [
@ -260,7 +260,7 @@ class TestCreatePort(TestPort):
}) })
self.assertEqual(self.columns, columns) self.assertEqual(self.columns, columns)
self.assertItemEqual(self.data, data) self.assertItemsEqual(self.data, data)
def test_create_with_security_group(self): def test_create_with_security_group(self):
secgroup = network_fakes.FakeSecurityGroup.create_one_security_group() secgroup = network_fakes.FakeSecurityGroup.create_one_security_group()
@ -289,7 +289,7 @@ class TestCreatePort(TestPort):
}) })
self.assertEqual(self.columns, columns) self.assertEqual(self.columns, columns)
self.assertItemEqual(self.data, data) self.assertItemsEqual(self.data, data)
def test_create_port_with_dns_name(self): def test_create_port_with_dns_name(self):
arglist = [ arglist = [
@ -315,7 +315,7 @@ class TestCreatePort(TestPort):
}) })
self.assertEqual(self.columns, columns) self.assertEqual(self.columns, columns)
self.assertItemEqual(self.data, data) self.assertItemsEqual(self.data, data)
def test_create_with_security_groups(self): def test_create_with_security_groups(self):
sg_1 = network_fakes.FakeSecurityGroup.create_one_security_group() sg_1 = network_fakes.FakeSecurityGroup.create_one_security_group()
@ -345,7 +345,7 @@ class TestCreatePort(TestPort):
}) })
self.assertEqual(self.columns, columns) self.assertEqual(self.columns, columns)
self.assertItemEqual(self.data, data) self.assertItemsEqual(self.data, data)
def test_create_with_no_security_groups(self): def test_create_with_no_security_groups(self):
arglist = [ arglist = [
@ -371,7 +371,7 @@ class TestCreatePort(TestPort):
}) })
self.assertEqual(self.columns, columns) self.assertEqual(self.columns, columns)
self.assertItemEqual(self.data, data) self.assertItemsEqual(self.data, data)
def test_create_with_no_fixed_ips(self): def test_create_with_no_fixed_ips(self):
arglist = [ arglist = [
@ -397,7 +397,7 @@ class TestCreatePort(TestPort):
}) })
self.assertEqual(self.columns, columns) self.assertEqual(self.columns, columns)
self.assertItemEqual(self.data, data) self.assertItemsEqual(self.data, data)
def test_create_port_with_allowed_address_pair_ipaddr(self): def test_create_port_with_allowed_address_pair_ipaddr(self):
pairs = [{'ip_address': '192.168.1.123'}, pairs = [{'ip_address': '192.168.1.123'},
@ -427,7 +427,7 @@ class TestCreatePort(TestPort):
}) })
self.assertEqual(self.columns, columns) self.assertEqual(self.columns, columns)
self.assertItemEqual(self.data, data) self.assertItemsEqual(self.data, data)
def test_create_port_with_allowed_address_pair(self): def test_create_port_with_allowed_address_pair(self):
pairs = [{'ip_address': '192.168.1.123', pairs = [{'ip_address': '192.168.1.123',
@ -463,7 +463,7 @@ class TestCreatePort(TestPort):
}) })
self.assertEqual(self.columns, columns) self.assertEqual(self.columns, columns)
self.assertItemEqual(self.data, data) self.assertItemsEqual(self.data, data)
def test_create_port_with_qos(self): def test_create_port_with_qos(self):
qos_policy = network_fakes.FakeNetworkQosPolicy.create_one_qos_policy() qos_policy = network_fakes.FakeNetworkQosPolicy.create_one_qos_policy()
@ -491,7 +491,7 @@ class TestCreatePort(TestPort):
}) })
self.assertEqual(self.columns, columns) self.assertEqual(self.columns, columns)
self.assertItemEqual(self.data, data) self.assertItemsEqual(self.data, data)
def test_create_port_security_enabled(self): def test_create_port_security_enabled(self):
arglist = [ arglist = [
@ -600,7 +600,7 @@ class TestCreatePort(TestPort):
self.assertFalse(self.network.set_tags.called) self.assertFalse(self.network.set_tags.called)
self.assertEqual(self.columns, columns) self.assertEqual(self.columns, columns)
self.assertItemEqual(self.data, data) self.assertItemsEqual(self.data, data)
def test_create_with_tags(self): def test_create_with_tags(self):
self._test_create_with_tag(add_tags=True, add_tags_in_post=True) self._test_create_with_tag(add_tags=True, add_tags_in_post=True)
@ -643,7 +643,7 @@ class TestCreatePort(TestPort):
}) })
self.assertEqual(self.columns, columns) self.assertEqual(self.columns, columns)
self.assertItemEqual(self.data, data) self.assertItemsEqual(self.data, data)
def test_create_with_uplink_status_propagation_enabled(self): def test_create_with_uplink_status_propagation_enabled(self):
self._test_create_with_uplink_status_propagation(enable=True) self._test_create_with_uplink_status_propagation(enable=True)
@ -723,7 +723,7 @@ class TestCreatePort(TestPort):
self.network.create_port.assert_called_once_with(**create_args) self.network.create_port.assert_called_once_with(**create_args)
self.assertEqual(self.columns, columns) self.assertEqual(self.columns, columns)
self.assertItemEqual(self.data, data) self.assertItemsEqual(self.data, data)
def test_create_with_numa_affinity_policy_required(self): def test_create_with_numa_affinity_policy_required(self):
self._test_create_with_numa_affinity_policy(policy='required') self._test_create_with_numa_affinity_policy(policy='required')
@ -890,7 +890,7 @@ class TestListPort(TestPort):
self.network.ports.assert_called_once_with( self.network.ports.assert_called_once_with(
fields=LIST_FIELDS_TO_RETRIEVE) fields=LIST_FIELDS_TO_RETRIEVE)
self.assertEqual(self.columns, columns) self.assertEqual(self.columns, columns)
self.assertListItemEqual(self.data, list(data)) self.assertItemsEqual(self.data, list(data))
def test_port_list_router_opt(self): def test_port_list_router_opt(self):
arglist = [ arglist = [
@ -910,7 +910,7 @@ class TestListPort(TestPort):
'fields': LIST_FIELDS_TO_RETRIEVE, 'fields': LIST_FIELDS_TO_RETRIEVE,
}) })
self.assertEqual(self.columns, columns) self.assertEqual(self.columns, columns)
self.assertListItemEqual(self.data, list(data)) self.assertItemsEqual(self.data, list(data))
@mock.patch.object(utils, 'find_resource') @mock.patch.object(utils, 'find_resource')
def test_port_list_with_server_option(self, mock_find): def test_port_list_with_server_option(self, mock_find):
@ -931,7 +931,7 @@ class TestListPort(TestPort):
fields=LIST_FIELDS_TO_RETRIEVE) fields=LIST_FIELDS_TO_RETRIEVE)
mock_find.assert_called_once_with(mock.ANY, 'fake-server-name') mock_find.assert_called_once_with(mock.ANY, 'fake-server-name')
self.assertEqual(self.columns, columns) self.assertEqual(self.columns, columns)
self.assertListItemEqual(self.data, list(data)) self.assertItemsEqual(self.data, list(data))
def test_port_list_device_id_opt(self): def test_port_list_device_id_opt(self):
arglist = [ arglist = [
@ -951,7 +951,7 @@ class TestListPort(TestPort):
'fields': LIST_FIELDS_TO_RETRIEVE, 'fields': LIST_FIELDS_TO_RETRIEVE,
}) })
self.assertEqual(self.columns, columns) self.assertEqual(self.columns, columns)
self.assertListItemEqual(self.data, list(data)) self.assertItemsEqual(self.data, list(data))
def test_port_list_device_owner_opt(self): def test_port_list_device_owner_opt(self):
arglist = [ arglist = [
@ -971,7 +971,7 @@ class TestListPort(TestPort):
'fields': LIST_FIELDS_TO_RETRIEVE, 'fields': LIST_FIELDS_TO_RETRIEVE,
}) })
self.assertEqual(self.columns, columns) self.assertEqual(self.columns, columns)
self.assertListItemEqual(self.data, list(data)) self.assertItemsEqual(self.data, list(data))
def test_port_list_all_opt(self): def test_port_list_all_opt(self):
arglist = [ arglist = [
@ -1000,7 +1000,7 @@ class TestListPort(TestPort):
'fields': LIST_FIELDS_TO_RETRIEVE, 'fields': LIST_FIELDS_TO_RETRIEVE,
}) })
self.assertEqual(self.columns, columns) self.assertEqual(self.columns, columns)
self.assertListItemEqual(self.data, list(data)) self.assertItemsEqual(self.data, list(data))
def test_port_list_mac_address_opt(self): def test_port_list_mac_address_opt(self):
arglist = [ arglist = [
@ -1020,7 +1020,7 @@ class TestListPort(TestPort):
'fields': LIST_FIELDS_TO_RETRIEVE, 'fields': LIST_FIELDS_TO_RETRIEVE,
}) })
self.assertEqual(self.columns, columns) self.assertEqual(self.columns, columns)
self.assertListItemEqual(self.data, list(data)) self.assertItemsEqual(self.data, list(data))
def test_port_list_fixed_ip_opt_ip_address(self): def test_port_list_fixed_ip_opt_ip_address(self):
ip_address = self._ports[0].fixed_ips[0]['ip_address'] ip_address = self._ports[0].fixed_ips[0]['ip_address']
@ -1040,7 +1040,7 @@ class TestListPort(TestPort):
'fields': LIST_FIELDS_TO_RETRIEVE, 'fields': LIST_FIELDS_TO_RETRIEVE,
}) })
self.assertEqual(self.columns, columns) self.assertEqual(self.columns, columns)
self.assertListItemEqual(self.data, list(data)) self.assertItemsEqual(self.data, list(data))
def test_port_list_fixed_ip_opt_ip_address_substr(self): def test_port_list_fixed_ip_opt_ip_address_substr(self):
ip_address_ss = self._ports[0].fixed_ips[0]['ip_address'][:-1] ip_address_ss = self._ports[0].fixed_ips[0]['ip_address'][:-1]
@ -1060,7 +1060,7 @@ class TestListPort(TestPort):
'fields': LIST_FIELDS_TO_RETRIEVE, 'fields': LIST_FIELDS_TO_RETRIEVE,
}) })
self.assertEqual(self.columns, columns) self.assertEqual(self.columns, columns)
self.assertListItemEqual(self.data, list(data)) self.assertItemsEqual(self.data, list(data))
def test_port_list_fixed_ip_opt_subnet_id(self): def test_port_list_fixed_ip_opt_subnet_id(self):
subnet_id = self._ports[0].fixed_ips[0]['subnet_id'] subnet_id = self._ports[0].fixed_ips[0]['subnet_id']
@ -1082,7 +1082,7 @@ class TestListPort(TestPort):
'fields': LIST_FIELDS_TO_RETRIEVE, 'fields': LIST_FIELDS_TO_RETRIEVE,
}) })
self.assertEqual(self.columns, columns) self.assertEqual(self.columns, columns)
self.assertListItemEqual(self.data, list(data)) self.assertItemsEqual(self.data, list(data))
def test_port_list_fixed_ip_opts(self): def test_port_list_fixed_ip_opts(self):
subnet_id = self._ports[0].fixed_ips[0]['subnet_id'] subnet_id = self._ports[0].fixed_ips[0]['subnet_id']
@ -1108,7 +1108,7 @@ class TestListPort(TestPort):
'fields': LIST_FIELDS_TO_RETRIEVE, 'fields': LIST_FIELDS_TO_RETRIEVE,
}) })
self.assertEqual(self.columns, columns) self.assertEqual(self.columns, columns)
self.assertListItemEqual(self.data, list(data)) self.assertItemsEqual(self.data, list(data))
def test_port_list_fixed_ips(self): def test_port_list_fixed_ips(self):
subnet_id = self._ports[0].fixed_ips[0]['subnet_id'] subnet_id = self._ports[0].fixed_ips[0]['subnet_id']
@ -1136,7 +1136,7 @@ class TestListPort(TestPort):
'fields': LIST_FIELDS_TO_RETRIEVE, 'fields': LIST_FIELDS_TO_RETRIEVE,
}) })
self.assertEqual(self.columns, columns) self.assertEqual(self.columns, columns)
self.assertListItemEqual(self.data, list(data)) self.assertItemsEqual(self.data, list(data))
def test_list_port_with_long(self): def test_list_port_with_long(self):
arglist = [ arglist = [
@ -1154,7 +1154,7 @@ class TestListPort(TestPort):
self.network.ports.assert_called_once_with( self.network.ports.assert_called_once_with(
fields=LIST_FIELDS_TO_RETRIEVE + LIST_FIELDS_TO_RETRIEVE_LONG) fields=LIST_FIELDS_TO_RETRIEVE + LIST_FIELDS_TO_RETRIEVE_LONG)
self.assertEqual(self.columns_long, columns) self.assertEqual(self.columns_long, columns)
self.assertListItemEqual(self.data_long, list(data)) self.assertItemsEqual(self.data_long, list(data))
def test_port_list_host(self): def test_port_list_host(self):
arglist = [ arglist = [
@ -1173,7 +1173,7 @@ class TestListPort(TestPort):
self.network.ports.assert_called_once_with(**filters) self.network.ports.assert_called_once_with(**filters)
self.assertEqual(self.columns, columns) self.assertEqual(self.columns, columns)
self.assertListItemEqual(self.data, list(data)) self.assertItemsEqual(self.data, list(data))
def test_port_list_project(self): def test_port_list_project(self):
project = identity_fakes.FakeProject.create_one_project() project = identity_fakes.FakeProject.create_one_project()
@ -1195,7 +1195,7 @@ class TestListPort(TestPort):
self.network.ports.assert_called_once_with(**filters) self.network.ports.assert_called_once_with(**filters)
self.assertEqual(self.columns, columns) self.assertEqual(self.columns, columns)
self.assertListItemEqual(self.data, list(data)) self.assertItemsEqual(self.data, list(data))
def test_port_list_project_domain(self): def test_port_list_project_domain(self):
project = identity_fakes.FakeProject.create_one_project() project = identity_fakes.FakeProject.create_one_project()
@ -1219,7 +1219,7 @@ class TestListPort(TestPort):
self.network.ports.assert_called_once_with(**filters) self.network.ports.assert_called_once_with(**filters)
self.assertEqual(self.columns, columns) self.assertEqual(self.columns, columns)
self.assertListItemEqual(self.data, list(data)) self.assertItemsEqual(self.data, list(data))
def test_list_with_tag_options(self): def test_list_with_tag_options(self):
arglist = [ arglist = [
@ -1245,7 +1245,7 @@ class TestListPort(TestPort):
'fields': LIST_FIELDS_TO_RETRIEVE} 'fields': LIST_FIELDS_TO_RETRIEVE}
) )
self.assertEqual(self.columns, columns) self.assertEqual(self.columns, columns)
self.assertListItemEqual(self.data, list(data)) self.assertItemsEqual(self.data, list(data))
class TestSetPort(TestPort): class TestSetPort(TestPort):
@ -1845,7 +1845,7 @@ class TestShowPort(TestPort):
self._port.name, ignore_missing=False) self._port.name, ignore_missing=False)
self.assertEqual(self.columns, columns) self.assertEqual(self.columns, columns)
self.assertItemEqual(self.data, data) self.assertItemsEqual(self.data, data)
class TestUnsetPort(TestPort): class TestUnsetPort(TestPort):

View File

@ -184,7 +184,7 @@ class TestCreateRouter(TestRouter):
}) })
self.assertFalse(self.network.set_tags.called) self.assertFalse(self.network.set_tags.called)
self.assertEqual(self.columns, columns) self.assertEqual(self.columns, columns)
self.assertItemEqual(self.data, data) self.assertItemsEqual(self.data, data)
def _test_create_with_ha_options(self, option, ha): def _test_create_with_ha_options(self, option, ha):
arglist = [ arglist = [
@ -208,7 +208,7 @@ class TestCreateRouter(TestRouter):
'ha': ha, 'ha': ha,
}) })
self.assertEqual(self.columns, columns) self.assertEqual(self.columns, columns)
self.assertItemEqual(self.data, data) self.assertItemsEqual(self.data, data)
def test_create_with_ha_option(self): def test_create_with_ha_option(self):
self._test_create_with_ha_options('--ha', True) self._test_create_with_ha_options('--ha', True)
@ -237,7 +237,7 @@ class TestCreateRouter(TestRouter):
'distributed': distributed, 'distributed': distributed,
}) })
self.assertEqual(self.columns, columns) self.assertEqual(self.columns, columns)
self.assertItemEqual(self.data, data) self.assertItemsEqual(self.data, data)
def test_create_with_distributed_option(self): def test_create_with_distributed_option(self):
self._test_create_with_distributed_options('--distributed', True) self._test_create_with_distributed_options('--distributed', True)
@ -268,7 +268,7 @@ class TestCreateRouter(TestRouter):
}) })
self.assertEqual(self.columns, columns) self.assertEqual(self.columns, columns)
self.assertItemEqual(self.data, data) self.assertItemsEqual(self.data, data)
def _test_create_with_tag(self, add_tags=True): def _test_create_with_tag(self, add_tags=True):
arglist = [self.new_router.name] arglist = [self.new_router.name]
@ -301,7 +301,7 @@ class TestCreateRouter(TestRouter):
else: else:
self.assertFalse(self.network.set_tags.called) self.assertFalse(self.network.set_tags.called)
self.assertEqual(self.columns, columns) self.assertEqual(self.columns, columns)
self.assertItemEqual(self.data, data) self.assertItemsEqual(self.data, data)
def test_create_with_tags(self): def test_create_with_tags(self):
self._test_create_with_tag(add_tags=True) self._test_create_with_tag(add_tags=True)
@ -494,7 +494,7 @@ class TestListRouter(TestRouter):
self.network.routers.assert_called_once_with() self.network.routers.assert_called_once_with()
self.assertEqual(self.columns, columns) self.assertEqual(self.columns, columns)
self.assertListItemEqual(self.data, list(data)) self.assertItemsEqual(self.data, list(data))
def test_router_list_no_ha_no_distributed(self): def test_router_list_no_ha_no_distributed(self):
_routers = network_fakes.FakeRouter.create_routers({ _routers = network_fakes.FakeRouter.create_routers({
@ -531,7 +531,7 @@ class TestListRouter(TestRouter):
self.network.routers.assert_called_once_with() self.network.routers.assert_called_once_with()
self.assertEqual(self.columns_long, columns) self.assertEqual(self.columns_long, columns)
self.assertListItemEqual(self.data_long, list(data)) self.assertItemsEqual(self.data_long, list(data))
def test_router_list_long_no_az(self): def test_router_list_long_no_az(self):
arglist = [ arglist = [
@ -552,7 +552,7 @@ class TestListRouter(TestRouter):
self.network.routers.assert_called_once_with() self.network.routers.assert_called_once_with()
self.assertEqual(self.columns_long_no_az, columns) self.assertEqual(self.columns_long_no_az, columns)
self.assertListItemEqual(self.data_long_no_az, list(data)) self.assertItemsEqual(self.data_long_no_az, list(data))
def test_list_name(self): def test_list_name(self):
test_name = "fakename" test_name = "fakename"
@ -570,7 +570,7 @@ class TestListRouter(TestRouter):
**{'name': test_name} **{'name': test_name}
) )
self.assertEqual(self.columns, columns) self.assertEqual(self.columns, columns)
self.assertListItemEqual(self.data, list(data)) self.assertItemsEqual(self.data, list(data))
def test_router_list_enable(self): def test_router_list_enable(self):
arglist = [ arglist = [
@ -587,7 +587,7 @@ class TestListRouter(TestRouter):
**{'admin_state_up': True, 'is_admin_state_up': True} **{'admin_state_up': True, 'is_admin_state_up': True}
) )
self.assertEqual(self.columns, columns) self.assertEqual(self.columns, columns)
self.assertListItemEqual(self.data, list(data)) self.assertItemsEqual(self.data, list(data))
def test_router_list_disable(self): def test_router_list_disable(self):
arglist = [ arglist = [
@ -605,7 +605,7 @@ class TestListRouter(TestRouter):
) )
self.assertEqual(self.columns, columns) self.assertEqual(self.columns, columns)
self.assertListItemEqual(self.data, list(data)) self.assertItemsEqual(self.data, list(data))
def test_router_list_project(self): def test_router_list_project(self):
project = identity_fakes_v3.FakeProject.create_one_project() project = identity_fakes_v3.FakeProject.create_one_project()
@ -623,7 +623,7 @@ class TestListRouter(TestRouter):
self.network.routers.assert_called_once_with(**filters) self.network.routers.assert_called_once_with(**filters)
self.assertEqual(self.columns, columns) self.assertEqual(self.columns, columns)
self.assertListItemEqual(self.data, list(data)) self.assertItemsEqual(self.data, list(data))
def test_router_list_project_domain(self): def test_router_list_project_domain(self):
project = identity_fakes_v3.FakeProject.create_one_project() project = identity_fakes_v3.FakeProject.create_one_project()
@ -643,7 +643,7 @@ class TestListRouter(TestRouter):
self.network.routers.assert_called_once_with(**filters) self.network.routers.assert_called_once_with(**filters)
self.assertEqual(self.columns, columns) self.assertEqual(self.columns, columns)
self.assertListItemEqual(self.data, list(data)) self.assertItemsEqual(self.data, list(data))
def test_router_list_agents_no_args(self): def test_router_list_agents_no_args(self):
arglist = [ arglist = [
@ -671,7 +671,7 @@ class TestListRouter(TestRouter):
self.network.agent_hosted_routers( self.network.agent_hosted_routers(
*attrs) *attrs)
self.assertEqual(self.columns, columns) self.assertEqual(self.columns, columns)
self.assertListItemEqual(self.data, list(data)) self.assertItemsEqual(self.data, list(data))
def test_list_with_tag_options(self): def test_list_with_tag_options(self):
arglist = [ arglist = [
@ -696,7 +696,7 @@ class TestListRouter(TestRouter):
'not_any_tags': 'black,white'} 'not_any_tags': 'black,white'}
) )
self.assertEqual(self.columns, columns) self.assertEqual(self.columns, columns)
self.assertListItemEqual(self.data, list(data)) self.assertItemsEqual(self.data, list(data))
class TestRemovePortFromRouter(TestRouter): class TestRemovePortFromRouter(TestRouter):
@ -1403,7 +1403,7 @@ class TestShowRouter(TestRouter):
'device_id': self._router.id 'device_id': self._router.id
}) })
self.assertEqual(self.columns, columns) self.assertEqual(self.columns, columns)
self.assertItemEqual(self.data, data) self.assertItemsEqual(self.data, data)
def test_show_no_ha_no_distributed(self): def test_show_no_ha_no_distributed(self):
_router = network_fakes.FakeRouter.create_one_router({ _router = network_fakes.FakeRouter.create_one_router({

View File

@ -88,7 +88,7 @@ class TestCreateSecurityGroupCompute(TestSecurityGroupCompute):
self._security_group['name'], self._security_group['name'],
) )
self.assertEqual(self.columns, columns) self.assertEqual(self.columns, columns)
self.assertItemEqual(self.data, data) self.assertItemsEqual(self.data, data)
def test_security_group_create_all_options(self, sg_mock): def test_security_group_create_all_options(self, sg_mock):
sg_mock.return_value = self._security_group sg_mock.return_value = self._security_group
@ -109,7 +109,7 @@ class TestCreateSecurityGroupCompute(TestSecurityGroupCompute):
self._security_group['description'], self._security_group['description'],
) )
self.assertEqual(self.columns, columns) self.assertEqual(self.columns, columns)
self.assertItemEqual(self.data, data) self.assertItemsEqual(self.data, data)
@mock.patch( @mock.patch(
@ -255,7 +255,7 @@ class TestListSecurityGroupCompute(TestSecurityGroupCompute):
kwargs = {'search_opts': {'all_tenants': False}} kwargs = {'search_opts': {'all_tenants': False}}
sg_mock.assert_called_once_with(**kwargs) sg_mock.assert_called_once_with(**kwargs)
self.assertEqual(self.columns, columns) self.assertEqual(self.columns, columns)
self.assertListItemEqual(self.data, list(data)) self.assertItemsEqual(self.data, list(data))
def test_security_group_list_all_projects(self, sg_mock): def test_security_group_list_all_projects(self, sg_mock):
sg_mock.return_value = self._security_groups sg_mock.return_value = self._security_groups
@ -272,7 +272,7 @@ class TestListSecurityGroupCompute(TestSecurityGroupCompute):
kwargs = {'search_opts': {'all_tenants': True}} kwargs = {'search_opts': {'all_tenants': True}}
sg_mock.assert_called_once_with(**kwargs) sg_mock.assert_called_once_with(**kwargs)
self.assertEqual(self.columns_all_projects, columns) self.assertEqual(self.columns_all_projects, columns)
self.assertListItemEqual(self.data_all_projects, list(data)) self.assertItemsEqual(self.data_all_projects, list(data))
@mock.patch( @mock.patch(
@ -401,4 +401,4 @@ class TestShowSecurityGroupCompute(TestSecurityGroupCompute):
sg_mock.assert_called_once_with(self._security_group['id']) sg_mock.assert_called_once_with(self._security_group['id'])
self.assertEqual(self.columns, columns) self.assertEqual(self.columns, columns)
self.assertItemEqual(self.data, data) self.assertItemsEqual(self.data, data)

View File

@ -96,7 +96,7 @@ class TestCreateSecurityGroupNetwork(TestSecurityGroupNetwork):
'name': self._security_group.name, 'name': self._security_group.name,
}) })
self.assertEqual(self.columns, columns) self.assertEqual(self.columns, columns)
self.assertItemEqual(self.data, data) self.assertItemsEqual(self.data, data)
def test_create_all_options(self): def test_create_all_options(self):
arglist = [ arglist = [
@ -124,7 +124,7 @@ class TestCreateSecurityGroupNetwork(TestSecurityGroupNetwork):
'tenant_id': self.project.id, 'tenant_id': self.project.id,
}) })
self.assertEqual(self.columns, columns) self.assertEqual(self.columns, columns)
self.assertItemEqual(self.data, data) self.assertItemsEqual(self.data, data)
def _test_create_with_tag(self, add_tags=True): def _test_create_with_tag(self, add_tags=True):
arglist = [self._security_group.name] arglist = [self._security_group.name]
@ -155,7 +155,7 @@ class TestCreateSecurityGroupNetwork(TestSecurityGroupNetwork):
else: else:
self.assertFalse(self.network.set_tags.called) self.assertFalse(self.network.set_tags.called)
self.assertEqual(self.columns, columns) self.assertEqual(self.columns, columns)
self.assertItemEqual(self.data, data) self.assertItemsEqual(self.data, data)
def test_create_with_tags(self): def test_create_with_tags(self):
self._test_create_with_tag(add_tags=True) self._test_create_with_tag(add_tags=True)
@ -293,7 +293,7 @@ class TestListSecurityGroupNetwork(TestSecurityGroupNetwork):
self.network.security_groups.assert_called_once_with( self.network.security_groups.assert_called_once_with(
fields=security_group.ListSecurityGroup.FIELDS_TO_RETRIEVE) fields=security_group.ListSecurityGroup.FIELDS_TO_RETRIEVE)
self.assertEqual(self.columns, columns) self.assertEqual(self.columns, columns)
self.assertListItemEqual(self.data, list(data)) self.assertItemsEqual(self.data, list(data))
def test_security_group_list_all_projects(self): def test_security_group_list_all_projects(self):
arglist = [ arglist = [
@ -309,7 +309,7 @@ class TestListSecurityGroupNetwork(TestSecurityGroupNetwork):
self.network.security_groups.assert_called_once_with( self.network.security_groups.assert_called_once_with(
fields=security_group.ListSecurityGroup.FIELDS_TO_RETRIEVE) fields=security_group.ListSecurityGroup.FIELDS_TO_RETRIEVE)
self.assertEqual(self.columns, columns) self.assertEqual(self.columns, columns)
self.assertListItemEqual(self.data, list(data)) self.assertItemsEqual(self.data, list(data))
def test_security_group_list_project(self): def test_security_group_list_project(self):
project = identity_fakes.FakeProject.create_one_project() project = identity_fakes.FakeProject.create_one_project()
@ -329,7 +329,7 @@ class TestListSecurityGroupNetwork(TestSecurityGroupNetwork):
self.network.security_groups.assert_called_once_with(**filters) self.network.security_groups.assert_called_once_with(**filters)
self.assertEqual(self.columns, columns) self.assertEqual(self.columns, columns)
self.assertListItemEqual(self.data, list(data)) self.assertItemsEqual(self.data, list(data))
def test_security_group_list_project_domain(self): def test_security_group_list_project_domain(self):
project = identity_fakes.FakeProject.create_one_project() project = identity_fakes.FakeProject.create_one_project()
@ -351,7 +351,7 @@ class TestListSecurityGroupNetwork(TestSecurityGroupNetwork):
self.network.security_groups.assert_called_once_with(**filters) self.network.security_groups.assert_called_once_with(**filters)
self.assertEqual(self.columns, columns) self.assertEqual(self.columns, columns)
self.assertListItemEqual(self.data, list(data)) self.assertItemsEqual(self.data, list(data))
def test_list_with_tag_options(self): def test_list_with_tag_options(self):
arglist = [ arglist = [
@ -539,7 +539,7 @@ class TestShowSecurityGroupNetwork(TestSecurityGroupNetwork):
self.network.find_security_group.assert_called_once_with( self.network.find_security_group.assert_called_once_with(
self._security_group.id, ignore_missing=False) self._security_group.id, ignore_missing=False)
self.assertEqual(self.columns, columns) self.assertEqual(self.columns, columns)
self.assertItemEqual(self.data, data) self.assertItemsEqual(self.data, data)
class TestUnsetSecurityGroupNetwork(TestSecurityGroupNetwork): class TestUnsetSecurityGroupNetwork(TestSecurityGroupNetwork):

View File

@ -255,7 +255,7 @@ class TestCreateSubnet(TestSubnet):
}) })
self.assertFalse(self.network.set_tags.called) self.assertFalse(self.network.set_tags.called)
self.assertEqual(self.columns, columns) self.assertEqual(self.columns, columns)
self.assertItemEqual(self.data, data) self.assertItemsEqual(self.data, data)
def test_create_from_subnet_pool_options(self): def test_create_from_subnet_pool_options(self):
# Mock SDK calls for this test. # Mock SDK calls for this test.
@ -317,7 +317,7 @@ class TestCreateSubnet(TestSubnet):
'service_types': self._subnet_from_pool.service_types, 'service_types': self._subnet_from_pool.service_types,
}) })
self.assertEqual(self.columns, columns) self.assertEqual(self.columns, columns)
self.assertItemEqual(self.data_subnet_pool, data) self.assertItemsEqual(self.data_subnet_pool, data)
def test_create_options_subnet_range_ipv6(self): def test_create_options_subnet_range_ipv6(self):
# Mock SDK calls for this test. # Mock SDK calls for this test.
@ -390,7 +390,7 @@ class TestCreateSubnet(TestSubnet):
}) })
self.assertFalse(self.network.set_tags.called) self.assertFalse(self.network.set_tags.called)
self.assertEqual(self.columns, columns) self.assertEqual(self.columns, columns)
self.assertItemEqual(self.data_ipv6, data) self.assertItemsEqual(self.data_ipv6, data)
def test_create_with_network_segment(self): def test_create_with_network_segment(self):
# Mock SDK calls for this test. # Mock SDK calls for this test.
@ -424,7 +424,7 @@ class TestCreateSubnet(TestSubnet):
}) })
self.assertFalse(self.network.set_tags.called) self.assertFalse(self.network.set_tags.called)
self.assertEqual(self.columns, columns) self.assertEqual(self.columns, columns)
self.assertItemEqual(self.data, data) self.assertItemsEqual(self.data, data)
def test_create_with_description(self): def test_create_with_description(self):
# Mock SDK calls for this test. # Mock SDK calls for this test.
@ -458,7 +458,7 @@ class TestCreateSubnet(TestSubnet):
}) })
self.assertFalse(self.network.set_tags.called) self.assertFalse(self.network.set_tags.called)
self.assertEqual(self.columns, columns) self.assertEqual(self.columns, columns)
self.assertItemEqual(self.data, data) self.assertItemsEqual(self.data, data)
def _test_create_with_dns(self, publish_dns=True): def _test_create_with_dns(self, publish_dns=True):
arglist = [ arglist = [
@ -490,7 +490,7 @@ class TestCreateSubnet(TestSubnet):
dns_publish_fixed_ip=publish_dns, dns_publish_fixed_ip=publish_dns,
) )
self.assertEqual(self.columns, columns) self.assertEqual(self.columns, columns)
self.assertItemEqual(self.data, data) self.assertItemsEqual(self.data, data)
def test_create_with_dns(self): def test_create_with_dns(self):
self._test_create_with_dns(publish_dns=True) self._test_create_with_dns(publish_dns=True)
@ -535,7 +535,7 @@ class TestCreateSubnet(TestSubnet):
else: else:
self.assertFalse(self.network.set_tags.called) self.assertFalse(self.network.set_tags.called)
self.assertEqual(self.columns, columns) self.assertEqual(self.columns, columns)
self.assertItemEqual(self.data, data) self.assertItemsEqual(self.data, data)
def test_create_with_tags(self): def test_create_with_tags(self):
self._test_create_with_tag(add_tags=True) self._test_create_with_tag(add_tags=True)
@ -691,7 +691,7 @@ class TestListSubnet(TestSubnet):
self.network.subnets.assert_called_once_with() self.network.subnets.assert_called_once_with()
self.assertEqual(self.columns, columns) self.assertEqual(self.columns, columns)
self.assertListItemEqual(self.data, list(data)) self.assertItemsEqual(self.data, list(data))
def test_subnet_list_long(self): def test_subnet_list_long(self):
arglist = [ arglist = [
@ -706,7 +706,7 @@ class TestListSubnet(TestSubnet):
self.network.subnets.assert_called_once_with() self.network.subnets.assert_called_once_with()
self.assertEqual(self.columns_long, columns) self.assertEqual(self.columns_long, columns)
self.assertListItemEqual(self.data_long, list(data)) self.assertItemsEqual(self.data_long, list(data))
def test_subnet_list_ip_version(self): def test_subnet_list_ip_version(self):
arglist = [ arglist = [
@ -722,7 +722,7 @@ class TestListSubnet(TestSubnet):
self.network.subnets.assert_called_once_with(**filters) self.network.subnets.assert_called_once_with(**filters)
self.assertEqual(self.columns, columns) self.assertEqual(self.columns, columns)
self.assertListItemEqual(self.data, list(data)) self.assertItemsEqual(self.data, list(data))
def test_subnet_list_dhcp(self): def test_subnet_list_dhcp(self):
arglist = [ arglist = [
@ -738,7 +738,7 @@ class TestListSubnet(TestSubnet):
self.network.subnets.assert_called_once_with(**filters) self.network.subnets.assert_called_once_with(**filters)
self.assertEqual(self.columns, columns) self.assertEqual(self.columns, columns)
self.assertListItemEqual(self.data, list(data)) self.assertItemsEqual(self.data, list(data))
def test_subnet_list_no_dhcp(self): def test_subnet_list_no_dhcp(self):
arglist = [ arglist = [
@ -754,7 +754,7 @@ class TestListSubnet(TestSubnet):
self.network.subnets.assert_called_once_with(**filters) self.network.subnets.assert_called_once_with(**filters)
self.assertEqual(self.columns, columns) self.assertEqual(self.columns, columns)
self.assertListItemEqual(self.data, list(data)) self.assertItemsEqual(self.data, list(data))
def test_subnet_list_service_type(self): def test_subnet_list_service_type(self):
arglist = [ arglist = [
@ -769,7 +769,7 @@ class TestListSubnet(TestSubnet):
self.network.subnets.assert_called_once_with(**filters) self.network.subnets.assert_called_once_with(**filters)
self.assertEqual(self.columns, columns) self.assertEqual(self.columns, columns)
self.assertListItemEqual(self.data, list(data)) self.assertItemsEqual(self.data, list(data))
def test_subnet_list_project(self): def test_subnet_list_project(self):
project = identity_fakes_v3.FakeProject.create_one_project() project = identity_fakes_v3.FakeProject.create_one_project()
@ -787,7 +787,7 @@ class TestListSubnet(TestSubnet):
self.network.subnets.assert_called_once_with(**filters) self.network.subnets.assert_called_once_with(**filters)
self.assertEqual(self.columns, columns) self.assertEqual(self.columns, columns)
self.assertListItemEqual(self.data, list(data)) self.assertItemsEqual(self.data, list(data))
def test_subnet_list_service_type_multiple(self): def test_subnet_list_service_type_multiple(self):
arglist = [ arglist = [
@ -805,7 +805,7 @@ class TestListSubnet(TestSubnet):
'network:floatingip_agent_gateway']} 'network:floatingip_agent_gateway']}
self.network.subnets.assert_called_once_with(**filters) self.network.subnets.assert_called_once_with(**filters)
self.assertEqual(self.columns, columns) self.assertEqual(self.columns, columns)
self.assertListItemEqual(self.data, list(data)) self.assertItemsEqual(self.data, list(data))
def test_subnet_list_project_domain(self): def test_subnet_list_project_domain(self):
project = identity_fakes_v3.FakeProject.create_one_project() project = identity_fakes_v3.FakeProject.create_one_project()
@ -825,7 +825,7 @@ class TestListSubnet(TestSubnet):
self.network.subnets.assert_called_once_with(**filters) self.network.subnets.assert_called_once_with(**filters)
self.assertEqual(self.columns, columns) self.assertEqual(self.columns, columns)
self.assertListItemEqual(self.data, list(data)) self.assertItemsEqual(self.data, list(data))
def test_subnet_list_network(self): def test_subnet_list_network(self):
network = network_fakes.FakeNetwork.create_one_network() network = network_fakes.FakeNetwork.create_one_network()
@ -843,7 +843,7 @@ class TestListSubnet(TestSubnet):
self.network.subnets.assert_called_once_with(**filters) self.network.subnets.assert_called_once_with(**filters)
self.assertEqual(self.columns, columns) self.assertEqual(self.columns, columns)
self.assertListItemEqual(self.data, list(data)) self.assertItemsEqual(self.data, list(data))
def test_subnet_list_gateway(self): def test_subnet_list_gateway(self):
subnet = network_fakes.FakeSubnet.create_one_subnet() subnet = network_fakes.FakeSubnet.create_one_subnet()
@ -861,7 +861,7 @@ class TestListSubnet(TestSubnet):
self.network.subnets.assert_called_once_with(**filters) self.network.subnets.assert_called_once_with(**filters)
self.assertEqual(self.columns, columns) self.assertEqual(self.columns, columns)
self.assertListItemEqual(self.data, list(data)) self.assertItemsEqual(self.data, list(data))
def test_subnet_list_name(self): def test_subnet_list_name(self):
subnet = network_fakes.FakeSubnet.create_one_subnet() subnet = network_fakes.FakeSubnet.create_one_subnet()
@ -879,7 +879,7 @@ class TestListSubnet(TestSubnet):
self.network.subnets.assert_called_once_with(**filters) self.network.subnets.assert_called_once_with(**filters)
self.assertEqual(self.columns, columns) self.assertEqual(self.columns, columns)
self.assertListItemEqual(self.data, list(data)) self.assertItemsEqual(self.data, list(data))
def test_subnet_list_subnet_range(self): def test_subnet_list_subnet_range(self):
subnet = network_fakes.FakeSubnet.create_one_subnet() subnet = network_fakes.FakeSubnet.create_one_subnet()
@ -897,7 +897,7 @@ class TestListSubnet(TestSubnet):
self.network.subnets.assert_called_once_with(**filters) self.network.subnets.assert_called_once_with(**filters)
self.assertEqual(self.columns, columns) self.assertEqual(self.columns, columns)
self.assertListItemEqual(self.data, list(data)) self.assertItemsEqual(self.data, list(data))
def test_list_with_tag_options(self): def test_list_with_tag_options(self):
arglist = [ arglist = [
@ -1244,7 +1244,7 @@ class TestShowSubnet(TestSubnet):
self._subnet.name, ignore_missing=False) self._subnet.name, ignore_missing=False)
self.assertEqual(self.columns, columns) self.assertEqual(self.columns, columns)
self.assertItemEqual(self.data, data) self.assertItemsEqual(self.data, data)
class TestUnsetSubnet(TestSubnet): class TestUnsetSubnet(TestSubnet):

View File

@ -133,7 +133,7 @@ class TestCreateSubnetPool(TestSubnetPool):
}) })
self.assertFalse(self.network.set_tags.called) self.assertFalse(self.network.set_tags.called)
self.assertEqual(self.columns, columns) self.assertEqual(self.columns, columns)
self.assertItemEqual(self.data, data) self.assertItemsEqual(self.data, data)
def test_create_prefixlen_options(self): def test_create_prefixlen_options(self):
arglist = [ arglist = [
@ -163,7 +163,7 @@ class TestCreateSubnetPool(TestSubnetPool):
'name': self._subnet_pool.name, 'name': self._subnet_pool.name,
}) })
self.assertEqual(self.columns, columns) self.assertEqual(self.columns, columns)
self.assertItemEqual(self.data, data) self.assertItemsEqual(self.data, data)
def test_create_len_negative(self): def test_create_len_negative(self):
arglist = [ arglist = [
@ -201,7 +201,7 @@ class TestCreateSubnetPool(TestSubnetPool):
'name': self._subnet_pool.name, 'name': self._subnet_pool.name,
}) })
self.assertEqual(self.columns, columns) self.assertEqual(self.columns, columns)
self.assertItemEqual(self.data, data) self.assertItemsEqual(self.data, data)
def test_create_address_scope_option(self): def test_create_address_scope_option(self):
arglist = [ arglist = [
@ -224,7 +224,7 @@ class TestCreateSubnetPool(TestSubnetPool):
'name': self._subnet_pool.name, 'name': self._subnet_pool.name,
}) })
self.assertEqual(self.columns, columns) self.assertEqual(self.columns, columns)
self.assertItemEqual(self.data, data) self.assertItemsEqual(self.data, data)
def test_create_default_and_shared_options(self): def test_create_default_and_shared_options(self):
arglist = [ arglist = [
@ -250,7 +250,7 @@ class TestCreateSubnetPool(TestSubnetPool):
'shared': True, 'shared': True,
}) })
self.assertEqual(self.columns, columns) self.assertEqual(self.columns, columns)
self.assertItemEqual(self.data, data) self.assertItemsEqual(self.data, data)
def test_create_with_description(self): def test_create_with_description(self):
arglist = [ arglist = [
@ -273,7 +273,7 @@ class TestCreateSubnetPool(TestSubnetPool):
'description': self._subnet_pool.description, 'description': self._subnet_pool.description,
}) })
self.assertEqual(self.columns, columns) self.assertEqual(self.columns, columns)
self.assertItemEqual(self.data, data) self.assertItemsEqual(self.data, data)
def test_create_with_default_quota(self): def test_create_with_default_quota(self):
arglist = [ arglist = [
@ -294,7 +294,7 @@ class TestCreateSubnetPool(TestSubnetPool):
'default_quota': 10, 'default_quota': 10,
}) })
self.assertEqual(self.columns, columns) self.assertEqual(self.columns, columns)
self.assertItemEqual(self.data, data) self.assertItemsEqual(self.data, data)
def _test_create_with_tag(self, add_tags=True): def _test_create_with_tag(self, add_tags=True):
arglist = [ arglist = [
@ -328,7 +328,7 @@ class TestCreateSubnetPool(TestSubnetPool):
else: else:
self.assertFalse(self.network.set_tags.called) self.assertFalse(self.network.set_tags.called)
self.assertEqual(self.columns, columns) self.assertEqual(self.columns, columns)
self.assertItemEqual(self.data, data) self.assertItemsEqual(self.data, data)
def test_create_with_tags(self): def test_create_with_tags(self):
self._test_create_with_tag(add_tags=True) self._test_create_with_tag(add_tags=True)
@ -476,7 +476,7 @@ class TestListSubnetPool(TestSubnetPool):
self.network.subnet_pools.assert_called_once_with() self.network.subnet_pools.assert_called_once_with()
self.assertEqual(self.columns, columns) self.assertEqual(self.columns, columns)
self.assertListItemEqual(self.data, list(data)) self.assertItemsEqual(self.data, list(data))
def test_subnet_pool_list_long(self): def test_subnet_pool_list_long(self):
arglist = [ arglist = [
@ -491,7 +491,7 @@ class TestListSubnetPool(TestSubnetPool):
self.network.subnet_pools.assert_called_once_with() self.network.subnet_pools.assert_called_once_with()
self.assertEqual(self.columns_long, columns) self.assertEqual(self.columns_long, columns)
self.assertListItemEqual(self.data_long, list(data)) self.assertItemsEqual(self.data_long, list(data))
def test_subnet_pool_list_no_share(self): def test_subnet_pool_list_no_share(self):
arglist = [ arglist = [
@ -507,7 +507,7 @@ class TestListSubnetPool(TestSubnetPool):
self.network.subnet_pools.assert_called_once_with(**filters) self.network.subnet_pools.assert_called_once_with(**filters)
self.assertEqual(self.columns, columns) self.assertEqual(self.columns, columns)
self.assertListItemEqual(self.data, list(data)) self.assertItemsEqual(self.data, list(data))
def test_subnet_pool_list_share(self): def test_subnet_pool_list_share(self):
arglist = [ arglist = [
@ -523,7 +523,7 @@ class TestListSubnetPool(TestSubnetPool):
self.network.subnet_pools.assert_called_once_with(**filters) self.network.subnet_pools.assert_called_once_with(**filters)
self.assertEqual(self.columns, columns) self.assertEqual(self.columns, columns)
self.assertListItemEqual(self.data, list(data)) self.assertItemsEqual(self.data, list(data))
def test_subnet_pool_list_no_default(self): def test_subnet_pool_list_no_default(self):
arglist = [ arglist = [
@ -539,7 +539,7 @@ class TestListSubnetPool(TestSubnetPool):
self.network.subnet_pools.assert_called_once_with(**filters) self.network.subnet_pools.assert_called_once_with(**filters)
self.assertEqual(self.columns, columns) self.assertEqual(self.columns, columns)
self.assertListItemEqual(self.data, list(data)) self.assertItemsEqual(self.data, list(data))
def test_subnet_pool_list_default(self): def test_subnet_pool_list_default(self):
arglist = [ arglist = [
@ -555,7 +555,7 @@ class TestListSubnetPool(TestSubnetPool):
self.network.subnet_pools.assert_called_once_with(**filters) self.network.subnet_pools.assert_called_once_with(**filters)
self.assertEqual(self.columns, columns) self.assertEqual(self.columns, columns)
self.assertListItemEqual(self.data, list(data)) self.assertItemsEqual(self.data, list(data))
def test_subnet_pool_list_project(self): def test_subnet_pool_list_project(self):
project = identity_fakes_v3.FakeProject.create_one_project() project = identity_fakes_v3.FakeProject.create_one_project()
@ -573,7 +573,7 @@ class TestListSubnetPool(TestSubnetPool):
self.network.subnet_pools.assert_called_once_with(**filters) self.network.subnet_pools.assert_called_once_with(**filters)
self.assertEqual(self.columns, columns) self.assertEqual(self.columns, columns)
self.assertListItemEqual(self.data, list(data)) self.assertItemsEqual(self.data, list(data))
def test_subnet_pool_list_project_domain(self): def test_subnet_pool_list_project_domain(self):
project = identity_fakes_v3.FakeProject.create_one_project() project = identity_fakes_v3.FakeProject.create_one_project()
@ -593,7 +593,7 @@ class TestListSubnetPool(TestSubnetPool):
self.network.subnet_pools.assert_called_once_with(**filters) self.network.subnet_pools.assert_called_once_with(**filters)
self.assertEqual(self.columns, columns) self.assertEqual(self.columns, columns)
self.assertListItemEqual(self.data, list(data)) self.assertItemsEqual(self.data, list(data))
def test_subnet_pool_list_name(self): def test_subnet_pool_list_name(self):
subnet_pool = network_fakes.FakeSubnetPool.create_one_subnet_pool() subnet_pool = network_fakes.FakeSubnetPool.create_one_subnet_pool()
@ -611,7 +611,7 @@ class TestListSubnetPool(TestSubnetPool):
self.network.subnet_pools.assert_called_once_with(**filters) self.network.subnet_pools.assert_called_once_with(**filters)
self.assertEqual(self.columns, columns) self.assertEqual(self.columns, columns)
self.assertListItemEqual(self.data, list(data)) self.assertItemsEqual(self.data, list(data))
def test_subnet_pool_list_address_scope(self): def test_subnet_pool_list_address_scope(self):
addr_scope = network_fakes.FakeAddressScope.create_one_address_scope() addr_scope = network_fakes.FakeAddressScope.create_one_address_scope()
@ -629,7 +629,7 @@ class TestListSubnetPool(TestSubnetPool):
self.network.subnet_pools.assert_called_once_with(**filters) self.network.subnet_pools.assert_called_once_with(**filters)
self.assertEqual(self.columns, columns) self.assertEqual(self.columns, columns)
self.assertListItemEqual(self.data, list(data)) self.assertItemsEqual(self.data, list(data))
def test_list_with_tag_options(self): def test_list_with_tag_options(self):
arglist = [ arglist = [
@ -654,7 +654,7 @@ class TestListSubnetPool(TestSubnetPool):
'not_any_tags': 'black,white'} 'not_any_tags': 'black,white'}
) )
self.assertEqual(self.columns, columns) self.assertEqual(self.columns, columns)
self.assertListItemEqual(self.data, list(data)) self.assertItemsEqual(self.data, list(data))
class TestSetSubnetPool(TestSubnetPool): class TestSetSubnetPool(TestSubnetPool):
@ -1008,7 +1008,7 @@ class TestShowSubnetPool(TestSubnetPool):
ignore_missing=False ignore_missing=False
) )
self.assertEqual(self.columns, columns) self.assertEqual(self.columns, columns)
self.assertItemEqual(self.data, data) self.assertItemsEqual(self.data, data)
class TestUnsetSubnetPool(TestSubnetPool): class TestUnsetSubnetPool(TestSubnetPool):

View File

@ -17,7 +17,6 @@
from io import StringIO from io import StringIO
import os import os
from cliff import columns as cliff_columns
import fixtures import fixtures
import testtools import testtools
@ -85,18 +84,3 @@ class TestCommand(TestCase):
self.assertIn(attr, parsed_args) self.assertIn(attr, parsed_args)
self.assertEqual(value, getattr(parsed_args, attr)) self.assertEqual(value, getattr(parsed_args, attr))
return parsed_args return parsed_args
def assertListItemEqual(self, expected, actual):
self.assertEqual(len(expected), len(actual))
for item_expected, item_actual in zip(expected, actual):
self.assertItemEqual(item_expected, item_actual)
def assertItemEqual(self, expected, actual):
self.assertEqual(len(expected), len(actual))
for col_expected, col_actual in zip(expected, actual):
if isinstance(col_expected, cliff_columns.FormattableColumn):
self.assertIsInstance(col_actual, col_expected.__class__)
self.assertEqual(col_expected.human_readable(),
col_actual.human_readable())
else:
self.assertEqual(col_expected, col_actual)

View File

@ -109,7 +109,7 @@ class TestQosCreate(TestQos):
) )
self.assertEqual(self.columns, columns) self.assertEqual(self.columns, columns)
self.assertItemEqual(self.datalist, data) self.assertItemsEqual(self.datalist, data)
def test_qos_create_with_consumer(self): def test_qos_create_with_consumer(self):
arglist = [ arglist = [
@ -129,7 +129,7 @@ class TestQosCreate(TestQos):
{'consumer': self.new_qos_spec.consumer} {'consumer': self.new_qos_spec.consumer}
) )
self.assertEqual(self.columns, columns) self.assertEqual(self.columns, columns)
self.assertItemEqual(self.datalist, data) self.assertItemsEqual(self.datalist, data)
def test_qos_create_with_properties(self): def test_qos_create_with_properties(self):
arglist = [ arglist = [
@ -155,7 +155,7 @@ class TestQosCreate(TestQos):
) )
self.assertEqual(self.columns, columns) self.assertEqual(self.columns, columns)
self.assertItemEqual(self.datalist, data) self.assertItemsEqual(self.datalist, data)
class TestQosDelete(TestQos): class TestQosDelete(TestQos):
@ -350,7 +350,7 @@ class TestQosList(TestQos):
self.qos_mock.list.assert_called_with() self.qos_mock.list.assert_called_with()
self.assertEqual(self.columns, columns) self.assertEqual(self.columns, columns)
self.assertListItemEqual(self.data, list(data)) self.assertItemsEqual(self.data, list(data))
def test_qos_list_no_association(self): def test_qos_list_no_association(self):
self.qos_mock.reset_mock() self.qos_mock.reset_mock()
@ -377,7 +377,7 @@ class TestQosList(TestQos):
format_columns.ListColumn(None), format_columns.ListColumn(None),
format_columns.DictColumn(self.qos_specs[1].specs), format_columns.DictColumn(self.qos_specs[1].specs),
) )
self.assertListItemEqual(ex_data, list(data)) self.assertItemsEqual(ex_data, list(data))
class TestQosSet(TestQos): class TestQosSet(TestQos):
@ -454,7 +454,7 @@ class TestQosShow(TestQos):
self.qos_spec.name, self.qos_spec.name,
format_columns.DictColumn(self.qos_spec.specs), format_columns.DictColumn(self.qos_spec.specs),
) )
self.assertItemEqual(datalist, tuple(data)) self.assertItemsEqual(datalist, tuple(data))
class TestQosUnset(TestQos): class TestQosUnset(TestQos):

View File

@ -78,7 +78,7 @@ class TestTypeCreate(TestType):
) )
self.assertEqual(self.columns, columns) self.assertEqual(self.columns, columns)
self.assertItemEqual(self.data, data) self.assertItemsEqual(self.data, data)
def test_type_create_with_encryption(self): def test_type_create_with_encryption(self):
encryption_info = { encryption_info = {
@ -139,7 +139,7 @@ class TestTypeCreate(TestType):
body, body,
) )
self.assertEqual(encryption_columns, columns) self.assertEqual(encryption_columns, columns)
self.assertItemEqual(encryption_data, data) self.assertItemsEqual(encryption_data, data)
class TestTypeDelete(TestType): class TestTypeDelete(TestType):
@ -270,7 +270,7 @@ class TestTypeList(TestType):
columns, data = self.cmd.take_action(parsed_args) columns, data = self.cmd.take_action(parsed_args)
self.types_mock.list.assert_called_once_with() self.types_mock.list.assert_called_once_with()
self.assertEqual(self.columns, columns) self.assertEqual(self.columns, columns)
self.assertListItemEqual(self.data, list(data)) self.assertItemsEqual(self.data, list(data))
def test_type_list_with_options(self): def test_type_list_with_options(self):
arglist = [ arglist = [
@ -284,7 +284,7 @@ class TestTypeList(TestType):
columns, data = self.cmd.take_action(parsed_args) columns, data = self.cmd.take_action(parsed_args)
self.types_mock.list.assert_called_once_with() self.types_mock.list.assert_called_once_with()
self.assertEqual(self.columns_long, columns) self.assertEqual(self.columns_long, columns)
self.assertListItemEqual(self.data_long, list(data)) self.assertItemsEqual(self.data_long, list(data))
def test_type_list_with_encryption(self): def test_type_list_with_encryption(self):
encryption_type = volume_fakes.FakeType.create_one_encryption_type( encryption_type = volume_fakes.FakeType.create_one_encryption_type(
@ -328,7 +328,7 @@ class TestTypeList(TestType):
self.encryption_types_mock.list.assert_called_once_with() self.encryption_types_mock.list.assert_called_once_with()
self.types_mock.list.assert_called_once_with() self.types_mock.list.assert_called_once_with()
self.assertEqual(encryption_columns, columns) self.assertEqual(encryption_columns, columns)
self.assertListItemEqual(encryption_data, list(data)) self.assertItemsEqual(encryption_data, list(data))
class TestTypeSet(TestType): class TestTypeSet(TestType):
@ -469,7 +469,7 @@ class TestTypeShow(TestType):
self.types_mock.get.assert_called_with(self.volume_type.id) self.types_mock.get.assert_called_with(self.volume_type.id)
self.assertEqual(self.columns, columns) self.assertEqual(self.columns, columns)
self.assertItemEqual(self.data, data) self.assertItemsEqual(self.data, data)
def test_type_show_with_encryption(self): def test_type_show_with_encryption(self):
encryption_type = volume_fakes.FakeType.create_one_encryption_type() encryption_type = volume_fakes.FakeType.create_one_encryption_type()
@ -513,7 +513,7 @@ class TestTypeShow(TestType):
self.types_mock.get.assert_called_with(self.volume_type.id) self.types_mock.get.assert_called_with(self.volume_type.id)
self.encryption_types_mock.get.assert_called_with(self.volume_type.id) self.encryption_types_mock.get.assert_called_with(self.volume_type.id)
self.assertEqual(encryption_columns, columns) self.assertEqual(encryption_columns, columns)
self.assertItemEqual(encryption_data, data) self.assertItemsEqual(encryption_data, data)
class TestTypeUnset(TestType): class TestTypeUnset(TestType):

View File

@ -135,7 +135,7 @@ class TestVolumeCreate(TestVolume):
None, None,
) )
self.assertEqual(self.columns, columns) self.assertEqual(self.columns, columns)
self.assertItemEqual(self.datalist, data) self.assertItemsEqual(self.datalist, data)
def test_volume_create_options(self): def test_volume_create_options(self):
arglist = [ arglist = [
@ -179,7 +179,7 @@ class TestVolumeCreate(TestVolume):
) )
self.assertEqual(self.columns, columns) self.assertEqual(self.columns, columns)
self.assertItemEqual(self.datalist, data) self.assertItemsEqual(self.datalist, data)
def test_volume_create_user_project_id(self): def test_volume_create_user_project_id(self):
# Return a project # Return a project
@ -226,7 +226,7 @@ class TestVolumeCreate(TestVolume):
) )
self.assertEqual(self.columns, columns) self.assertEqual(self.columns, columns)
self.assertItemEqual(self.datalist, data) self.assertItemsEqual(self.datalist, data)
def test_volume_create_user_project_name(self): def test_volume_create_user_project_name(self):
# Return a project # Return a project
@ -273,7 +273,7 @@ class TestVolumeCreate(TestVolume):
) )
self.assertEqual(self.columns, columns) self.assertEqual(self.columns, columns)
self.assertItemEqual(self.datalist, data) self.assertItemsEqual(self.datalist, data)
def test_volume_create_properties(self): def test_volume_create_properties(self):
arglist = [ arglist = [
@ -314,7 +314,7 @@ class TestVolumeCreate(TestVolume):
) )
self.assertEqual(self.columns, columns) self.assertEqual(self.columns, columns)
self.assertItemEqual(self.datalist, data) self.assertItemsEqual(self.datalist, data)
def test_volume_create_image_id(self): def test_volume_create_image_id(self):
image = image_fakes.FakeImage.create_one_image() image = image_fakes.FakeImage.create_one_image()
@ -357,7 +357,7 @@ class TestVolumeCreate(TestVolume):
) )
self.assertEqual(self.columns, columns) self.assertEqual(self.columns, columns)
self.assertItemEqual(self.datalist, data) self.assertItemsEqual(self.datalist, data)
def test_volume_create_image_name(self): def test_volume_create_image_name(self):
image = image_fakes.FakeImage.create_one_image() image = image_fakes.FakeImage.create_one_image()
@ -400,7 +400,7 @@ class TestVolumeCreate(TestVolume):
) )
self.assertEqual(self.columns, columns) self.assertEqual(self.columns, columns)
self.assertItemEqual(self.datalist, data) self.assertItemsEqual(self.datalist, data)
def test_volume_create_with_source(self): def test_volume_create_with_source(self):
self.volumes_mock.get.return_value = self.new_volume self.volumes_mock.get.return_value = self.new_volume
@ -430,7 +430,7 @@ class TestVolumeCreate(TestVolume):
None, None,
) )
self.assertEqual(self.columns, columns) self.assertEqual(self.columns, columns)
self.assertItemEqual(self.datalist, data) self.assertItemsEqual(self.datalist, data)
def test_volume_create_with_bootable_and_readonly(self): def test_volume_create_with_bootable_and_readonly(self):
arglist = [ arglist = [
@ -468,7 +468,7 @@ class TestVolumeCreate(TestVolume):
) )
self.assertEqual(self.columns, columns) self.assertEqual(self.columns, columns)
self.assertItemEqual(self.datalist, data) self.assertItemsEqual(self.datalist, data)
self.volumes_mock.set_bootable.assert_called_with( self.volumes_mock.set_bootable.assert_called_with(
self.new_volume.id, True) self.new_volume.id, True)
self.volumes_mock.update_readonly_flag.assert_called_with( self.volumes_mock.update_readonly_flag.assert_called_with(
@ -510,7 +510,7 @@ class TestVolumeCreate(TestVolume):
) )
self.assertEqual(self.columns, columns) self.assertEqual(self.columns, columns)
self.assertItemEqual(self.datalist, data) self.assertItemsEqual(self.datalist, data)
self.volumes_mock.set_bootable.assert_called_with( self.volumes_mock.set_bootable.assert_called_with(
self.new_volume.id, False) self.new_volume.id, False)
self.volumes_mock.update_readonly_flag.assert_called_with( self.volumes_mock.update_readonly_flag.assert_called_with(
@ -562,7 +562,7 @@ class TestVolumeCreate(TestVolume):
self.assertEqual(2, mock_error.call_count) self.assertEqual(2, mock_error.call_count)
self.assertEqual(self.columns, columns) self.assertEqual(self.columns, columns)
self.assertItemEqual(self.datalist, data) self.assertItemsEqual(self.datalist, data)
self.volumes_mock.set_bootable.assert_called_with( self.volumes_mock.set_bootable.assert_called_with(
self.new_volume.id, True) self.new_volume.id, True)
self.volumes_mock.update_readonly_flag.assert_called_with( self.volumes_mock.update_readonly_flag.assert_called_with(
@ -765,7 +765,7 @@ class TestVolumeList(TestVolume):
columns, data = self.cmd.take_action(parsed_args) columns, data = self.cmd.take_action(parsed_args)
self.assertEqual(self.columns, columns) self.assertEqual(self.columns, columns)
self.assertListItemEqual(self.datalist, tuple(data)) self.assertItemsEqual(self.datalist, tuple(data))
def test_volume_list_name(self): def test_volume_list_name(self):
arglist = [ arglist = [
@ -782,7 +782,7 @@ class TestVolumeList(TestVolume):
columns, data = self.cmd.take_action(parsed_args) columns, data = self.cmd.take_action(parsed_args)
self.assertEqual(self.columns, tuple(columns)) self.assertEqual(self.columns, tuple(columns))
self.assertListItemEqual(self.datalist, tuple(data)) self.assertItemsEqual(self.datalist, tuple(data))
def test_volume_list_status(self): def test_volume_list_status(self):
arglist = [ arglist = [
@ -799,7 +799,7 @@ class TestVolumeList(TestVolume):
columns, data = self.cmd.take_action(parsed_args) columns, data = self.cmd.take_action(parsed_args)
self.assertEqual(self.columns, tuple(columns)) self.assertEqual(self.columns, tuple(columns))
self.assertListItemEqual(self.datalist, tuple(data)) self.assertItemsEqual(self.datalist, tuple(data))
def test_volume_list_all_projects(self): def test_volume_list_all_projects(self):
arglist = [ arglist = [
@ -816,7 +816,7 @@ class TestVolumeList(TestVolume):
columns, data = self.cmd.take_action(parsed_args) columns, data = self.cmd.take_action(parsed_args)
self.assertEqual(self.columns, tuple(columns)) self.assertEqual(self.columns, tuple(columns))
self.assertListItemEqual(self.datalist, tuple(data)) self.assertItemsEqual(self.datalist, tuple(data))
def test_volume_list_long(self): def test_volume_list_long(self):
arglist = [ arglist = [
@ -856,7 +856,7 @@ class TestVolumeList(TestVolume):
volume.AttachmentsColumn(self._volume.attachments), volume.AttachmentsColumn(self._volume.attachments),
format_columns.DictColumn(self._volume.metadata), format_columns.DictColumn(self._volume.metadata),
), ) ), )
self.assertListItemEqual(datalist, tuple(data)) self.assertItemsEqual(datalist, tuple(data))
def test_volume_list_with_limit(self): def test_volume_list_with_limit(self):
arglist = [ arglist = [
@ -881,7 +881,7 @@ class TestVolumeList(TestVolume):
'all_tenants': False, } 'all_tenants': False, }
) )
self.assertEqual(self.columns, columns) self.assertEqual(self.columns, columns)
self.assertListItemEqual(self.datalist, tuple(data)) self.assertItemsEqual(self.datalist, tuple(data))
def test_volume_list_negative_limit(self): def test_volume_list_negative_limit(self):
arglist = [ arglist = [
@ -1272,7 +1272,7 @@ class TestVolumeShow(TestVolume):
self.volumes_mock.get.assert_called_with(self._volume.id) self.volumes_mock.get.assert_called_with(self._volume.id)
self.assertEqual(self.columns, columns) self.assertEqual(self.columns, columns)
self.assertItemEqual(self.datalist, data) self.assertItemsEqual(self.datalist, data)
def test_volume_show_backward_compatibility(self): def test_volume_show_backward_compatibility(self):
arglist = [ arglist = [

View File

@ -100,7 +100,7 @@ class TestBackupCreate(TestBackup):
self.new_backup.description, self.new_backup.description,
) )
self.assertEqual(self.columns, columns) self.assertEqual(self.columns, columns)
self.assertItemEqual(self.data, data) self.assertItemsEqual(self.data, data)
def test_backup_create_without_name(self): def test_backup_create_without_name(self):
arglist = [ arglist = [
@ -124,7 +124,7 @@ class TestBackupCreate(TestBackup):
self.new_backup.description, self.new_backup.description,
) )
self.assertEqual(self.columns, columns) self.assertEqual(self.columns, columns)
self.assertItemEqual(self.data, data) self.assertItemsEqual(self.data, data)
class TestBackupDelete(TestBackup): class TestBackupDelete(TestBackup):
@ -277,7 +277,7 @@ class TestBackupList(TestBackup):
search_opts=search_opts, search_opts=search_opts,
) )
self.assertEqual(self.columns, columns) self.assertEqual(self.columns, columns)
self.assertListItemEqual(self.data, list(data)) self.assertItemsEqual(self.data, list(data))
def test_backup_list_with_options(self): def test_backup_list_with_options(self):
arglist = [ arglist = [
@ -309,7 +309,7 @@ class TestBackupList(TestBackup):
search_opts=search_opts, search_opts=search_opts,
) )
self.assertEqual(self.columns_long, columns) self.assertEqual(self.columns_long, columns)
self.assertListItemEqual(self.data_long, list(data)) self.assertItemsEqual(self.data_long, list(data))
class TestBackupRestore(TestBackup): class TestBackupRestore(TestBackup):
@ -391,4 +391,4 @@ class TestBackupShow(TestBackup):
self.backups_mock.get.assert_called_with(self.backup.id) self.backups_mock.get.assert_called_with(self.backup.id)
self.assertEqual(self.columns, columns) self.assertEqual(self.columns, columns)
self.assertItemEqual(self.data, data) self.assertItemsEqual(self.data, data)

View File

@ -251,7 +251,7 @@ class TestConsistencyGroupCreate(TestConsistencyGroup):
) )
self.assertEqual(self.columns, columns) self.assertEqual(self.columns, columns)
self.assertItemEqual(self.data, data) self.assertItemsEqual(self.data, data)
def test_consistency_group_create_from_source(self): def test_consistency_group_create_from_source(self):
arglist = [ arglist = [
@ -279,7 +279,7 @@ class TestConsistencyGroupCreate(TestConsistencyGroup):
) )
self.assertEqual(self.columns, columns) self.assertEqual(self.columns, columns)
self.assertItemEqual(self.data, data) self.assertItemsEqual(self.data, data)
def test_consistency_group_create_from_snapshot(self): def test_consistency_group_create_from_snapshot(self):
arglist = [ arglist = [
@ -307,7 +307,7 @@ class TestConsistencyGroupCreate(TestConsistencyGroup):
) )
self.assertEqual(self.columns, columns) self.assertEqual(self.columns, columns)
self.assertItemEqual(self.data, data) self.assertItemsEqual(self.data, data)
class TestConsistencyGroupDelete(TestConsistencyGroup): class TestConsistencyGroupDelete(TestConsistencyGroup):
@ -463,7 +463,7 @@ class TestConsistencyGroupList(TestConsistencyGroup):
self.consistencygroups_mock.list.assert_called_once_with( self.consistencygroups_mock.list.assert_called_once_with(
detailed=True, search_opts={'all_tenants': False}) detailed=True, search_opts={'all_tenants': False})
self.assertEqual(self.columns, columns) self.assertEqual(self.columns, columns)
self.assertListItemEqual(self.data, list(data)) self.assertItemsEqual(self.data, list(data))
def test_consistency_group_list_with_all_project(self): def test_consistency_group_list_with_all_project(self):
arglist = [ arglist = [
@ -480,7 +480,7 @@ class TestConsistencyGroupList(TestConsistencyGroup):
self.consistencygroups_mock.list.assert_called_once_with( self.consistencygroups_mock.list.assert_called_once_with(
detailed=True, search_opts={'all_tenants': True}) detailed=True, search_opts={'all_tenants': True})
self.assertEqual(self.columns, columns) self.assertEqual(self.columns, columns)
self.assertListItemEqual(self.data, list(data)) self.assertItemsEqual(self.data, list(data))
def test_consistency_group_list_with_long(self): def test_consistency_group_list_with_long(self):
arglist = [ arglist = [
@ -497,7 +497,7 @@ class TestConsistencyGroupList(TestConsistencyGroup):
self.consistencygroups_mock.list.assert_called_once_with( self.consistencygroups_mock.list.assert_called_once_with(
detailed=True, search_opts={'all_tenants': False}) detailed=True, search_opts={'all_tenants': False})
self.assertEqual(self.columns_long, columns) self.assertEqual(self.columns_long, columns)
self.assertListItemEqual(self.data_long, list(data)) self.assertItemsEqual(self.data_long, list(data))
class TestConsistencyGroupRemoveVolume(TestConsistencyGroup): class TestConsistencyGroupRemoveVolume(TestConsistencyGroup):
@ -705,4 +705,4 @@ class TestConsistencyGroupShow(TestConsistencyGroup):
self.consistencygroups_mock.get.assert_called_once_with( self.consistencygroups_mock.get.assert_called_once_with(
self.consistency_group.id) self.consistency_group.id)
self.assertEqual(self.columns, columns) self.assertEqual(self.columns, columns)
self.assertItemEqual(self.data, data) self.assertItemsEqual(self.data, data)

View File

@ -112,7 +112,7 @@ class TestQosCreate(TestQos):
) )
self.assertEqual(self.columns, columns) self.assertEqual(self.columns, columns)
self.assertItemEqual(self.data, data) self.assertItemsEqual(self.data, data)
def test_qos_create_with_consumer(self): def test_qos_create_with_consumer(self):
arglist = [ arglist = [
@ -133,7 +133,7 @@ class TestQosCreate(TestQos):
) )
self.assertEqual(self.columns, columns) self.assertEqual(self.columns, columns)
self.assertItemEqual(self.data, data) self.assertItemsEqual(self.data, data)
def test_qos_create_with_properties(self): def test_qos_create_with_properties(self):
arglist = [ arglist = [
@ -159,7 +159,7 @@ class TestQosCreate(TestQos):
) )
self.assertEqual(self.columns, columns) self.assertEqual(self.columns, columns)
self.assertItemEqual(self.data, data) self.assertItemsEqual(self.data, data)
class TestQosDelete(TestQos): class TestQosDelete(TestQos):
@ -342,7 +342,7 @@ class TestQosList(TestQos):
self.qos_mock.list.assert_called_with() self.qos_mock.list.assert_called_with()
self.assertEqual(self.columns, columns) self.assertEqual(self.columns, columns)
self.assertListItemEqual(self.data, list(data)) self.assertItemsEqual(self.data, list(data))
def test_qos_list_no_association(self): def test_qos_list_no_association(self):
self.qos_mock.reset_mock() self.qos_mock.reset_mock()
@ -369,7 +369,7 @@ class TestQosList(TestQos):
format_columns.ListColumn(None), format_columns.ListColumn(None),
format_columns.DictColumn(self.qos_specs[1].specs), format_columns.DictColumn(self.qos_specs[1].specs),
) )
self.assertListItemEqual(ex_data, list(data)) self.assertItemsEqual(ex_data, list(data))
class TestQosSet(TestQos): class TestQosSet(TestQos):
@ -449,7 +449,7 @@ class TestQosShow(TestQos):
) )
self.assertEqual(self.columns, columns) self.assertEqual(self.columns, columns)
self.assertItemEqual(self.data, tuple(data)) self.assertItemsEqual(self.data, tuple(data))
class TestQosUnset(TestQos): class TestQosUnset(TestQos):

View File

@ -93,7 +93,7 @@ class TestTypeCreate(TestType):
) )
self.assertEqual(self.columns, columns) self.assertEqual(self.columns, columns)
self.assertItemEqual(self.data, data) self.assertItemsEqual(self.data, data)
def test_type_create_private(self): def test_type_create_private(self):
arglist = [ arglist = [
@ -119,7 +119,7 @@ class TestTypeCreate(TestType):
) )
self.assertEqual(self.columns, columns) self.assertEqual(self.columns, columns)
self.assertItemEqual(self.data, data) self.assertItemsEqual(self.data, data)
def test_public_type_create_with_project(self): def test_public_type_create_with_project(self):
arglist = [ arglist = [
@ -196,7 +196,7 @@ class TestTypeCreate(TestType):
body, body,
) )
self.assertEqual(encryption_columns, columns) self.assertEqual(encryption_columns, columns)
self.assertItemEqual(encryption_data, data) self.assertItemsEqual(encryption_data, data)
class TestTypeDelete(TestType): class TestTypeDelete(TestType):
@ -330,7 +330,7 @@ class TestTypeList(TestType):
columns, data = self.cmd.take_action(parsed_args) columns, data = self.cmd.take_action(parsed_args)
self.types_mock.list.assert_called_once_with(is_public=None) self.types_mock.list.assert_called_once_with(is_public=None)
self.assertEqual(self.columns, columns) self.assertEqual(self.columns, columns)
self.assertListItemEqual(self.data, list(data)) self.assertItemsEqual(self.data, list(data))
def test_type_list_with_options(self): def test_type_list_with_options(self):
arglist = [ arglist = [
@ -348,7 +348,7 @@ class TestTypeList(TestType):
columns, data = self.cmd.take_action(parsed_args) columns, data = self.cmd.take_action(parsed_args)
self.types_mock.list.assert_called_once_with(is_public=True) self.types_mock.list.assert_called_once_with(is_public=True)
self.assertEqual(self.columns_long, columns) self.assertEqual(self.columns_long, columns)
self.assertListItemEqual(self.data_long, list(data)) self.assertItemsEqual(self.data_long, list(data))
def test_type_list_with_private_option(self): def test_type_list_with_private_option(self):
arglist = [ arglist = [
@ -365,7 +365,7 @@ class TestTypeList(TestType):
columns, data = self.cmd.take_action(parsed_args) columns, data = self.cmd.take_action(parsed_args)
self.types_mock.list.assert_called_once_with(is_public=False) self.types_mock.list.assert_called_once_with(is_public=False)
self.assertEqual(self.columns, columns) self.assertEqual(self.columns, columns)
self.assertListItemEqual(self.data, list(data)) self.assertItemsEqual(self.data, list(data))
def test_type_list_with_default_option(self): def test_type_list_with_default_option(self):
arglist = [ arglist = [
@ -383,7 +383,7 @@ class TestTypeList(TestType):
columns, data = self.cmd.take_action(parsed_args) columns, data = self.cmd.take_action(parsed_args)
self.types_mock.default.assert_called_once_with() self.types_mock.default.assert_called_once_with()
self.assertEqual(self.columns, columns) self.assertEqual(self.columns, columns)
self.assertListItemEqual(self.data_with_default_type, list(data)) self.assertItemsEqual(self.data_with_default_type, list(data))
def test_type_list_with_encryption(self): def test_type_list_with_encryption(self):
encryption_type = volume_fakes.FakeType.create_one_encryption_type( encryption_type = volume_fakes.FakeType.create_one_encryption_type(
@ -427,7 +427,7 @@ class TestTypeList(TestType):
self.encryption_types_mock.list.assert_called_once_with() self.encryption_types_mock.list.assert_called_once_with()
self.types_mock.list.assert_called_once_with(is_public=None) self.types_mock.list.assert_called_once_with(is_public=None)
self.assertEqual(encryption_columns, columns) self.assertEqual(encryption_columns, columns)
self.assertListItemEqual(encryption_data, list(data)) self.assertItemsEqual(encryption_data, list(data))
class TestTypeSet(TestType): class TestTypeSet(TestType):
@ -713,7 +713,7 @@ class TestTypeShow(TestType):
self.types_mock.get.assert_called_with(self.volume_type.id) self.types_mock.get.assert_called_with(self.volume_type.id)
self.assertEqual(self.columns, columns) self.assertEqual(self.columns, columns)
self.assertItemEqual(self.data, data) self.assertItemsEqual(self.data, data)
def test_type_show_with_access(self): def test_type_show_with_access(self):
arglist = [ arglist = [
@ -746,7 +746,7 @@ class TestTypeShow(TestType):
private_type.name, private_type.name,
format_columns.DictColumn(private_type.extra_specs) format_columns.DictColumn(private_type.extra_specs)
) )
self.assertItemEqual(private_type_data, data) self.assertItemsEqual(private_type_data, data)
def test_type_show_with_list_access_exec(self): def test_type_show_with_list_access_exec(self):
arglist = [ arglist = [
@ -778,7 +778,7 @@ class TestTypeShow(TestType):
private_type.name, private_type.name,
format_columns.DictColumn(private_type.extra_specs) format_columns.DictColumn(private_type.extra_specs)
) )
self.assertItemEqual(private_type_data, data) self.assertItemsEqual(private_type_data, data)
def test_type_show_with_encryption(self): def test_type_show_with_encryption(self):
encryption_type = volume_fakes.FakeType.create_one_encryption_type() encryption_type = volume_fakes.FakeType.create_one_encryption_type()
@ -824,7 +824,7 @@ class TestTypeShow(TestType):
self.types_mock.get.assert_called_with(self.volume_type.id) self.types_mock.get.assert_called_with(self.volume_type.id)
self.encryption_types_mock.get.assert_called_with(self.volume_type.id) self.encryption_types_mock.get.assert_called_with(self.volume_type.id)
self.assertEqual(encryption_columns, columns) self.assertEqual(encryption_columns, columns)
self.assertItemEqual(encryption_data, data) self.assertItemsEqual(encryption_data, data)
class TestTypeUnset(TestType): class TestTypeUnset(TestType):

View File

@ -136,7 +136,7 @@ class TestVolumeCreate(TestVolume):
) )
self.assertEqual(self.columns, columns) self.assertEqual(self.columns, columns)
self.assertItemEqual(self.datalist, data) self.assertItemsEqual(self.datalist, data)
def test_volume_create_options(self): def test_volume_create_options(self):
consistency_group = ( consistency_group = (
@ -182,7 +182,7 @@ class TestVolumeCreate(TestVolume):
) )
self.assertEqual(self.columns, columns) self.assertEqual(self.columns, columns)
self.assertItemEqual(self.datalist, data) self.assertItemsEqual(self.datalist, data)
def test_volume_create_properties(self): def test_volume_create_properties(self):
arglist = [ arglist = [
@ -218,7 +218,7 @@ class TestVolumeCreate(TestVolume):
) )
self.assertEqual(self.columns, columns) self.assertEqual(self.columns, columns)
self.assertItemEqual(self.datalist, data) self.assertItemsEqual(self.datalist, data)
def test_volume_create_image_id(self): def test_volume_create_image_id(self):
image = image_fakes.FakeImage.create_one_image() image = image_fakes.FakeImage.create_one_image()
@ -256,7 +256,7 @@ class TestVolumeCreate(TestVolume):
) )
self.assertEqual(self.columns, columns) self.assertEqual(self.columns, columns)
self.assertItemEqual(self.datalist, data) self.assertItemsEqual(self.datalist, data)
def test_volume_create_image_name(self): def test_volume_create_image_name(self):
image = image_fakes.FakeImage.create_one_image() image = image_fakes.FakeImage.create_one_image()
@ -294,7 +294,7 @@ class TestVolumeCreate(TestVolume):
) )
self.assertEqual(self.columns, columns) self.assertEqual(self.columns, columns)
self.assertItemEqual(self.datalist, data) self.assertItemsEqual(self.datalist, data)
def test_volume_create_with_snapshot(self): def test_volume_create_with_snapshot(self):
snapshot = volume_fakes.FakeSnapshot.create_one_snapshot() snapshot = volume_fakes.FakeSnapshot.create_one_snapshot()
@ -331,7 +331,7 @@ class TestVolumeCreate(TestVolume):
) )
self.assertEqual(self.columns, columns) self.assertEqual(self.columns, columns)
self.assertItemEqual(self.datalist, data) self.assertItemsEqual(self.datalist, data)
def test_volume_create_with_bootable_and_readonly(self): def test_volume_create_with_bootable_and_readonly(self):
arglist = [ arglist = [
@ -369,7 +369,7 @@ class TestVolumeCreate(TestVolume):
) )
self.assertEqual(self.columns, columns) self.assertEqual(self.columns, columns)
self.assertItemEqual(self.datalist, data) self.assertItemsEqual(self.datalist, data)
self.volumes_mock.set_bootable.assert_called_with( self.volumes_mock.set_bootable.assert_called_with(
self.new_volume.id, True) self.new_volume.id, True)
self.volumes_mock.update_readonly_flag.assert_called_with( self.volumes_mock.update_readonly_flag.assert_called_with(
@ -411,7 +411,7 @@ class TestVolumeCreate(TestVolume):
) )
self.assertEqual(self.columns, columns) self.assertEqual(self.columns, columns)
self.assertItemEqual(self.datalist, data) self.assertItemsEqual(self.datalist, data)
self.volumes_mock.set_bootable.assert_called_with( self.volumes_mock.set_bootable.assert_called_with(
self.new_volume.id, False) self.new_volume.id, False)
self.volumes_mock.update_readonly_flag.assert_called_with( self.volumes_mock.update_readonly_flag.assert_called_with(
@ -463,7 +463,7 @@ class TestVolumeCreate(TestVolume):
self.assertEqual(2, mock_error.call_count) self.assertEqual(2, mock_error.call_count)
self.assertEqual(self.columns, columns) self.assertEqual(self.columns, columns)
self.assertItemEqual(self.datalist, data) self.assertItemsEqual(self.datalist, data)
self.volumes_mock.set_bootable.assert_called_with( self.volumes_mock.set_bootable.assert_called_with(
self.new_volume.id, True) self.new_volume.id, True)
self.volumes_mock.update_readonly_flag.assert_called_with( self.volumes_mock.update_readonly_flag.assert_called_with(
@ -680,7 +680,7 @@ class TestVolumeList(TestVolume):
self.mock_volume.size, self.mock_volume.size,
volume.AttachmentsColumn(self.mock_volume.attachments), volume.AttachmentsColumn(self.mock_volume.attachments),
), ) ), )
self.assertListItemEqual(datalist, tuple(data)) self.assertItemsEqual(datalist, tuple(data))
def test_volume_list_project(self): def test_volume_list_project(self):
arglist = [ arglist = [
@ -720,7 +720,7 @@ class TestVolumeList(TestVolume):
self.mock_volume.size, self.mock_volume.size,
volume.AttachmentsColumn(self.mock_volume.attachments), volume.AttachmentsColumn(self.mock_volume.attachments),
), ) ), )
self.assertListItemEqual(datalist, tuple(data)) self.assertItemsEqual(datalist, tuple(data))
def test_volume_list_project_domain(self): def test_volume_list_project_domain(self):
arglist = [ arglist = [
@ -762,7 +762,7 @@ class TestVolumeList(TestVolume):
self.mock_volume.size, self.mock_volume.size,
volume.AttachmentsColumn(self.mock_volume.attachments), volume.AttachmentsColumn(self.mock_volume.attachments),
), ) ), )
self.assertListItemEqual(datalist, tuple(data)) self.assertItemsEqual(datalist, tuple(data))
def test_volume_list_user(self): def test_volume_list_user(self):
arglist = [ arglist = [
@ -801,7 +801,7 @@ class TestVolumeList(TestVolume):
self.mock_volume.size, self.mock_volume.size,
volume.AttachmentsColumn(self.mock_volume.attachments), volume.AttachmentsColumn(self.mock_volume.attachments),
), ) ), )
self.assertListItemEqual(datalist, tuple(data)) self.assertItemsEqual(datalist, tuple(data))
def test_volume_list_user_domain(self): def test_volume_list_user_domain(self):
arglist = [ arglist = [
@ -843,7 +843,7 @@ class TestVolumeList(TestVolume):
self.mock_volume.size, self.mock_volume.size,
volume.AttachmentsColumn(self.mock_volume.attachments), volume.AttachmentsColumn(self.mock_volume.attachments),
), ) ), )
self.assertListItemEqual(datalist, tuple(data)) self.assertItemsEqual(datalist, tuple(data))
def test_volume_list_name(self): def test_volume_list_name(self):
arglist = [ arglist = [
@ -883,7 +883,7 @@ class TestVolumeList(TestVolume):
self.mock_volume.size, self.mock_volume.size,
volume.AttachmentsColumn(self.mock_volume.attachments), volume.AttachmentsColumn(self.mock_volume.attachments),
), ) ), )
self.assertListItemEqual(datalist, tuple(data)) self.assertItemsEqual(datalist, tuple(data))
def test_volume_list_status(self): def test_volume_list_status(self):
arglist = [ arglist = [
@ -923,7 +923,7 @@ class TestVolumeList(TestVolume):
self.mock_volume.size, self.mock_volume.size,
volume.AttachmentsColumn(self.mock_volume.attachments), volume.AttachmentsColumn(self.mock_volume.attachments),
), ) ), )
self.assertListItemEqual(datalist, tuple(data)) self.assertItemsEqual(datalist, tuple(data))
def test_volume_list_all_projects(self): def test_volume_list_all_projects(self):
arglist = [ arglist = [
@ -963,7 +963,7 @@ class TestVolumeList(TestVolume):
self.mock_volume.size, self.mock_volume.size,
volume.AttachmentsColumn(self.mock_volume.attachments), volume.AttachmentsColumn(self.mock_volume.attachments),
), ) ), )
self.assertListItemEqual(datalist, tuple(data)) self.assertItemsEqual(datalist, tuple(data))
def test_volume_list_long(self): def test_volume_list_long(self):
arglist = [ arglist = [
@ -1017,7 +1017,7 @@ class TestVolumeList(TestVolume):
volume.AttachmentsColumn(self.mock_volume.attachments), volume.AttachmentsColumn(self.mock_volume.attachments),
format_columns.DictColumn(self.mock_volume.metadata), format_columns.DictColumn(self.mock_volume.metadata),
), ) ), )
self.assertListItemEqual(datalist, tuple(data)) self.assertItemsEqual(datalist, tuple(data))
def test_volume_list_with_marker_and_limit(self): def test_volume_list_with_marker_and_limit(self):
arglist = [ arglist = [
@ -1056,7 +1056,7 @@ class TestVolumeList(TestVolume):
'name': None, 'name': None,
'all_tenants': False, } 'all_tenants': False, }
) )
self.assertListItemEqual(datalist, tuple(data)) self.assertItemsEqual(datalist, tuple(data))
def test_volume_list_negative_limit(self): def test_volume_list_negative_limit(self):
arglist = [ arglist = [
@ -1450,7 +1450,7 @@ class TestVolumeShow(TestVolume):
volume_fakes.FakeVolume.get_volume_columns(self._volume), volume_fakes.FakeVolume.get_volume_columns(self._volume),
columns) columns)
self.assertItemEqual( self.assertItemsEqual(
volume_fakes.FakeVolume.get_volume_data(self._volume), volume_fakes.FakeVolume.get_volume_data(self._volume),
data) data)

View File

@ -314,7 +314,7 @@ class TestBackupList(TestBackup):
limit=None, limit=None,
) )
self.assertEqual(self.columns, columns) self.assertEqual(self.columns, columns)
self.assertListItemEqual(self.data, list(data)) self.assertItemsEqual(self.data, list(data))
def test_backup_list_with_options(self): def test_backup_list_with_options(self):
arglist = [ arglist = [
@ -353,7 +353,7 @@ class TestBackupList(TestBackup):
limit=3, limit=3,
) )
self.assertEqual(self.columns_long, columns) self.assertEqual(self.columns_long, columns)
self.assertListItemEqual(self.data_long, list(data)) self.assertItemsEqual(self.data_long, list(data))
class TestBackupRestore(TestBackup): class TestBackupRestore(TestBackup):

View File

@ -3,10 +3,10 @@
# process, which may cause wedges in the gate later. # process, which may cause wedges in the gate later.
pbr!=2.1.0,>=2.0.0 # Apache-2.0 pbr!=2.1.0,>=2.0.0 # Apache-2.0
cliff>=3.4.0 # Apache-2.0 cliff>=3.5.0 # Apache-2.0
iso8601>=0.1.11 # MIT iso8601>=0.1.11 # MIT
openstacksdk>=0.52.0 # Apache-2.0 openstacksdk>=0.52.0 # Apache-2.0
osc-lib>=2.2.0 # Apache-2.0 osc-lib>=2.3.0 # Apache-2.0
oslo.i18n>=3.15.3 # Apache-2.0 oslo.i18n>=3.15.3 # Apache-2.0
python-keystoneclient>=3.22.0 # Apache-2.0 python-keystoneclient>=3.22.0 # Apache-2.0
python-novaclient>=15.1.0 # Apache-2.0 python-novaclient>=15.1.0 # Apache-2.0