diff --git a/manila/tests/api/v1/test_share_snapshots.py b/manila/tests/api/v1/test_share_snapshots.py index 696398acf8..2e75e638c7 100644 --- a/manila/tests/api/v1/test_share_snapshots.py +++ b/manila/tests/api/v1/test_share_snapshots.py @@ -340,7 +340,7 @@ class ShareSnapshotApiTest(test.TestCase): }, ] } - self.assertEqual(res_dict, expected) + self.assertEqual(expected, res_dict) def test_snapshot_updates_description(self): snp = self.snp_example @@ -348,7 +348,7 @@ class ShareSnapshotApiTest(test.TestCase): req = fakes.HTTPRequest.blank('/snapshot/1') res_dict = self.controller.update(req, 1, body) - self.assertEqual(res_dict['snapshot']["name"], snp["display_name"]) + self.assertEqual(snp["display_name"], res_dict['snapshot']["name"]) def test_snapshot_updates_display_descr(self): snp = self.snp_example @@ -357,8 +357,8 @@ class ShareSnapshotApiTest(test.TestCase): req = fakes.HTTPRequest.blank('/snapshot/1') res_dict = self.controller.update(req, 1, body) - self.assertEqual(res_dict['snapshot']["description"], - snp["display_description"]) + self.assertEqual(snp["display_description"], + res_dict['snapshot']["description"]) def test_share_not_updates_size(self): snp = self.snp_example @@ -367,4 +367,4 @@ class ShareSnapshotApiTest(test.TestCase): req = fakes.HTTPRequest.blank('/snapshot/1') res_dict = self.controller.update(req, 1, body) - self.assertNotEqual(res_dict['snapshot']["size"], snp["size"]) + self.assertNotEqual(snp["size"], res_dict['snapshot']["size"]) diff --git a/manila/tests/scheduler/test_host_manager.py b/manila/tests/scheduler/test_host_manager.py index 647d20b45e..6623478625 100644 --- a/manila/tests/scheduler/test_host_manager.py +++ b/manila/tests/scheduler/test_host_manager.py @@ -77,7 +77,7 @@ class HostManagerTestCase(test.TestCase): for x in info['got_fprops']: self.assertEqual(info['expected_fprops'], x) self.assertEqual(set(info['expected_objs']), set(info['got_objs'])) - self.assertEqual(set(result), set(info['got_objs'])) + self.assertEqual(set(info['got_objs']), set(result)) def test_get_filtered_hosts(self): fake_properties = {'moo': 1, 'cow': 2} diff --git a/manila/tests/scheduler/test_rpcapi.py b/manila/tests/scheduler/test_rpcapi.py index d72a6c2cd8..ff606b0d49 100644 --- a/manila/tests/scheduler/test_rpcapi.py +++ b/manila/tests/scheduler/test_rpcapi.py @@ -52,7 +52,7 @@ class SchedulerRpcAPITestCase(test.TestCase): def _fake_prepare_method(*args, **kwds): for kwd in kwds: - self.assertEqual(kwds[kwd], target[kwd]) + self.assertEqual(target[kwd], kwds[kwd]) return rpcapi.client def _fake_rpc_method(*args, **kwargs): @@ -67,10 +67,10 @@ class SchedulerRpcAPITestCase(test.TestCase): with mock.patch.object(rpcapi.client, rpc_method) as mock_method: mock_method.side_effect = _fake_rpc_method retval = getattr(rpcapi, method)(ctxt, **kwargs) - self.assertEqual(retval, expected_retval) + self.assertEqual(expected_retval, retval) expected_args = [ctxt, method, expected_msg] for arg, expected_arg in zip(self.fake_args, expected_args): - self.assertEqual(arg, expected_arg) + self.assertEqual(expected_arg, arg) def test_update_service_capabilities(self): self._test_scheduler_api('update_service_capabilities', diff --git a/manila/tests/scheduler/test_scheduler.py b/manila/tests/scheduler/test_scheduler.py index 87856ee5b0..8fc71c7e52 100644 --- a/manila/tests/scheduler/test_scheduler.py +++ b/manila/tests/scheduler/test_scheduler.py @@ -216,7 +216,7 @@ class SchedulerTestCase(test.TestCase): with mock.patch.object(utils, 'service_is_up', mock.Mock(side_effect=fake_service_is_up)): result = self.driver.hosts_up(self.context, self.topic) - self.assertEqual(result, ['host2']) + self.assertEqual(['host2'], result) db.service_get_all_by_topic.assert_called_once_with( self.context, self.topic) diff --git a/manila/tests/volume/test_cinder.py b/manila/tests/volume/test_cinder.py index 1c36ec208d..cde177bbef 100644 --- a/manila/tests/volume/test_cinder.py +++ b/manila/tests/volume/test_cinder.py @@ -59,7 +59,7 @@ class CinderApiTestCase(test.TestCase): def test_get(self): volume_id = 'volume_id1' result = self.api.get(self.ctx, volume_id) - self.assertEqual(result['id'], volume_id) + self.assertEqual(volume_id, result['id']) @ddt.data( {'cinder_e': cinder_exception.NotFound(404), @@ -75,7 +75,7 @@ class CinderApiTestCase(test.TestCase): def test_create(self): result = self.api.create(self.ctx, 1, '', '') - self.assertEqual(result['id'], 'created_id') + self.assertEqual('created_id', result['id']) def test_create_failed(self): cinder.cinderclient.side_effect = cinder_exception.BadRequest(400) @@ -203,7 +203,7 @@ class CinderApiTestCase(test.TestCase): def test_get_snapshot(self): snapshot_id = 'snapshot_id1' result = self.api.get_snapshot(self.ctx, snapshot_id) - self.assertEqual(result['id'], snapshot_id) + self.assertEqual(snapshot_id, result['id']) def test_get_snapshot_failed(self): cinder.cinderclient.side_effect = cinder_exception.NotFound(404) @@ -218,12 +218,12 @@ class CinderApiTestCase(test.TestCase): def test_create_snapshot(self): result = self.api.create_snapshot(self.ctx, {'id': 'id1'}, '', '') - self.assertEqual(result['id'], 'created_id') + self.assertEqual('created_id', result['id']) def test_create_force(self): result = self.api.create_snapshot_force(self.ctx, {'id': 'id1'}, '', '') - self.assertEqual(result['id'], 'created_id') + self.assertEqual('created_id', result['id']) def test_delete_snapshot(self): self.mock_object(self.cinderclient.volume_snapshots, 'delete')