Created
September 17, 2010 11:18
-
-
Save lsolesen/584072 to your computer and use it in GitHub Desktop.
Using mock in python
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
#!/usr/bin/env python | |
from mock import Mock | |
mock_xmlservice = Mock() | |
mock_xmlservice.foo = Mock() | |
mock_xmlservice.foo.return_value = "result" | |
mock_xmlservice.foo() | |
# Will output "result" - so now it works |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment