mirror of
https://github.com/Mikaela/Limnoria.git
synced 2025-01-22 10:04:25 +01:00
Removed old and busted; added new hotness.
This commit is contained in:
parent
5603c62f38
commit
faa5a8ce13
@ -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()
|
||||
|
Loading…
Reference in New Issue
Block a user