예제 #1
0
 def test_wait_time_from_non_admin(self):
     botcode.message_response(self.bot,
                              "{} --wait-time 40".format(self.bot.botnick),
                              "Impostor",
                              ircsock=self.ircsock,
                              channel=settings.channel,
                              greeters=settings.channel_greeters
                              )  # Channel-greeters may also be changed.  :(
     self.assertEqual(
         self.ircsock.sent_message(),
         "PRIVMSG {0} :Impostor you are not authorized to make that change. Please contact one of the channel greeters, like {1}, for assistance.\n"
         .format(settings.channel,
                 botcode.greeter_string(settings.channel_greeters)))
     self.assertEqual(self.bot.wait_time, settings.wait_time)
예제 #2
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,
                               channel=settings.channel,
                               greeters=settings.channel_greeters,
                               welcome=1)
     self.assertEqual(
         self.ircsock.sent_message(),
         "PRIVMSG {0} :Welcome Hermione!  The channel is pretty quiet right now, so I thought I'd say hello, and ping some people (like {1}) 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"
         .format(settings.channel,
                 botcode.greeter_string(settings.channel_greeters)))
예제 #3
0
 def test_three_greeters(self):
     greeters = botcode.greeter_string(['shauna', 'sauna', 'megafauna'])
     self.assertEqual(greeters, "shauna, sauna, and megafauna")
예제 #4
0
 def test_two_greeters(self):
     greeters = botcode.greeter_string(['shauna', 'sauna'])
     self.assertEqual(greeters, "shauna and sauna")
예제 #5
0
 def test_one_greeter(self):
     greeterstring = botcode.greeter_string(['shauna'])
     self.assertEqual(greeterstring, "shauna")
예제 #6
0
 def test_three_greeters(self):  
    greeters = botcode.greeter_string("and", ['shauna','sauna','megafauna'])
    self.assertEqual(greeters, "shauna, sauna, and megafauna")
예제 #7
0
 def test_two_greeters(self):        
    greeters = botcode.greeter_string("and", ['shauna','sauna'])
    self.assertEqual(greeters, "shauna and sauna")
예제 #8
0
 def test_one_greeter(self):     
    greeterstring = botcode.greeter_string("and", ['shauna'])
    self.assertEqual(greeterstring, "shauna")
예제 #9
0
 def test_wait_time_from_non_admin(self):
     botcode.message_response(self.bot,"{} --wait-time 40".format(self.bot.botnick),"Impostor",ircsock=self.ircsock, channel=settings.channel, greeters=settings.channel_greeters)     # Channel-greeters may also be changed.  :(
     self.assertEqual(self.ircsock.sent_message(), "PRIVMSG {0} :Impostor you are not authorized to make that change. Please contact one of the channel greeters, like {1}, for assistance.\n".format(settings.channel,botcode.greeter_string(settings.channel_greeters)))
     self.assertEqual(self.bot.wait_time, settings.wait_time)
예제 #10
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, channel=settings.channel, greeters=settings.channel_greeters, welcome=1)
     self.assertEqual(self.ircsock.sent_message(), "PRIVMSG {0} :Welcome Hermione!  The channel is pretty quiet right now, so I thought I'd say hello, and ping some people (like {1}) 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".format(settings.channel,botcode.greeter_string(settings.channel_greeters)))