Skip to content

Commit

Permalink
Fix incorrect mock usage
Browse files Browse the repository at this point in the history
test_configure_global_cluster() is using 'has_calls',
but that does not exist in the unittest.mock library.
Use 'assert_has_calls' as eventually this will cause
a test error.

Change-Id: Ica1fa7daaf6c90d988805c33352d3e4246af080d
  • Loading branch information
brianphaley committed Mar 1, 2024
1 parent 96d86a1 commit 2d31e02
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion unit_tests/test_hacluster_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -1077,7 +1077,7 @@ def test_configure_resources_on_remotes_unknown(
@mock.patch('pcmk.commit')
def test_configure_global_cluster(self, mock_commit):
utils.configure_cluster_global(240, 120)
mock_commit.has_calls([
mock_commit.assert_has_calls([
mock.call('crm configure property no-quorum-policy=stop'),
mock.call('crm configure rsc_defaults $id="rsc-options" '
'resource-stickiness="100" failure-timeout=240'),
Expand Down

0 comments on commit 2d31e02

Please sign in to comment.