From 8a70f15e89bc7cfc0a441b6789bf401186dad2a9 Mon Sep 17 00:00:00 2001 From: Jeremy Fincher Date: Sat, 6 Sep 2003 21:58:42 +0000 Subject: [PATCH] Fixed bug in aliases with no arguments and added test for it. --- plugins/Alias.py | 7 +++++-- test/test_Alias.py | 7 ++++++- 2 files changed, 11 insertions(+), 3 deletions(-) diff --git a/plugins/Alias.py b/plugins/Alias.py index 05e483cd0..019a4ed5f 100644 --- a/plugins/Alias.py +++ b/plugins/Alias.py @@ -82,10 +82,11 @@ example = utils.wrapLines(""" @unalias rot26 Cerlyn: The operation succeeded. @rot26 blah blah blah + (note that it did nothing) @help slashdot - jemfinch: slashdot (for more help use the morehelp command) - hehe...I should fix that. + jemfinch: slashdot (for more help use the morehelp command) @morehelp slashdot + 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: diff --git a/test/test_Alias.py b/test/test_Alias.py index 5665ef90a..61122821e 100644 --- a/test/test_Alias.py +++ b/test/test_Alias.py @@ -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)