Skip to content

Instantly share code, notes, and snippets.

@codelahoma
Last active December 6, 2018 20:22
Show Gist options
  • Save codelahoma/e70e9cbbd5e5c72ee897c9485e5ac02b to your computer and use it in GitHub Desktop.
Save codelahoma/e70e9cbbd5e5c72ee897c9485e5ac02b to your computer and use it in GitHub Desktop.
how to check that a method wasn't called on a fudge mock
get_was_called = False
def fake_get():
nonlocal get_was_called
get_was_called = True
mock_equip_obj.provides('get').calls(fake_get)
# interaction that shouldn't call `get`
self.assertFalse(get_was_called)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment