issue #406: add test.

This commit is contained in:
David Wilson 2018-11-03 12:39:29 +00:00
parent 4230a93557
commit e9a6e4c3d2
1 changed files with 14 additions and 0 deletions

View File

@ -1,6 +1,7 @@
import threading
import mock
import unittest2
import testlib
@ -8,6 +9,19 @@ import testlib
import mitogen.core
class ShutdownTest(testlib.TestCase):
klass = mitogen.core.Broker
def test_poller_closed(self):
broker = self.klass()
actual_close = broker.poller.close
broker.poller.close = mock.Mock()
broker.shutdown()
broker.join()
self.assertEquals(1, len(broker.poller.close.mock_calls))
actual_close()
class DeferSyncTest(testlib.TestCase):
klass = mitogen.core.Broker