'Signal handlers are installed in responsed to the C{"during"}
C{"startup"}.'

def test_signalHandlersInstalledDuringStartup(self):

    reactor = self.buildReactor()
    phase = [None]
    def beforeStartup():
        phase[0] = 'before'
    def afterStartup():
        phase[0] = 'after'
    reactor.addSystemEventTrigger('before', 'startup', beforeStartup)
    reactor.addSystemEventTrigger('after', 'startup', afterStartup)
    sawPhase = []
    def fakeSignal(signum, action):
        sawPhase.append(phase[0])
    self.patch(signal, 'signal', fakeSignal)
    reactor.callWhenRunning(reactor.stop)
    self.assertIsNone(phase[0])
    self.assertEqual(sawPhase, [])
    self.runReactor(reactor)
    self.assertIn('before', sawPhase)
    self.assertEqual(phase[0], 'after')
