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
parent a1acde1f02
commit c574203bab

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'],