]> review.fuel-infra Code Review - openstack-build/cinder-build.git/commitdiff
Correct assertDictMatch argument order
authorNate Potter <nathaniel.potter@intel.com>
Wed, 21 Oct 2015 19:07:16 +0000 (19:07 +0000)
committerNate Potter <nathaniel.potter@intel.com>
Fri, 13 Nov 2015 16:57:01 +0000 (16:57 +0000)
Patch to fix the order of the arguments in assertDictMatch to
(expected, observed) in instances where it was in the
wrong order.

Closes-Bug: #1259292

Change-Id: I969d780ea06190ba5362106ee2b8efa1ee43927c

23 files changed:
cinder/tests/unit/api/contrib/test_qos_specs_manage.py
cinder/tests/unit/api/contrib/test_quotas.py
cinder/tests/unit/api/contrib/test_quotas_classes.py
cinder/tests/unit/api/contrib/test_scheduler_stats.py
cinder/tests/unit/api/contrib/test_volume_actions.py
cinder/tests/unit/api/v1/test_limits.py
cinder/tests/unit/api/v1/test_types.py
cinder/tests/unit/api/v2/test_types.py
cinder/tests/unit/db/test_qos_specs.py
cinder/tests/unit/image/test_glance.py
cinder/tests/unit/scheduler/test_host_manager.py
cinder/tests/unit/test_hpe3par.py
cinder/tests/unit/test_hplefthand.py
cinder/tests/unit/test_infortrend_cli.py
cinder/tests/unit/test_infortrend_common.py
cinder/tests/unit/test_prophetstor_dpl.py
cinder/tests/unit/test_qos_specs.py
cinder/tests/unit/zonemanager/test_brcd_fc_san_lookup_service.py
cinder/tests/unit/zonemanager/test_brcd_fc_zone_client_cli.py
cinder/tests/unit/zonemanager/test_brcd_lookup_service.py
cinder/tests/unit/zonemanager/test_cisco_fc_san_lookup_service.py
cinder/tests/unit/zonemanager/test_cisco_fc_zone_client_cli.py
cinder/tests/unit/zonemanager/test_cisco_lookup_service.py

index 837376f68688cbd835e6cc3e49ead7d6c5e2f15c..749572be6c51d0d3fdf335b3798cf673da7e48a9 100644 (file)
@@ -379,7 +379,7 @@ class QoSSpecManageApiTest(test.TestCase):
             body = {'qos_specs': {'key1': 'value1',
                                   'key2': 'value2'}}
             res = self.controller.update(req, '555', body)
-            self.assertDictMatch(res, body)
+            self.assertDictMatch(body, res)
             self.assertEqual(1, notifier.get_notification_count())
 
     @mock.patch('cinder.volume.qos_specs.update',
@@ -677,7 +677,7 @@ class TestQoSSpecsTemplate(test.TestCase):
                     continue
                 new_dict.update({element.tag: element.text})
 
-            self.assertDictMatch(new_dict, qos_dict['specs'])
+            self.assertDictMatch(qos_dict['specs'], new_dict)
 
 
 class TestAssociationsTemplate(test.TestCase):
index 4739e6ce54ff89e0bad3521639830fb34c15aa55..e4f4335bc4a29844f601df0f62034fd570bfbe31 100644 (file)
@@ -176,13 +176,13 @@ class QuotaSetsControllerTest(test.TestCase):
         self.req.environ['cinder.context'].project_id = self.A.id
         result = self.controller.show(self.req, self.D.id)
         expected = make_subproject_body(tenant_id=self.D.id)
-        self.assertDictMatch(result, expected)
+        self.assertDictMatch(expected, result)
         # An user scoped to a parent project can see its immediate children
         # quotas.
         self.req.environ['cinder.context'].project_id = self.B.id
         result = self.controller.show(self.req, self.D.id)
         expected = make_subproject_body(tenant_id=self.D.id)
-        self.assertDictMatch(result, expected)
+        self.assertDictMatch(expected, result)
 
     def test_subproject_show_target_project_equals_to_context_project(self):
         self.controller._get_project = mock.Mock()
@@ -190,7 +190,7 @@ class QuotaSetsControllerTest(test.TestCase):
         self.req.environ['cinder.context'].project_id = self.B.id
         result = self.controller.show(self.req, self.B.id)
         expected = make_subproject_body(tenant_id=self.B.id)
-        self.assertDictMatch(result, expected)
+        self.assertDictMatch(expected, result)
 
     def test_show_not_authorized(self):
         self.controller._get_project = mock.Mock()
@@ -231,13 +231,13 @@ class QuotaSetsControllerTest(test.TestCase):
         body = make_body(gigabytes=2000, snapshots=15,
                          volumes=5, backups=5, tenant_id=None)
         result = self.controller.update(self.req, self.A.id, body)
-        self.assertDictMatch(result, body)
+        self.assertDictMatch(body, result)
         # Update the quota of B to be equal to its parent quota
         self.req.environ['cinder.context'].project_id = self.A.id
         body = make_body(gigabytes=2000, snapshots=15,
                          volumes=5, backups=5, tenant_id=None)
         result = self.controller.update(self.req, self.B.id, body)
-        self.assertDictMatch(result, body)
+        self.assertDictMatch(body, result)
         # Try to update the quota of C, it will not be allowed, since the
         # project A doesn't have free quota available.
         self.req.environ['cinder.context'].project_id = self.A.id
@@ -250,7 +250,7 @@ class QuotaSetsControllerTest(test.TestCase):
         body = make_body(gigabytes=1000, snapshots=7,
                          volumes=3, backups=3, tenant_id=None)
         result = self.controller.update(self.req, self.D.id, body)
-        self.assertDictMatch(result, body)
+        self.assertDictMatch(body, result)
         # An admin of B can also update the quota of D, since D is its an
         # immediate child.
         self.req.environ['cinder.context'].project_id = self.B.id
@@ -274,7 +274,7 @@ class QuotaSetsControllerTest(test.TestCase):
         body = make_body(gigabytes=2000, snapshots=15,
                          volumes=5, backups=5, tenant_id=None)
         result = self.controller.update(self.req, self.A.id, body)
-        self.assertDictMatch(result, body)
+        self.assertDictMatch(body, result)
         # Try to update the quota of F, it will not be allowed, since the
         # project E doesn't belongs to the project hierarchy of A.
         self.req.environ['cinder.context'].project_id = self.A.id
@@ -291,7 +291,7 @@ class QuotaSetsControllerTest(test.TestCase):
         body = make_body(gigabytes=2000, snapshots=15,
                          volumes=5, backups=5, tenant_id=None)
         result = self.controller.update(self.req, self.A.id, body)
-        self.assertDictMatch(result, body)
+        self.assertDictMatch(body, result)
         # Try to update the quota of B, it will not be allowed, since the
         # project in the context (B) is not a root project.
         self.req.environ['cinder.context'].project_id = self.B.id
@@ -436,13 +436,13 @@ class QuotaSetsControllerTest(test.TestCase):
         self.controller._get_project = mock.Mock()
         self.controller._get_project.side_effect = self._get_project
         result_show = self.controller.show(self.req, 'foo')
-        self.assertDictMatch(result_show, make_body())
+        self.assertDictMatch(make_body(), result_show)
 
         body = make_body(gigabytes=2000, snapshots=15,
                          volumes=5, backups=5,
                          backup_gigabytes=1000, tenant_id=None)
         result_update = self.controller.update(self.req, 'foo', body)
-        self.assertDictMatch(result_update, body)
+        self.assertDictMatch(body, result_update)
 
         self.controller.delete(self.req, 'foo')
 
@@ -458,14 +458,14 @@ class QuotaSetsControllerTest(test.TestCase):
                          volumes=5, backups=5,
                          backup_gigabytes=1000, tenant_id=None)
         result_update = self.controller.update(self.req, self.A.id, body)
-        self.assertDictMatch(result_update, body)
+        self.assertDictMatch(body, result_update)
 
         # Set usage param to True in order to see get allocated values.
         self.req.params = {'usage': 'True'}
         result_show = self.controller.show(self.req, self.A.id)
 
         result_update = self.controller.update(self.req, self.B.id, body)
-        self.assertDictMatch(result_update, body)
+        self.assertDictMatch(body, result_update)
 
         self.controller.delete(self.req, self.B.id)
 
@@ -509,14 +509,14 @@ class QuotaSetsControllerTest(test.TestCase):
                          volumes=5, backups=5,
                          backup_gigabytes=1000, tenant_id=None)
         result_update = self.controller.update(self.req, self.A.id, body)
-        self.assertDictMatch(result_update, body)
+        self.assertDictMatch(body, result_update)
 
         # Set usage param to True in order to see get allocated values.
         self.req.params = {'usage': 'True'}
         result_show = self.controller.show(self.req, self.A.id)
 
         result_update = self.controller.update(self.req, self.B.id, body)
-        self.assertDictMatch(result_update, body)
+        self.assertDictMatch(body, result_update)
 
         self.controller.delete(self.req, self.B.id)
 
index 17bdffb440c55353ba69e67027d0ecc1e7efb15a..58a5ed18c22f846234c7658b5f338cae099826bd 100644 (file)
@@ -93,7 +93,7 @@ class QuotaClassSetsControllerTest(test.TestCase):
     def test_show(self):
         volume_types.create(self.ctxt, 'fake_type')
         result = self.controller.show(self.req, 'foo')
-        self.assertDictMatch(result, make_body())
+        self.assertDictMatch(make_body(), result)
 
     def test_show_not_authorized(self):
         self.req.environ['cinder.context'].is_admin = False
@@ -107,7 +107,7 @@ class QuotaClassSetsControllerTest(test.TestCase):
         body = make_body(gigabytes=2000, snapshots=15,
                          volumes=5, tenant_id=None)
         result = self.controller.update(self.req, 'foo', body)
-        self.assertDictMatch(result, body)
+        self.assertDictMatch(body, result)
 
     @mock.patch('cinder.api.openstack.wsgi.Controller.validate_string_length')
     @mock.patch('cinder.api.openstack.wsgi.Controller.validate_integer')
@@ -124,7 +124,7 @@ class QuotaClassSetsControllerTest(test.TestCase):
         volume_types.create(self.ctxt, 'fake_type')
         body = {'quota_class_set': {'bad': 'bad'}}
         result = self.controller.update(self.req, 'foo', body)
-        self.assertDictMatch(result, make_body(tenant_id=None))
+        self.assertDictMatch(make_body(tenant_id=None), result)
 
     def test_update_invalid_key_value(self):
         body = {'quota_class_set': {'gigabytes': "should_be_int"}}
@@ -147,10 +147,11 @@ class QuotaClassSetsControllerTest(test.TestCase):
         body = {'quota_class_set': {'gigabytes_fake_type_1': 1111,
                                     'volumes_fake_type_2': 2222}}
         result = self.controller.update(self.req, 'foo', body)
-        self.assertDictMatch(result, make_response_body(ctxt=self.ctxt,
-                                                        quota_class='foo',
-                                                        request_body=body,
-                                                        tenant_id=None))
+        self.assertDictMatch(make_response_body(ctxt=self.ctxt,
+                                                quota_class='foo',
+                                                request_body=body,
+                                                tenant_id=None),
+                             result)
 
 
 class QuotaClassesSerializerTest(test.TestCase):
index 975711282c42ec78e12cec6767b0b26816b39d58..96b8e5c082ed69ff1fbf2c68fae68bffdf947049 100644 (file)
@@ -69,7 +69,7 @@ class SchedulerStatsAPITest(test.TestCase):
             ]
         }
 
-        self.assertDictMatch(res, expected)
+        self.assertDictMatch(expected, res)
 
     def test_get_pools_detail(self):
         req = fakes.HTTPRequest.blank('/v2/fake/scheduler_stats?detail=True')
@@ -107,4 +107,4 @@ class SchedulerStatsAPITest(test.TestCase):
             ]
         }
 
-        self.assertDictMatch(res, expected)
+        self.assertDictMatch(expected, res)
index c2078d597fa10ad9f19a6ba4b2d91bf074f89806..0a72048c6b9353f3877945217480e37baaab4dd2 100644 (file)
@@ -621,7 +621,7 @@ class VolumeImageActionsTest(test.TestCase):
                      'container_format': 'bare',
                      'disk_format': 'raw',
                      'image_name': 'image_name'}}
-        self.assertDictMatch(res_dict, expected)
+        self.assertDictMatch(expected, res_dict)
 
     def test_copy_volume_to_image_volumenotfound(self):
         def stub_volume_get_raise_exc(self, context, volume_id):
@@ -808,7 +808,7 @@ class VolumeImageActionsTest(test.TestCase):
                             }
                         }
 
-                        self.assertDictMatch(res_dict, expected_res)
+                        self.assertDictMatch(expected_res, res_dict)
 
     def test_copy_volume_to_image_without_glance_metadata(self):
         """Test create image from volume if volume is created without image.
@@ -865,7 +865,7 @@ class VolumeImageActionsTest(test.TestCase):
                             }
                         }
 
-                        self.assertDictMatch(res_dict, expected_res)
+                        self.assertDictMatch(expected_res, res_dict)
 
     def test_copy_volume_to_image_without_protected_prop(self):
         """Test protected property is not defined with the root image."""
@@ -919,7 +919,7 @@ class VolumeImageActionsTest(test.TestCase):
                             }
                         }
 
-                        self.assertDictMatch(res_dict, expected_res)
+                        self.assertDictMatch(expected_res, res_dict)
 
     def test_copy_volume_to_image_without_core_prop(self):
         """Test glance_core_properties defined in cinder.conf is empty."""
@@ -966,4 +966,4 @@ class VolumeImageActionsTest(test.TestCase):
                         }
                     }
 
-                    self.assertDictMatch(res_dict, expected_res)
+                    self.assertDictMatch(expected_res, res_dict)
index b26ef9ef13f47332b552d6c6f0ff80303b90e7ae..7ca8afc94e74d54a980590a3913737c5692f9f25 100644 (file)
@@ -806,7 +806,7 @@ class LimitsViewBuilderTest(test.TestCase):
 
         output = self.view_builder.build(self.rate_limits,
                                          self.absolute_limits)
-        self.assertDictMatch(output, expected_limits)
+        self.assertDictMatch(expected_limits, output)
 
     def test_build_limits_empty_limits(self):
         expected_limits = {"limits": {"rate": [],
@@ -815,7 +815,7 @@ class LimitsViewBuilderTest(test.TestCase):
         abs_limits = {}
         rate_limits = []
         output = self.view_builder.build(rate_limits, abs_limits)
-        self.assertDictMatch(output, expected_limits)
+        self.assertDictMatch(expected_limits, output)
 
 
 class LimitsXMLSerializationTest(test.TestCase):
index cdb9b4e8348afa4b396dabee20b309cf8d431944..773c3ce22f401f087d7f9ab0fd719c0c3897431c 100644 (file)
@@ -130,7 +130,7 @@ class VolumeTypesApiTest(test.TestCase):
                                     description=None,
                                     is_public=None,
                                     id=42)
-        self.assertDictMatch(output['volume_type'], expected_volume_type)
+        self.assertDictMatch(expected_volume_type, output['volume_type'])
 
     def test_view_builder_list(self):
         view_builder = views_types.ViewBuilder()
@@ -157,8 +157,8 @@ class VolumeTypesApiTest(test.TestCase):
                                         id=42 + i,
                                         is_public=None,
                                         description=None)
-            self.assertDictMatch(output['volume_types'][i],
-                                 expected_volume_type)
+            self.assertDictMatch(expected_volume_type,
+                                 output['volume_types'][i])
 
 
 class VolumeTypesSerializerTest(test.TestCase):
index d05e28d99e6d8e7c6e2ffd6210739c672527504a..1b11631e7e0648bd3b3bd7291ff8de33bf679bc1 100644 (file)
@@ -173,7 +173,7 @@ class VolumeTypesApiTest(test.TestCase):
             is_public=True,
             id=42,
         )
-        self.assertDictMatch(output['volume_type'], expected_volume_type)
+        self.assertDictMatch(expected_volume_type, output['volume_type'])
 
     def test_view_builder_show_admin(self):
         view_builder = views_types.ViewBuilder()
@@ -238,8 +238,8 @@ class VolumeTypesApiTest(test.TestCase):
                 is_public=True,
                 id=42 + i
             )
-            self.assertDictMatch(output['volume_types'][i],
-                                 expected_volume_type)
+            self.assertDictMatch(expected_volume_type,
+                                 output['volume_types'][i])
 
     def test_view_builder_list_admin(self):
         view_builder = views_types.ViewBuilder()
index eaabb5a9eac31e657c557d39c7c836131ac8acbf..6326243bb807caf1a6da15ab5d57eb2c2cc1f7f5 100644 (file)
@@ -77,7 +77,7 @@ class QualityOfServiceSpecsTableTestCase(test.TestCase):
         expected = dict(name='Name1', id=specs_id, consumer='front-end')
         del value['consumer']
         expected.update(dict(specs=value))
-        self.assertDictMatch(specs, expected)
+        self.assertDictMatch(expected, specs)
 
     def test_qos_specs_get_all(self):
         value1 = dict(consumer='front-end',
@@ -119,7 +119,7 @@ class QualityOfServiceSpecsTableTestCase(test.TestCase):
                     'id': specs_id,
                     'consumer': 'front-end',
                     'specs': value}
-        self.assertDictMatch(specs, expected)
+        self.assertDictMatch(expected, specs)
 
     def test_qos_specs_delete(self):
         name = str(int(time.time()))
@@ -143,7 +143,7 @@ class QualityOfServiceSpecsTableTestCase(test.TestCase):
                     'specs': value}
         db.qos_specs_item_delete(self.ctxt, specs_id, 'foo')
         specs = db.qos_specs_get_by_name(self.ctxt, name)
-        self.assertDictMatch(specs, expected)
+        self.assertDictMatch(expected, specs)
 
     def test_associate_type_with_qos(self):
         self.assertRaises(exception.VolumeTypeNotFound,
index 8a265e1083498836dd9424cd0c58f88e8352bd44..9084f10e80e3c3a4a6e8c5acf60fd34cf461d3e1 100644 (file)
@@ -149,10 +149,10 @@ class TestGlanceImageService(test.TestCase):
             'properties': {'instance_id': '42', 'user_id': 'fake'},
             'owner': None,
         }
-        self.assertDictMatch(image_meta, expected)
+        self.assertDictMatch(expected, image_meta)
 
         image_metas = self.service.detail(self.context)
-        self.assertDictMatch(image_metas[0], expected)
+        self.assertDictMatch(expected, image_metas[0])
 
     def test_create_without_instance_id(self):
         """Test Creating images without instance_id.
@@ -183,7 +183,7 @@ class TestGlanceImageService(test.TestCase):
             'owner': None,
         }
         actual = self.service.show(self.context, image_id)
-        self.assertDictMatch(actual, expected)
+        self.assertDictMatch(expected, actual)
 
     def test_create(self):
         fixture = self._make_fixture(name='test image')
@@ -254,7 +254,7 @@ class TestGlanceImageService(test.TestCase):
                 'owner': None,
             }
 
-            self.assertDictMatch(meta, expected)
+            self.assertDictMatch(expected, meta)
             i = i + 1
 
     def test_detail_limit(self):
@@ -310,7 +310,7 @@ class TestGlanceImageService(test.TestCase):
                 'deleted': None,
                 'owner': None,
             }
-            self.assertDictMatch(meta, expected)
+            self.assertDictMatch(expected, meta)
             i = i + 1
 
     def test_detail_invalid_marker(self):
index 6d89f7ee21f51c87cfa18a65ed5e5164ab5860fb..c31292c9d31d01552f3021a71216bb42810b777f 100644 (file)
@@ -91,7 +91,7 @@ class HostManagerTestCase(test.TestCase):
     @mock.patch('oslo_utils.timeutils.utcnow')
     def test_update_service_capabilities(self, _mock_utcnow):
         service_states = self.host_manager.service_states
-        self.assertDictMatch(service_states, {})
+        self.assertDictMatch({}, service_states)
         _mock_utcnow.side_effect = [31337, 31338, 31339]
 
         host1_volume_capabs = dict(free_capacity_gb=4321, timestamp=1)
@@ -610,4 +610,4 @@ class PoolStateTestCase(test.TestCase):
         self.assertEqual(512,
                          fake_pool.provisioned_capacity_gb)
 
-        self.assertDictMatch(fake_pool.capabilities, volume_capability)
+        self.assertDictMatch(volume_capability, fake_pool.capabilities)
index eb665bbd0b958d86260b9c84907825439d658e70..df6d19421aec3b8bdee37231e99be704e0b73e8c 100644 (file)
@@ -3599,7 +3599,7 @@ class TestHPE3PARFCDriver(HPE3PARBaseDriver, test.TestCase):
                 expected +
                 self.standard_logout)
 
-            self.assertDictMatch(result, self.properties)
+            self.assertDictMatch(self.properties, result)
 
     @mock.patch('cinder.zonemanager.utils.create_lookup_service')
     def test_initialize_connection_with_lookup_single_nsp(self, mock_lookup):
@@ -3692,7 +3692,7 @@ class TestHPE3PARFCDriver(HPE3PARBaseDriver, test.TestCase):
                 expected +
                 self.standard_logout)
 
-            self.assertDictMatch(result, expected_properties)
+            self.assertDictMatch(expected_properties, result)
 
     def test_initialize_connection_encrypted(self):
         # setup_mock_client drive with default configuration
@@ -3767,7 +3767,7 @@ class TestHPE3PARFCDriver(HPE3PARBaseDriver, test.TestCase):
 
             expected_properties = self.properties
             expected_properties['data']['encrypted'] = True
-            self.assertDictMatch(result, expected_properties)
+            self.assertDictMatch(expected_properties, result)
 
     def test_terminate_connection(self):
         # setup_mock_client drive with default configuration
@@ -4527,7 +4527,7 @@ class TestHPE3PARISCSIDriver(HPE3PARBaseDriver, test.TestCase):
                 expected +
                 self.standard_logout)
 
-            self.assertDictMatch(result, self.properties)
+            self.assertDictMatch(self.properties, result)
 
     def test_initialize_connection_multipath(self):
         # setup_mock_client drive with default configuration
@@ -4699,7 +4699,7 @@ class TestHPE3PARISCSIDriver(HPE3PARBaseDriver, test.TestCase):
 
             expected_properties = self.properties
             expected_properties['data']['encrypted'] = True
-            self.assertDictMatch(result, self.properties)
+            self.assertDictMatch(self.properties, result)
 
     def test_get_volume_stats(self):
         # setup_mock_client drive with the configuration
index e1eee13dd395e222b1681f828ade1aeadf6241a6..acd437a7f19bc21a169442a6196c03117110bce2 100644 (file)
@@ -509,7 +509,7 @@ class TestHPLeftHandCLIQISCSIDriver(HPLeftHandBaseDriver, test.TestCase):
         result = self.driver.initialize_connection(volume,
                                                    self.connector)
         self.assertEqual('iscsi', result['driver_volume_type'])
-        self.assertDictMatch(result['data'], self.properties)
+        self.assertDictMatch(self.properties, result['data'])
 
         expected = [
             mock.call(
index 6533baca16e8ae93f9d194e33cbe3e6cfe4d4502..0e7614773276ee8edb7fea92a15d2557ec2ea321 100644 (file)
@@ -2170,9 +2170,9 @@ class InfortrendCLITestCase(test.TestCase):
 
         if isinstance(out, list):
             for i in range(len(test_data[1])):
-                self.assertDictMatch(out[i], test_data[1][i])
+                self.assertDictMatch(test_data[1][i], out[i])
         else:
-            self.assertDictMatch(out, test_data[1])
+            self.assertDictMatch(test_data[1], out)
 
     @mock.patch.object(cli.LOG, 'debug', mock.Mock())
     def test_cli_all_command_execute(self):
index 2995148229ceee64624e898af273ee3e169e58a3..fb5d61e0ad33df757f84f2963ffc4d57cdb5edba 100644 (file)
@@ -123,8 +123,8 @@ class InfortrendFCCommonTestCase(InfortrendTestCass):
 
         self.driver._init_map_info(True)
 
-        self.assertDictMatch(self.driver.map_dict, test_map_dict)
-        self.assertDictMatch(self.driver.target_dict, test_target_dict)
+        self.assertDictMatch(test_map_dict, self.driver.map_dict)
+        self.assertDictMatch(test_target_dict, self.driver.target_dict)
 
     def test_normal_channel_with_r_model(self):
 
@@ -143,8 +143,8 @@ class InfortrendFCCommonTestCase(InfortrendTestCass):
 
         self.driver._init_map_info(True)
 
-        self.assertDictMatch(self.driver.map_dict, test_map_dict)
-        self.assertDictMatch(self.driver.target_dict, test_target_dict)
+        self.assertDictMatch(test_map_dict, self.driver.map_dict)
+        self.assertDictMatch(test_target_dict, self.driver.target_dict)
 
     @mock.patch.object(common_cli.LOG, 'info', mock.Mock())
     def test_initialize_connection(self):
@@ -163,7 +163,7 @@ class InfortrendFCCommonTestCase(InfortrendTestCass):
         properties = self.driver.initialize_connection(
             test_volume, test_connector)
 
-        self.assertDictMatch(properties, self.cli_data.test_fc_properties)
+        self.assertDictMatch(self.cli_data.test_fc_properties, properties)
 
     @mock.patch.object(common_cli.LOG, 'info', mock.Mock())
     def test_initialize_connection_specific_channel(self):
@@ -185,7 +185,7 @@ class InfortrendFCCommonTestCase(InfortrendTestCass):
             test_volume, test_connector)
 
         self.assertDictMatch(
-            properties, self.cli_data.test_fc_properties_with_specific_channel)
+            self.cli_data.test_fc_properties_with_specific_channel, properties)
 
     @mock.patch.object(common_cli.LOG, 'info', mock.Mock())
     def test_initialize_connection_with_diff_target_id(self):
@@ -219,7 +219,7 @@ class InfortrendFCCommonTestCase(InfortrendTestCass):
         self._assert_cli_has_calls(expect_cli_cmd)
 
         self.assertDictMatch(
-            properties, self.cli_data.test_fc_properties_with_specific_channel)
+            self.cli_data.test_fc_properties_with_specific_channel, properties)
 
     @mock.patch.object(common_cli.LOG, 'info', mock.Mock())
     def test_initialize_connection_multipath_with_r_model(self):
@@ -239,7 +239,7 @@ class InfortrendFCCommonTestCase(InfortrendTestCass):
             test_volume, test_connector)
 
         self.assertDictMatch(
-            properties, self.cli_data.test_fc_properties_multipath_r_model)
+            self.cli_data.test_fc_properties_multipath_r_model, properties)
 
     def test_initialize_connection_with_get_wwn_fail(self):
 
@@ -305,7 +305,7 @@ class InfortrendFCCommonTestCase(InfortrendTestCass):
         self._assert_cli_has_calls(expect_cli_cmd)
 
         self.assertDictMatch(
-            properties, self.cli_data.test_fc_properties_zoning)
+            self.cli_data.test_fc_properties_zoning, properties)
 
     @mock.patch.object(common_cli.LOG, 'info', mock.Mock())
     def test_initialize_connection_with_zoning_r_model(self):
@@ -354,7 +354,7 @@ class InfortrendFCCommonTestCase(InfortrendTestCass):
         self._assert_cli_has_calls(expect_cli_cmd)
 
         self.assertDictMatch(
-            properties, self.cli_data.test_fc_properties_zoning_r_model)
+            self.cli_data.test_fc_properties_zoning_r_model, properties)
 
     @mock.patch.object(common_cli.LOG, 'info', mock.Mock())
     def test_initialize_connection_with_zoning_r_model_diff_target_id(self):
@@ -404,7 +404,7 @@ class InfortrendFCCommonTestCase(InfortrendTestCass):
         self._assert_cli_has_calls(expect_cli_cmd)
 
         self.assertDictMatch(
-            properties, self.cli_data.test_fc_properties_zoning_r_model)
+            self.cli_data.test_fc_properties_zoning_r_model, properties)
 
     @mock.patch.object(common_cli.LOG, 'info', mock.Mock())
     def test_terminate_connection(self):
@@ -465,7 +465,7 @@ class InfortrendFCCommonTestCase(InfortrendTestCass):
         self._assert_cli_has_calls(expect_cli_cmd)
 
         self.assertDictMatch(
-            conn_info, self.cli_data.test_fc_terminate_conn_info)
+            self.cli_data.test_fc_terminate_conn_info, conn_info)
 
     @mock.patch.object(common_cli.LOG, 'info', mock.Mock())
     def test_terminate_connection_with_zoning_and_lun_map_exist(self):
@@ -598,8 +598,8 @@ class InfortrendiSCSICommonTestCase(InfortrendTestCass):
 
         self.driver._init_map_info()
 
-        self.assertDictMatch(self.driver.map_dict, test_map_dict)
-        self.assertDictMatch(self.driver.target_dict, test_target_dict)
+        self.assertDictMatch(test_map_dict, self.driver.map_dict)
+        self.assertDictMatch(test_target_dict, self.driver.target_dict)
 
     def test_normal_channel_with_multipath(self):
 
@@ -618,8 +618,8 @@ class InfortrendiSCSICommonTestCase(InfortrendTestCass):
 
         self.driver._init_map_info(multipath=True)
 
-        self.assertDictMatch(self.driver.map_dict, test_map_dict)
-        self.assertDictMatch(self.driver.target_dict, test_target_dict)
+        self.assertDictMatch(test_map_dict, self.driver.map_dict)
+        self.assertDictMatch(test_target_dict, self.driver.target_dict)
 
     def test_specific_channel(self):
 
@@ -641,8 +641,8 @@ class InfortrendiSCSICommonTestCase(InfortrendTestCass):
 
         self.driver._init_map_info()
 
-        self.assertDictMatch(self.driver.map_dict, test_map_dict)
-        self.assertDictMatch(self.driver.target_dict, test_target_dict)
+        self.assertDictMatch(test_map_dict, self.driver.map_dict)
+        self.assertDictMatch(test_target_dict, self.driver.target_dict)
 
     def test_update_mcs_dict(self):
 
@@ -660,7 +660,7 @@ class InfortrendiSCSICommonTestCase(InfortrendTestCass):
 
         self.driver._init_map_info()
 
-        self.assertDictMatch(self.driver.mcs_dict, test_mcs_dict)
+        self.assertDictMatch(test_mcs_dict, self.driver.mcs_dict)
 
     def test_mapping_info_with_mcs(self):
 
@@ -688,7 +688,7 @@ class InfortrendiSCSICommonTestCase(InfortrendTestCass):
 
         map_chl, map_lun, mcs_id = self.driver._get_mapping_info_with_mcs()
 
-        self.assertDictMatch(map_chl, test_map_chl)
+        self.assertDictMatch(test_map_chl, map_chl)
         self.assertEqual(test_map_lun, map_lun)
         self.assertEqual(test_mcs_id, mcs_id)
 
@@ -724,7 +724,7 @@ class InfortrendiSCSICommonTestCase(InfortrendTestCass):
 
         map_chl, map_lun, mcs_id = self.driver._get_mapping_info_with_mcs()
 
-        self.assertDictMatch(map_chl, test_map_chl)
+        self.assertDictMatch(test_map_chl, map_chl)
         self.assertEqual(test_map_lun, map_lun)
         self.assertEqual(test_mcs_id, mcs_id)
 
@@ -748,8 +748,8 @@ class InfortrendiSCSICommonTestCase(InfortrendTestCass):
 
         self.driver._init_map_info(multipath=True)
 
-        self.assertDictMatch(self.driver.map_dict, test_map_dict)
-        self.assertDictMatch(self.driver.target_dict, test_target_dict)
+        self.assertDictMatch(test_map_dict, self.driver.map_dict)
+        self.assertDictMatch(test_target_dict, self.driver.target_dict)
 
     def test_specific_channel_with_multipath_r_model(self):
 
@@ -772,8 +772,8 @@ class InfortrendiSCSICommonTestCase(InfortrendTestCass):
 
         self.driver._init_map_info(multipath=True)
 
-        self.assertDictMatch(self.driver.map_dict, test_map_dict)
-        self.assertDictMatch(self.driver.target_dict, test_target_dict)
+        self.assertDictMatch(test_map_dict, self.driver.map_dict)
+        self.assertDictMatch(test_target_dict, self.driver.target_dict)
 
     @mock.patch.object(common_cli.LOG, 'info')
     def test_create_volume(self, log_info):
@@ -795,7 +795,7 @@ class InfortrendiSCSICommonTestCase(InfortrendTestCass):
 
         model_update = self.driver.create_volume(test_volume)
 
-        self.assertDictMatch(model_update, test_model_update)
+        self.assertDictMatch(test_model_update, model_update)
         self.assertEqual(1, log_info.call_count)
 
     @mock.patch.object(common_cli.LOG, 'info', mock.Mock())
@@ -970,7 +970,7 @@ class InfortrendiSCSICommonTestCase(InfortrendTestCass):
         model_update = self.driver.create_cloned_volume(
             test_dst_volume, test_src_volume)
 
-        self.assertDictMatch(model_update, test_model_update)
+        self.assertDictMatch(test_model_update, model_update)
         self.assertEqual(1, log_info.call_count)
 
     @mock.patch.object(common_cli.LOG, 'info', mock.Mock())
@@ -1005,7 +1005,7 @@ class InfortrendiSCSICommonTestCase(InfortrendTestCass):
 
         model_update = self.driver.create_export(None, test_volume)
 
-        self.assertDictMatch(model_update, test_model_update)
+        self.assertDictMatch(test_model_update, model_update)
 
     @mock.patch.object(common_cli.LOG, 'info', mock.Mock())
     def test_get_volume_stats(self):
@@ -1022,7 +1022,7 @@ class InfortrendiSCSICommonTestCase(InfortrendTestCass):
 
         volume_states = self.driver.get_volume_stats(True)
 
-        self.assertDictMatch(volume_states, test_volume_states)
+        self.assertDictMatch(test_volume_states, volume_states)
 
     def test_get_volume_stats_fail(self):
 
@@ -1204,7 +1204,7 @@ class InfortrendiSCSICommonTestCase(InfortrendTestCass):
         model_update = self.driver.create_volume_from_snapshot(
             test_dst_volume, test_snapshot)
 
-        self.assertDictMatch(model_update, test_model_update)
+        self.assertDictMatch(test_model_update, model_update)
         self.assertEqual(1, log_info.call_count)
 
     @mock.patch('oslo_service.loopingcall.FixedIntervalLoopingCall',
@@ -1243,7 +1243,7 @@ class InfortrendiSCSICommonTestCase(InfortrendTestCass):
         model_update = self.driver.create_volume_from_snapshot(
             test_dst_volume, test_snapshot)
 
-        self.assertDictMatch(model_update, test_model_update)
+        self.assertDictMatch(test_model_update, model_update)
         self.assertEqual(1, log_info.call_count)
 
     def test_create_volume_from_snapshot_without_provider_location(
@@ -1287,7 +1287,7 @@ class InfortrendiSCSICommonTestCase(InfortrendTestCass):
         properties = self.driver.initialize_connection(
             test_volume, test_connector)
 
-        self.assertDictMatch(properties, test_iscsi_properties)
+        self.assertDictMatch(test_iscsi_properties, properties)
 
         expect_cli_cmd = [
             mock.call('CreateMap', 'part', test_partition_id, '2', '0', '0',
@@ -1324,7 +1324,7 @@ class InfortrendiSCSICommonTestCase(InfortrendTestCass):
         properties = self.driver.initialize_connection(
             test_volume, test_connector)
 
-        self.assertDictMatch(properties, test_iscsi_properties)
+        self.assertDictMatch(test_iscsi_properties, properties)
 
         expect_cli_cmd = [
             mock.call('CreateIQN', test_initiator, test_initiator[-16:]),
@@ -1359,7 +1359,7 @@ class InfortrendiSCSICommonTestCase(InfortrendTestCass):
             test_volume, test_connector)
 
         self.assertDictMatch(
-            properties, self.cli_data.test_iscsi_properties_empty_map)
+            self.cli_data.test_iscsi_properties_empty_map, properties)
 
     def test_initialize_connection_with_create_map_fail(self):
 
@@ -1430,7 +1430,7 @@ class InfortrendiSCSICommonTestCase(InfortrendTestCass):
         properties = self.driver.initialize_connection(
             test_volume, test_connector)
 
-        self.assertDictMatch(properties, test_iscsi_properties)
+        self.assertDictMatch(test_iscsi_properties, properties)
 
         expect_cli_cmd = [
             mock.call('CreateMap', 'part', test_partition_id, '1', '0', '2',
@@ -1588,7 +1588,7 @@ class InfortrendiSCSICommonTestCase(InfortrendTestCass):
         ]
         self._assert_cli_has_calls(expect_cli_cmd)
         self.assertTrue(rc)
-        self.assertDictMatch(model_update, test_model_update)
+        self.assertDictMatch(test_model_update, model_update)
 
     @mock.patch.object(common_cli.LOG, 'warning')
     def test_migrate_volume_with_invalid_storage(self, log_warning):
@@ -1833,7 +1833,7 @@ class InfortrendiSCSICommonTestCase(InfortrendTestCass):
         ]
         self._assert_cli_has_calls(expect_cli_cmd)
         self.assertEqual(1, log_info.call_count)
-        self.assertDictMatch(model_update, test_model_update)
+        self.assertDictMatch(test_model_update, model_update)
 
     def test_manage_existing_rename_fail(self):
 
@@ -1903,7 +1903,7 @@ class InfortrendiSCSICommonTestCase(InfortrendTestCass):
         ]
         self._assert_cli_has_calls(expect_cli_cmd)
         self.assertEqual(1, log_info.call_count)
-        self.assertDictMatch(model_update, test_model_update)
+        self.assertDictMatch(test_model_update, model_update)
 
     @mock.patch.object(common_cli.LOG, 'info')
     def test_unmanage(self, log_info):
@@ -2022,7 +2022,7 @@ class InfortrendiSCSICommonTestCase(InfortrendTestCass):
         ]
         self._assert_cli_has_calls(expect_cli_cmd)
         self.assertTrue(rc)
-        self.assertDictMatch(model_update, test_model_update)
+        self.assertDictMatch(test_model_update, model_update)
 
     @mock.patch.object(common_cli.LOG, 'debug', mock.Mock())
     @mock.patch.object(common_cli.LOG, 'info', mock.Mock())
index 56c4060d38b0d06f06b3e5bea1b8753687417a40..f840e46abcbca9e1cf338fce4e17a2196e29927f 100644 (file)
@@ -696,7 +696,7 @@ class TestProphetStorDPLDriver(test.TestCase):
             self._conver_uuid2hex(DATA_IN_GROUP['id']))
         self.DPL_MOCK.delete_vdev.assert_called_once_with(
             self._conver_uuid2hex((DATA_IN_VOLUME_VG['id'])))
-        self.assertDictMatch({'status': 'deleted'}, model_update)
+        self.assertDictMatch({'status': 'deleted'}, model_update)
 
     def test_update_consistencygroup(self):
         self.DPL_MOCK.get_vg.return_value = (0, DATA_OUT_CG)
index e397aa5e8e9b845fc90d40f8086aea16033b2252..ef4048dcac58fe292dfbfb5f87bcb3794c1e04b3 100644 (file)
@@ -67,7 +67,7 @@ class QoSSpecsTestCase(test.TestCase):
         expected.update(dict(name='FakeName'))
         del input['consumer']
         expected.update(dict(specs=input))
-        self.assertDictMatch(specs, expected)
+        self.assertDictMatch(expected, specs)
 
         self.stubs.Set(db, 'qos_specs_create',
                        fake_db_qos_specs_create)
index a42b7bb048a75323bca3b58d4cd81b9a8a7e6b46..4598fec30f039ce07b5a8291506daea8882d9761 100644 (file)
@@ -111,7 +111,7 @@ class TestBrcdFCSanLookupService(brcd_lookup.BrcdFCSanLookupService,
         get_nameserver_info_mock.return_value = parsed_switch_port_wwns
         device_map = self.get_device_mapping_from_network(
             initiator_list, target_list)
-        self.assertDictMatch(device_map, _device_map_to_verify)
+        self.assertDictMatch(_device_map_to_verify, device_map)
 
     @mock.patch.object(brcd_lookup.BrcdFCSanLookupService, '_get_switch_data')
     def test_get_nameserver_info(self, get_switch_data_mock):
index 3f1c188769de6ceaa9f78136ba3494ff4763283b..b603067811b7995863db52e9a34b3a15d64d9933 100644 (file)
@@ -82,7 +82,7 @@ class TestBrcdFCZoneClientCLI(client_cli.BrcdFCZoneClientCLI, test.TestCase):
         get_switch_info_mock.return_value = cfgactvshow
         active_zoneset_returned = self.get_active_zone_set()
         get_switch_info_mock.assert_called_once_with(cmd_list)
-        self.assertDictMatch(active_zoneset_returned, active_zoneset)
+        self.assertDictMatch(active_zoneset, active_zoneset_returned)
 
     @mock.patch.object(client_cli.BrcdFCZoneClientCLI, '_run_ssh')
     def test_get_active_zone_set_ssh_error(self, run_ssh_mock):
index 17f860ebe4fd9e9ec09b0c68403fc424693d7c66..8a5d076f4740e1c3eac158045edb686294052141 100644 (file)
@@ -57,7 +57,7 @@ class TestFCSanLookupService(san_service.FCSanLookupService, test.TestCase):
         target_list = ['20240002ac000a50', '20240002ac000a40']
         device_map = self.get_device_mapping_from_network(
             initiator_list, target_list)
-        self.assertDictMatch(device_map, _device_map_to_verify)
+        self.assertDictMatch(_device_map_to_verify, device_map)
 
     def test_get_device_mapping_from_network_for_invalid_config(self):
         GlobalParams._is_normal_test = False
index 6ca16d33fd7c08f6b48969f22e632371408de178..1542853266daeaf70df78d4fcec573c80ad91ddc 100644 (file)
@@ -85,7 +85,7 @@ class TestCiscoFCSanLookupService(cisco_lookup.CiscoFCSanLookupService,
         get_nameserver_info_mock.return_value = (nsshow_data)
         device_map = self.get_device_mapping_from_network(
             initiator_list, target_list)
-        self.assertDictMatch(device_map, _device_map_to_verify)
+        self.assertDictMatch(_device_map_to_verify, device_map)
 
     @mock.patch.object(cisco_lookup.CiscoFCSanLookupService,
                        '_get_switch_info')
index 60b2421cb07fc47c221186e9f7e790e12b7d6aff..9e63a9c2b2def31dd5faab790f349ee843692920 100644 (file)
@@ -139,7 +139,7 @@ class TestCiscoFCZoneClientCLI(cli.CiscoFCZoneClientCLI, test.TestCase):
         get_switch_info_mock.return_value = cfgactv
         active_zoneset_returned = self.get_active_zone_set()
         get_switch_info_mock.assert_called_once_with(cmd_list)
-        self.assertDictMatch(active_zoneset_returned, active_zoneset)
+        self.assertDictMatch(active_zoneset, active_zoneset_returned)
 
     @mock.patch.object(cli.CiscoFCZoneClientCLI, '_run_ssh')
     def test_get_active_zone_set_ssh_error(self, run_ssh_mock):
@@ -153,7 +153,7 @@ class TestCiscoFCZoneClientCLI(cli.CiscoFCZoneClientCLI, test.TestCase):
         get_zoning_status_mock.return_value = zoning_status_data_basic
         zoning_status_returned = self.get_zoning_status()
         get_zoning_status_mock.assert_called_once_with(cmd_list)
-        self.assertDictMatch(zoning_status_returned, zoning_status_basic)
+        self.assertDictMatch(zoning_status_basic, zoning_status_returned)
 
     @mock.patch.object(cli.CiscoFCZoneClientCLI, '_get_switch_info')
     def test_get_zoning_status_enhanced_nosess(self, get_zoning_status_mock):
@@ -162,8 +162,8 @@ class TestCiscoFCZoneClientCLI(cli.CiscoFCZoneClientCLI, test.TestCase):
             zoning_status_data_enhanced_nosess
         zoning_status_returned = self.get_zoning_status()
         get_zoning_status_mock.assert_called_once_with(cmd_list)
-        self.assertDictMatch(zoning_status_returned,
-                             zoning_status_enhanced_nosess)
+        self.assertDictMatch(zoning_status_enhanced_nosess,
+                             zoning_status_returned)
 
     @mock.patch.object(cli.CiscoFCZoneClientCLI, '_get_switch_info')
     def test_get_zoning_status_enhanced_sess(self, get_zoning_status_mock):
@@ -171,8 +171,8 @@ class TestCiscoFCZoneClientCLI(cli.CiscoFCZoneClientCLI, test.TestCase):
         get_zoning_status_mock.return_value = zoning_status_data_enhanced_sess
         zoning_status_returned = self.get_zoning_status()
         get_zoning_status_mock.assert_called_once_with(cmd_list)
-        self.assertDictMatch(zoning_status_returned,
-                             zoning_status_enhanced_sess)
+        self.assertDictMatch(zoning_status_enhanced_sess,
+                             zoning_status_returned)
 
     @mock.patch.object(cli.CiscoFCZoneClientCLI, '_get_switch_info')
     def test_get_nameserver_info(self, get_switch_info_mock):
index b2b4c171cde479efde335e6a349274b80d2d028f..678fd83da2b373ed87f63dcc464e33da2c4f2bcf 100644 (file)
@@ -55,7 +55,7 @@ class TestFCSanLookupService(san_service.FCSanLookupService, test.TestCase):
         target_list = ['20240002ac000a50', '20240002ac000a40']
         device_map = self.get_device_mapping_from_network(
             initiator_list, target_list)
-        self.assertDictMatch(device_map, _device_map_to_verify)
+        self.assertDictMatch(_device_map_to_verify, device_map)
 
     def test_get_device_mapping_from_network_for_invalid_config(self):
         GlobalParams._is_normal_test = False