The 'has_calls' method does not exist in assertion methods of mock.
Replace the 'has_calls' method with an 'assert_has_calls' method or
an 'assert_called_once_with' method.
Add an 'assertEqual' check before an 'assert_has_calls' method.
Conflicts:
nova/tests/unit/compute/test_compute_mgr.py
NOTE(takashin): The conflict is due to not having the following change
in stable/rocky.
Ic062446e5c620c89aec3065b34bcdc6bf5966275
Change-Id: I4b606fce473d064b9bb00213696c075cea020aaf
Closes-Bug: #1840200
(cherry picked from commit ad482e53fb)
(cherry picked from commit fa59033c40)