|
|
|
@ -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
|
|
|
|
|
|
|
|
|
|