oops, got this reversed.

This commit is contained in:
Jeremy Fincher 2004-08-26 04:43:19 +00:00
parent ff7622b083
commit f2fd7c9e66
2 changed files with 15 additions and 5 deletions

View File

@ -339,11 +339,14 @@ class IrcState(IrcCommandDispatcher):
})
def _prefixParser(s):
(left, right) = s.split(')')
assert left[0] == '(', 'Odd PREFIX in 005: %s' % s
left = left[1:]
assert len(left) == len(right), 'Odd PREFIX in 005: %s' % s
return dict(zip(left, right))
if ')' in s:
(left, right) = s.split(')')
assert left[0] == '(', 'Odd PREFIX in 005: %s' % s
left = left[1:]
assert len(left) == len(right), 'Odd PREFIX in 005: %s' % s
return dict(zip(left, right))
else:
return dict(zip('ovh', s))
_005converters['prefix'] = _prefixParser
del _prefixParser
def do005(self, irc, msg):

View File

@ -225,6 +225,13 @@ class IrcStateTestCase(SupyTestCase):
conf.supybot.protocols.irc.maxHistoryLength():])
conf.supybot.protocols.irc.maxHistoryLength.setValue(oldconfmaxhistory)
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'], '+')
def testEmptyTopic(self):
state = irclib.IrcState()
state.addMsg(self.irc, ircmsgs.topic('#foo'))