Skip to content

Instantly share code, notes, and snippets.

@txomon
Created June 11, 2014 08:04
Show Gist options
  • Save txomon/ccd95b036ec5ddbf0959 to your computer and use it in GitHub Desktop.
Save txomon/ccd95b036ec5ddbf0959 to your computer and use it in GitHub Desktop.
Found and error in the mock framework
import mock
def function_badly_called(boolean, integer):
return (boolean, integer)
def function_under_test(integer, boolean):
a,b = (integer, boolean)
function_badly_called(a,b)
function_badly_called = mock.MagicMock()
function_under_test(0,False)
function_badly_called.assert_called_once_with(False, 0)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment