mock.assert_called_once() is a no-op that tests nothing. Instead
with mock.assert_called_once_with() should be used (or use
assertEqual(1, mock_obj.call_count) if you don't want to check
parameters).
Add a new HACKING rule for nova to prevent assert_called_once()
usage from creeping in.
Reviewed: https:/ /review. openstack. org/121726 /git.openstack. org/cgit/ openstack/ nova/commit/ ?id=45553a6dda8 4ef6be38150071f 8bb6fa9850a53e
Committed: https:/
Submitter: Jenkins
Branch: master
commit 45553a6dda84ef6 be38150071f8bb6 fa9850a53e
Author: Davanum Srinivas <email address hidden>
Date: Mon Sep 15 21:23:58 2014 -0400
mock. assert_ called_ once() is not a valid method
mock. assert_ called_ once() is a no-op that tests nothing. Instead called_ once_with( ) should be used (or use call_count) if you don't want to check
with mock.assert_
assertEqual(1, mock_obj.
parameters).
Add a new HACKING rule for nova to prevent assert_ called_ once()
usage from creeping in.
Closes-Bug: #1365751
Change-Id: I1055093a1c3179 2b6411a3cd46c80 b8bcaaf78c1