Skip to content

Instantly share code, notes, and snippets.

@NMZivkovic

NMZivkovic/mock5.py

Created Mar 9, 2019
Embed
What would you like to do?
def test_multiple_return(self):
m = mock.Mock()
m.get_eleven.return_value = 11
m.get_eleven.side_effect = [12, 13, 14]
self.assertEqual(m.get_eleven(), 12)
self.assertEqual(m.get_eleven(), 13)
self.assertEqual(m.get_eleven(), 14)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment