mirror of
https://github.com/Mikaela/Limnoria.git
synced 2025-01-11 12:42:34 +01:00
Fixed bug in aliases with no arguments and added test for it.
This commit is contained in:
parent
e01d52b2f2
commit
8a70f15e89
@ -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:
|
||||
|
@ -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)
|
||||
|
Loading…
Reference in New Issue
Block a user