def testCopyCopiesChannels(self): state = irclib.IrcState() stateCopy = state.copy() state.channels['#foo'] = None self.failIf('#foo' in stateCopy.channels)
def testEmptyTopic(self): state = irclib.IrcState() state.addMsg(self.irc, ircmsgs.topic('#foo'))
def testKickRemovesChannel(self): st = irclib.IrcState() st.channels['#foo'] = irclib.ChannelState() m = ircmsgs.kick('#foo', self.irc.nick, prefix=self.irc.prefix) st.addMsg(self.irc, m) self.failIf('#foo' in st.channels)
def testDoModeOnlyChannels(self): st = irclib.IrcState() self.assert_(st.addMsg(self.irc, ircmsgs.IrcMsg('MODE foo +i')) or 1)
def testIRCNet005(self): state = irclib.IrcState() # Testing IRCNet's misuse of MAXBANS state.addMsg(self.irc, ircmsgs.IrcMsg(':irc.inet.tele.dk 005 adkwbot WALLCHOPS KNOCK EXCEPTS INVEX MODES=4 MAXCHANNELS=20 MAXBANS=beI:100 MAXTARGETS=4 NICKLEN=9 TOPICLEN=120 KICKLEN=90 :are supported by this server')) self.assertEqual(state.supported['maxbans'], 100)
def testWasteland005(self): state = irclib.IrcState() # Here we're testing if PREFIX works without the (ov) there. state.addMsg(self.irc, ircmsgs.IrcMsg(':desolate.wasteland.org 005 jemfinch NOQUIT WATCH=128 SAFELIST MODES=6 MAXCHANNELS=10 MAXBANS=100 NICKLEN=30 TOPICLEN=307 KICKLEN=307 CHANTYPES=&# PREFIX=@+ NETWORK=DALnet SILENCE=10 :are available on this server')) self.assertEqual(state.supported['prefix']['o'], '@') self.assertEqual(state.supported['prefix']['v'], '+')