From 8cb9b84f283e58841a58d5d79b15268ca5da504d Mon Sep 17 00:00:00 2001 From: zhufl Date: Thu, 10 Sep 2020 16:45:33 +0800 Subject: [PATCH] Fix invalid assert_has_calls This is to fix the invalid assert_has_calls usage, "assert_has_calls = " should be "assert_has_calls(". Change-Id: Id094dd90efde09b9a835d4492f4a92b8f8ad296e --- nova/tests/unit/compute/test_compute_mgr.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/nova/tests/unit/compute/test_compute_mgr.py b/nova/tests/unit/compute/test_compute_mgr.py index 8fbc3a1e97e0..04825f6a6790 100644 --- a/nova/tests/unit/compute/test_compute_mgr.py +++ b/nova/tests/unit/compute/test_compute_mgr.py @@ -10007,9 +10007,9 @@ class ComputeManagerMigrationTestCase(test.NoDBTestCase, self.compute._remove_remote_volume_connections(self.context, 'fake', bdms, instance) - mock_remove_vol_conn.assert_has_calls = [ + mock_remove_vol_conn.assert_has_calls([ mock.call(self.context, instance, bdm.volume_id, 'fake') for - bdm in bdms] + bdm in bdms]) @mock.patch('nova.compute.rpcapi.ComputeAPI.remove_volume_connection') def test_remove_remote_volume_connections_exc(self, mock_remove_vol_conn): @@ -10036,9 +10036,9 @@ class ComputeManagerMigrationTestCase(test.NoDBTestCase, original_bdms, instance) # Assert that we delete the current attachments - mock_delete_attachment.assert_has_calls = [ + mock_delete_attachment.assert_has_calls([ mock.call(self.context, uuids.vol1_attach), - mock.call(self.context, uuids.vol2_attach)] + mock.call(self.context, uuids.vol2_attach)]) # Assert that we switch the attachment ids and connection_info for each # bdm back to their original values self.assertEqual(uuids.vol1_attach_original,