Ejemplo n.º 1
0
    def test_twitter_startup(self):
        def Tmp(a):
            pass

        # Monkey-patch the fn so that it does not launch web requests 
        # ... otherwise deferreds leave the reactor in unclean state after the test
        self.patch(ChannelBot, "getTwitMsgs", Tmp)

        c_bot = ChannelBot(self.irc, self.bot_fact, "chan3")
        c_bot.onJoined("#test-bot3")
        self.assertTrue(c_bot.t_srch is not None)
        c_bot.cleanUp()
Ejemplo n.º 2
0
    def test_identica_startup(self):
        # verify that identica search starts if id_url is defined

        def Tmp(a):
            pass

        # Monkey-patch the fn so that it does not launch web requests 
        # ... otherwise deferreds leave the reactor in unclean state after the test
        self.patch(ChannelBot, "getIdentMsgs", Tmp)
        self.patch(ChannelBot, "getTwitMsgs", Tmp)

        c_bot = ChannelBot(self.irc, self.bot_fact, "chan2")
        c_bot.onJoined("#test-bot2")
        self.assertTrue(c_bot.i_srch is not None)
        c_bot.cleanUp()