Removed old and busted; added new hotness.

This commit is contained in:
Jeremy Fincher 2004-05-07 11:46:41 +00:00
parent 5603c62f38
commit faa5a8ce13
1 changed files with 8 additions and 6 deletions

View File

@ -208,20 +208,22 @@ class IrcStateTestCase(SupyTestCase):
prefix = 'nick!user@host'
irc = FakeIrc()
def testHistory(self):
oldconfmaxhistory = str(conf.supybot.maxHistoryLength)
conf.supybot.maxHistoryLength.set('10')
oldconfmaxhistory = conf.supybot.protocols.irc.maxHistoryLength()
conf.supybot.protocols.irc.maxHistoryLength.setValue(10)
state = irclib.IrcState()
for msg in msgs:
try:
state.addMsg(self.irc, msg)
except Exception:
pass
self.failIf(len(state.history)>conf.supybot.maxHistoryLength())
self.failIf(len(state.history) >
conf.supybot.protocols.irc.maxHistoryLength())
self.assertEqual(len(state.history),
conf.supybot.maxHistoryLength())
conf.supybot.protocols.irc.maxHistoryLength())
self.assertEqual(list(state.history),
msgs[len(msgs)-conf.supybot.maxHistoryLength():])
conf.supybot.maxHistoryLength.set(oldconfmaxhistory)
msgs[len(msgs) -
conf.supybot.protocols.irc.maxHistoryLength():])
conf.supybot.protocols.irc.maxHistoryLength.setValue(oldconfmaxhistory)
def testEmptyTopic(self):
state = irclib.IrcState()