Last active
August 29, 2015 14:01
-
-
Save stain/a98cba3cbe32a35a5f1e to your computer and use it in GitHub Desktop.
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
Python 2.7.5+ (default, Sep 19 2013, 13:48:49) | |
[GCC 4.8.1] on linux2 | |
Type "help", "copyright", "credits" or "license" for more information. | |
>>> import mock | |
>>> import select | |
>>> select.select([1], [1,2], [1]) | |
([], [1, 2], []) | |
>>> sel = select.select | |
>>> select.select = mock.Mock() | |
>>> select.select([1], [1,2], [1]) | |
<Mock name='mock()' id='140593171640528'> | |
>>> select.select.return_value | |
<Mock name='mock()' id='140593171640528'> | |
>>> select.select.return_value = "fred" | |
>>> select.select() | |
'fred' | |
>>> select.select.return_value = ([], [1,2], []) | |
>>> select.select([1], [1,2], [1]) | |
([], [1, 2], []) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment