From e62c3a6fea81c1644d81d42d01b21b22ff230807 Mon Sep 17 00:00:00 2001 From: Takashi Natsume Date: Sat, 15 Oct 2022 16:55:39 +0900 Subject: [PATCH] Fix a wrong assertion method Replace 'called_with' with 'assert_has_calls'. Change-Id: Ie1c825750d892db53fcf7d6b04e91bc6fd5663e8 Signed-off-by: Takashi Natsume --- placement/tests/functional/db/test_allocation.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/placement/tests/functional/db/test_allocation.py b/placement/tests/functional/db/test_allocation.py index 13e9b9499..5e14fcac3 100644 --- a/placement/tests/functional/db/test_allocation.py +++ b/placement/tests/functional/db/test_allocation.py @@ -668,9 +668,9 @@ class TestAllocationListCreateDelete(tb.PlacementDbBaseTestCase): mock_set.side_effect = side_effect alloc_obj.replace_all(self.ctx, alloc_list) self.assertEqual(2, mock_log.debug.call_count) - mock_log.debug.called_with( - 'Retrying allocations write on resource provider ' - 'generation conflict') + mock_log.debug.assert_has_calls( + [mock.call('Retrying allocations write on resource provider ' + 'generation conflict')] * 2) self.assertEqual(3, mock_set.call_count) # Confirm we're using a different rp object after the change