Created
May 20, 2011 02:45
-
-
Save shomah4a/982254 to your computer and use it in GitHub Desktop.
mock
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
import socket | |
import mock | |
@mock.mock(socket) | |
def gethostname(): | |
return 10 | |
@gethostname | |
def mocktest(): | |
socket.gethostname() # => 10 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment