Added test for maximum nesting.

This commit is contained in:
Jeremy Fincher 2004-09-28 07:40:58 +00:00
parent 0874dfd5f3
commit f15129adec

View File

@ -256,6 +256,18 @@ class PrivmsgTestCase(ChannelPluginTestCase):
def testEmptySquareBrackets(self):
self.assertError('echo []')
def testMaximumNestingDepth(self):
original = conf.supybot.commands.nested.maximum()
try:
conf.supybot.commands.nested.maximum.setValue(3)
self.assertResponse('echo foo', 'foo')
self.assertResponse('echo [echo foo]', 'foo')
self.assertResponse('echo [echo [echo foo]]', 'foo')
self.assertResponse('echo [echo [echo [echo foo]]]', 'foo')
self.assertError('echo [echo [echo [echo [echo foo]]]]')
finally:
conf.supybot.commands.nested.maximum.setValue(original)
def testSimpleReply(self):
self.assertResponse("eval irc.reply('foo')", 'foo')