Added a test for isnick always rejecting spaces in nick.

This commit is contained in:
Jeremy Fincher 2004-09-13 00:42:10 +00:00
parent e5d3d39bed
commit 59d084abef

View File

@ -189,6 +189,18 @@ class FunctionsTestCase(SupyTestCase):
finally: finally:
conf.supybot.protocols.irc.strictRfc.setValue(original) conf.supybot.protocols.irc.strictRfc.setValue(original)
def testIsNickNeverAllowsSpaces(self):
try:
original = conf.supybot.protocols.irc.strictRfc()
conf.supybot.protocols.irc.strictRfc.setValue(True)
self.failIf(ircutils.isNick('foo bar'))
conf.supybot.protocols.irc.strictRfc.setValue(False)
self.failIf(ircutils.isNick('foo bar'))
finally:
conf.supybot.protocols.irc.strictRfc.setValue(original)
def testBanmask(self): def testBanmask(self):
for msg in msgs: for msg in msgs:
if ircutils.isUserHostmask(msg.prefix): if ircutils.isUserHostmask(msg.prefix):