Found one more - assert_called_once https://github.com/openstack/ironic/blob/7e4e859363bd87846323c17a40ea0718340cef71/ironic/tests/conductor/test_manager.py#L427
(Pdb) deploy <MagicMock name='tear_down' id='59835280'>
(Pdb) dir(deploy) ['assert_any_call', 'assert_called_once_with', 'assert_called_with', 'assert_has_calls', 'attach_mock', 'call_args', 'call_args_list', 'call_count', 'called', 'configure_mock', 'method_calls', 'mock_add_spec', 'mock_calls', 'reset_mock', 'return_value', 'side_effect']
(Pdb) 'assert_called_once' in dir(deploy) False
(Pdb) deploy.assert_called_once() # This does nothing <MagicMock name='tear_down.assert_called_once()' id='59810832'>
# It appears in interface if called at least once - be careful in your tests! (Pdb) 'assert_called_once' in dir(deploy) True
(Pdb) deploy.assert_called_once() # Still does nothing <MagicMock name='tear_down.assert_called_once()' id='59810832'>
Found one more - assert_called_once https:/ /github. com/openstack/ ironic/ blob/7e4e859363 bd87846323c17a4 0ea0718340cef71 /ironic/ tests/conductor /test_manager. py#L427
(Pdb) deploy
<MagicMock name='tear_down' id='59835280'>
(Pdb) dir(deploy) called_ once_with' , 'assert_ called_ with', 'assert_has_calls', 'attach_mock', 'call_args', 'call_args_list', 'call_count', 'called', 'configure_mock', 'method_calls', 'mock_add_spec', 'mock_calls', 'reset_mock', 'return_value', 'side_effect']
['assert_any_call', 'assert_
(Pdb) 'assert_ called_ once' in dir(deploy)
False
(Pdb) deploy. assert_ called_ once() # This does nothing down.assert_ called_ once()' id='59810832'>
<MagicMock name='tear_
# It appears in interface if called at least once - be careful in your tests! called_ once' in dir(deploy)
(Pdb) 'assert_
True
(Pdb) deploy. assert_ called_ once() # Still does nothing down.assert_ called_ once()' id='59810832'>
<MagicMock name='tear_