'It is not possible to register a C{Application} after the reactor has
already started.'

def test_cantRegisterAfterRun(self):

    reactor = gireactor.GIReactor(useGtk=False)
    self.addCleanup(self.unbuildReactor, reactor)
    app = Gio.Application(application_id='com.twistedmatrix.trial.gireactor', flags=Gio.ApplicationFlags.FLAGS_NONE)
    def tryRegister():
        exc = self.assertRaises(ReactorAlreadyRunning, reactor.registerGApplication, app)
        self.assertEqual(exc.args[0], "Can't    register    application    after    reactor    was    started.")
        reactor.stop()
    reactor.callLater(0, tryRegister)
    ReactorBuilder.runReactor(self, reactor)
