Added a test to make sure something worked.

This commit is contained in:
Jeremy Fincher 2004-12-13 05:29:05 +00:00
parent aa3868c87e
commit 3b6d40bb24

View File

@ -213,6 +213,18 @@ class IrcStateTestCase(SupyTestCase):
st.addMsg(self.irc, m) st.addMsg(self.irc, m)
self.failIf('bar' in st.channels['#foo'].ops) self.failIf('bar' in st.channels['#foo'].ops)
def testNickChangesChangeChannelUsers(self):
st = irclib.IrcState()
st.channels['#foo'] = irclib.ChannelState()
st.channels['#foo'].addUser('@bar')
self.failUnless('bar' in st.channels['#foo'].users)
self.failUnless(st.channels['#foo'].isOp('bar'))
st.addMsg(self.irc, ircmsgs.IrcMsg(':bar!asfd@asdf.com NICK baz'))
self.failIf('bar' in st.channels['#foo'].users)
self.failIf(st.channels['#foo'].isOp('bar'))
self.failUnless('baz' in st.channels['#foo'].users)
self.failUnless(st.channels['#foo'].isOp('baz'))
def testHistory(self): def testHistory(self):
oldconfmaxhistory = conf.supybot.protocols.irc.maxHistoryLength() oldconfmaxhistory = conf.supybot.protocols.irc.maxHistoryLength()
conf.supybot.protocols.irc.maxHistoryLength.setValue(10) conf.supybot.protocols.irc.maxHistoryLength.setValue(10)