Ejemplo n.º 1
0
 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)
Ejemplo n.º 2
0
 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']])
Ejemplo n.º 3
0
 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"
     )
Ejemplo n.º 4
0
 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")
Ejemplo n.º 5
0
 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']])
Ejemplo n.º 6
0
 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)