mirror of
https://github.com/progval/Limnoria.git
synced 2025-05-04 09:21:07 -05: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
|
<Cerlyn> @unalias rot26
|
||||||
<supybot> Cerlyn: The operation succeeded.
|
<supybot> Cerlyn: The operation succeeded.
|
||||||
<jemfinch> @rot26 blah blah blah
|
<jemfinch> @rot26 blah blah blah
|
||||||
|
<jemfinch> (note that it did nothing)
|
||||||
<jemfinch> @help slashdot
|
<jemfinch> @help slashdot
|
||||||
<supybot> jemfinch: slashdot <an alias, None arguments> (for more help use the morehelp command)
|
<supybot> jemfinch: slashdot <an alias, 0 arguments> (for more help use the morehelp command)
|
||||||
<jemfinch> hehe...I should fix that.
|
|
||||||
<jemfinch> @morehelp slashdot
|
<jemfinch> @morehelp slashdot
|
||||||
|
<supybot> jemfinch: Alias for 'rsstitles http://slashdot.org/slashdot.rss'
|
||||||
""")
|
""")
|
||||||
|
|
||||||
class RecursiveAlias(Exception):
|
class RecursiveAlias(Exception):
|
||||||
@ -113,6 +114,8 @@ def makeNewAlias(name, alias):
|
|||||||
doDollars = bool(biggestDollar)
|
doDollars = bool(biggestDollar)
|
||||||
if biggestDollar is not None:
|
if biggestDollar is not None:
|
||||||
biggestDollar = int(biggestDollar)
|
biggestDollar = int(biggestDollar)
|
||||||
|
else:
|
||||||
|
biggestDollar = 0
|
||||||
def f(self, irc, msg, args):
|
def f(self, irc, msg, args):
|
||||||
alias_ = alias
|
alias_ = alias
|
||||||
if doChannel:
|
if doChannel:
|
||||||
|
@ -65,7 +65,12 @@ class FunctionsTest(unittest.TestCase):
|
|||||||
|
|
||||||
|
|
||||||
class AliasTestCase(PluginTestCase, PluginDocumentation):
|
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):
|
def testSimpleAlias(self):
|
||||||
pi = '3.1456926535897932384626433832795028841971693'
|
pi = '3.1456926535897932384626433832795028841971693'
|
||||||
self.assertNotError('alias pi %s' % pi)
|
self.assertNotError('alias pi %s' % pi)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user