Mercurial > public > mercurial-scm > hg
diff tests/test-help.t @ 21254:51e5c793a9f4
tests: declare commands using decorator
author | Gregory Szorc <gregory.szorc@gmail.com> |
---|---|
date | Sun, 04 May 2014 22:48:07 -0700 |
parents | d0cc92ba0406 |
children | eb6eaef7ae44 |
line wrap: on
line diff
--- a/tests/test-help.t Sun May 04 21:33:14 2014 -0700 +++ b/tests/test-help.t Sun May 04 22:48:07 2014 -0700 @@ -652,19 +652,20 @@ $ cat > helpext.py <<EOF > import os - > from mercurial import commands + > from mercurial import cmdutil, commands + > + > cmdtable = {} + > command = cmdutil.command(cmdtable) > + > @command('nohelp', + > [('', 'longdesc', 3, 'x'*90), + > ('n', '', None, 'normal desc'), + > ('', 'newline', '', 'line1\nline2')], + > 'hg nohelp') + > @command('debugoptDEP', [('', 'dopt', None, 'option is DEPRECATED')]) > def nohelp(ui, *args, **kwargs): > pass > - > cmdtable = { - > "debugoptDEP": (nohelp, [('', 'dopt', None, 'option is DEPRECATED')],), - > "nohelp": (nohelp, [('', 'longdesc', 3, 'x'*90), - > ('n', '', None, 'normal desc'), - > ('', 'newline', '', 'line1\nline2'), - > ], "hg nohelp"), - > } - > > commands.norepo += ' nohelp' > EOF $ echo '[extensions]' >> $HGRCPATH