Add a test to verify the nick converter honors strictRfc

Signed-off-by: James McCoy <jamessan@users.sourceforge.net>
This commit is contained in:
James McCoy 2012-05-23 00:34:11 -04:00 committed by Valentin Lorentz
parent 4c01cb93e0
commit 1fdf3688e9

View File

@ -30,6 +30,7 @@
from supybot.test import *
from supybot.commands import *
import supybot.conf as conf
import supybot.irclib as irclib
import supybot.ircmsgs as ircmsgs
import supybot.callbacks as callbacks
@ -72,6 +73,16 @@ class GeneralContextTestCase(CommandsTestCase):
self.assertState(['int'], ['1'], [1])
self.assertState(['int', 'int', 'int'], ['1', '2', '3'], [1, 2, 3])
def testSpecNick(self):
strict = conf.supybot.protocols.irc.strictRfc()
try:
conf.supybot.protocols.irc.strictRfc.setValue(True)
self.assertError(['nick'], ['1abc'])
conf.supybot.protocols.irc.strictRfc.setValue(False)
self.assertState(['nick'], ['1abc'], ['1abc'])
finally:
conf.supybot.protocols.irc.strictRfc.setValue(strict)
def testSpecLong(self):
self.assertState(['long'], ['1'], [1L])
self.assertState(['long', 'long', 'long'], ['1', '2', '3'],