Created
March 9, 2019 17:45
-
-
Save NMZivkovic/6ccac94e1ff1e7ab85269e62214a32fe to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def test_verify_called_once(self): | |
m = mock.Mock() | |
m.called_function.return_value = 11 | |
m.called_function() | |
m.called_function.assert_called_once() | |
def test_verify_called_multiple(self): | |
m = mock.Mock() | |
m.called_function.return_value = 11 | |
m.called_function() | |
m.called_function() | |
m.called_function() | |
self.assertEqual(m.called_function.call_count, 3) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment