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/virt/ironic/test_driver.py
NOTE(takashin): The conflict is due to not having the following change
in stable/queens.
I87f085589bb663c519650f307f25d087c88bbdb1
Change-Id: I4b606fce473d064b9bb00213696c075cea020aaf
Closes-Bug: #1840200
(cherry picked from commit ad482e53fb)
(cherry picked from commit fa59033c40)
(cherry picked from commit 8e7e54f60b)