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'
|
prefix = 'nick!user@host'
|
||||||
irc = FakeIrc()
|
irc = FakeIrc()
|
||||||
def testHistory(self):
|
def testHistory(self):
|
||||||
oldconfmaxhistory = str(conf.supybot.maxHistoryLength)
|
oldconfmaxhistory = conf.supybot.protocols.irc.maxHistoryLength()
|
||||||
conf.supybot.maxHistoryLength.set('10')
|
conf.supybot.protocols.irc.maxHistoryLength.setValue(10)
|
||||||
state = irclib.IrcState()
|
state = irclib.IrcState()
|
||||||
for msg in msgs:
|
for msg in msgs:
|
||||||
try:
|
try:
|
||||||
state.addMsg(self.irc, msg)
|
state.addMsg(self.irc, msg)
|
||||||
except Exception:
|
except Exception:
|
||||||
pass
|
pass
|
||||||
self.failIf(len(state.history)>conf.supybot.maxHistoryLength())
|
self.failIf(len(state.history) >
|
||||||
|
conf.supybot.protocols.irc.maxHistoryLength())
|
||||||
self.assertEqual(len(state.history),
|
self.assertEqual(len(state.history),
|
||||||
conf.supybot.maxHistoryLength())
|
conf.supybot.protocols.irc.maxHistoryLength())
|
||||||
self.assertEqual(list(state.history),
|
self.assertEqual(list(state.history),
|
||||||
msgs[len(msgs)-conf.supybot.maxHistoryLength():])
|
msgs[len(msgs) -
|
||||||
conf.supybot.maxHistoryLength.set(oldconfmaxhistory)
|
conf.supybot.protocols.irc.maxHistoryLength():])
|
||||||
|
conf.supybot.protocols.irc.maxHistoryLength.setValue(oldconfmaxhistory)
|
||||||
|
|
||||||
def testEmptyTopic(self):
|
def testEmptyTopic(self):
|
||||||
state = irclib.IrcState()
|
state = irclib.IrcState()
|
||||||
|
Loading…
Reference in New Issue
Block a user