def test_check_new_newcomers(self): botcode.process_newcomers(self.bot, [ i for i in self.bot.newcomers if i.around_for() > self.bot.wait_time ], ircsock=self.ircsock, welcome=0) self.assertEqual(len(self.bot.newcomers), 1)
def test_check_new_known_nicks(self): botcode.process_newcomers(self.bot, [ i for i in self.bot.newcomers if i.around_for() > self.bot.wait_time ], ircsock=self.ircsock, welcome=0) self.assertEqual(self.bot.known_nicks, [['Alice'], ['Bob'], ['Harry'], ['Hermione']])
def test_welcome_nick(self): botcode.process_newcomers(bot=self.bot, newcomerlist=[ i for i in self.bot.newcomers if i.around_for() > self.bot.wait_time ], ircsock=self.ircsock, welcome=1) self.assertEqual( self.ircsock.sent_message(), "PRIVMSG #openhatch-bots :Welcome Hermione! The channel is pretty quiet right now, so I though I'd say hello, and ping some people (like shauna) that you're here. If no one responds for a while, try emailing us at [email protected] or just try coming back later. FYI, you're now on my list of known nicknames, so I won't bother you again.\n" )
def test_welcome_nick(self): botcode.process_newcomers(bot=self.bot, newcomerlist=[i for i in self.bot.newcomers if i.around_for() > self.bot.wait_time], ircsock=self.ircsock, welcome=1) self.assertEqual(self.ircsock.sent_message(), "PRIVMSG #openhatch-bots :Welcome Hermione! The channel is pretty quiet right now, so I though I'd say hello, and ping some people (like shauna) that you're here. If no one responds for a while, try emailing us at [email protected] or just try coming back later. FYI, you're now on my list of known nicknames, so I won't bother you again.\n")
def test_check_new_known_nicks(self): botcode.process_newcomers(self.bot, [i for i in self.bot.newcomers if i.around_for() > self.bot.wait_time], ircsock=self.ircsock, welcome=0) self.assertEqual(self.bot.known_nicks,[['Alice'],['Bob'],['Harry'],['Hermione']])
def test_check_new_newcomers(self): botcode.process_newcomers(self.bot, [i for i in self.bot.newcomers if i.around_for() > self.bot.wait_time], ircsock=self.ircsock, welcome=0) self.assertEqual(len(self.bot.newcomers), 1)