@@ -373,8 +373,7 @@ def test_runforever_calls_tick(self):
373373
374374 def test_runforever_poll_dispatchers (self ):
375375 options = DummyOptions ()
376- poller = DummyPoller (options )
377- poller .result = [6 ], [7 , 8 ]
376+ options .poller .result = [6 ], [7 , 8 ]
378377 supervisord = self ._makeOne (options )
379378 pconfig = DummyPConfig (options , 'foo' , '/bin/foo' ,)
380379 process = DummyProcess (pconfig )
@@ -385,7 +384,6 @@ def test_runforever_poll_dispatchers(self):
385384 error = DummyDispatcher (writable = True , error = OSError )
386385 pgroup .dispatchers = {6 :readable , 7 :writable , 8 :error }
387386 supervisord .process_groups = {'foo' : pgroup }
388- supervisord .poller = poller
389387 options .test = True
390388 supervisord .runforever ()
391389 self .assertEqual (pgroup .transitioned , True )
@@ -395,8 +393,7 @@ def test_runforever_poll_dispatchers(self):
395393
396394 def test_runforever_select_dispatcher_exitnow (self ):
397395 options = DummyOptions ()
398- poller = DummyPoller (options )
399- poller .result = [6 ], []
396+ options .poller .result = [6 ], []
400397 supervisord = self ._makeOne (options )
401398 pconfig = DummyPConfig (options , 'foo' , '/bin/foo' ,)
402399 process = DummyProcess (pconfig )
@@ -406,7 +403,6 @@ def test_runforever_select_dispatcher_exitnow(self):
406403 exitnow = DummyDispatcher (readable = True , error = asyncore .ExitNow )
407404 pgroup .dispatchers = {6 :exitnow }
408405 supervisord .process_groups = {'foo' : pgroup }
409- supervisord .poller = poller
410406 options .test = True
411407 self .assertRaises (asyncore .ExitNow , supervisord .runforever )
412408
@@ -507,19 +503,6 @@ def callback(event):
507503 self .assertEqual (len (L ), 6 )
508504 self .assertEqual (L [- 1 ].__class__ , events .Tick3600Event )
509505
510- class DummyPoller :
511- def __init__ (self , options ):
512- self .result = []
513-
514- def register_readable (self , fd ):
515- pass
516-
517- def register_writable (self , fd ):
518- pass
519-
520- def poll (self , timeout ):
521- return self .result
522-
523506def test_suite ():
524507 return unittest .findTestCases (sys .modules [__name__ ])
525508
0 commit comments