'Event handlers added with L{IReactorWin32Events.addEvent} do not have
C{connectionLost} called on them if they are still active when the
reactor shuts down.'

def test_notDisconnectedOnShutdown(self):

    reactor = self.buildReactor()
    event = win32event.CreateEvent(None, False, False, None)
    finished = Deferred()
    listener = Listener(finished)
    reactor.addEvent(event, listener, 'occurred')
    reactor.callWhenRunning(reactor.stop)
    self.runReactor(reactor)
    self.assertIsNone(listener.connLostThreadID)
