diff options
Diffstat (limited to 'Lib/test')
-rw-r--r-- | Lib/test/test_selectors.py | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/Lib/test/test_selectors.py b/Lib/test/test_selectors.py index fd0481d..c64c87a 100644 --- a/Lib/test/test_selectors.py +++ b/Lib/test/test_selectors.py @@ -6,6 +6,7 @@ import socket from test import support from time import sleep import unittest +import unittest.mock try: from time import monotonic as time except ImportError: @@ -124,6 +125,15 @@ class BaseSelectorTestCase(unittest.TestCase): # modify unknown file obj self.assertRaises(KeyError, s.modify, 999999, selectors.EVENT_READ) + # modify use a shortcut + d3 = object() + s.register = unittest.mock.Mock() + s.unregister = unittest.mock.Mock() + + s.modify(rd, selectors.EVENT_READ, d3) + self.assertFalse(s.register.called) + self.assertFalse(s.unregister.called) + def test_close(self): s = self.SELECTOR() self.addCleanup(s.close) |