Fixed bug in aliases with no arguments and added test for it.

This commit is contained in:
Jeremy Fincher 2003-09-06 21:58:42 +00:00
parent e01d52b2f2
commit 8a70f15e89
2 changed files with 11 additions and 3 deletions

View File

@ -82,10 +82,11 @@ example = utils.wrapLines("""
<Cerlyn> @unalias rot26
<supybot> Cerlyn: The operation succeeded.
<jemfinch> @rot26 blah blah blah
<jemfinch> (note that it did nothing)
<jemfinch> @help slashdot
<supybot> jemfinch: slashdot <an alias, None arguments> (for more help use the morehelp command)
<jemfinch> hehe...I should fix that.
<supybot> jemfinch: slashdot <an alias, 0 arguments> (for more help use the morehelp command)
<jemfinch> @morehelp slashdot
<supybot> jemfinch: Alias for 'rsstitles http://slashdot.org/slashdot.rss'
""")
class RecursiveAlias(Exception):
@ -113,6 +114,8 @@ def makeNewAlias(name, alias):
doDollars = bool(biggestDollar)
if biggestDollar is not None:
biggestDollar = int(biggestDollar)
else:
biggestDollar = 0
def f(self, irc, msg, args):
alias_ = alias
if doChannel:

View File

@ -65,7 +65,12 @@ class FunctionsTest(unittest.TestCase):
class AliasTestCase(PluginTestCase, PluginDocumentation):
plugins = ('Alias', 'FunCommands', 'Utilities')
plugins = ('Alias', 'FunCommands', 'Utilities', 'MiscCommands')
def testAliasHelp(self):
self.assertNotError('alias slashdot foo')
self.assertNotRegexp('help slashdot', 'None')
self.assertResponse('morehelp slashdot', "Alias for 'foo'")
def testSimpleAlias(self):
pi = '3.1456926535897932384626433832795028841971693'
self.assertNotError('alias pi %s' % pi)