Patchwork [03,of,10,py3] tests: port test extension in test-help.t to python 3

login
register
mail settings
Submitter Augie Fackler
Date May 29, 2017, 2:32 p.m.
Message ID <f1ae981927af4d2d75e2.1496068345@imladris.local>
Download mbox | patch
Permalink /patch/21047/
State Accepted
Headers show

Comments

Augie Fackler - May 29, 2017, 2:32 p.m.
# HG changeset patch
# User Augie Fackler <raf@durin42.com>
# Date 1496000525 14400
#      Sun May 28 15:42:05 2017 -0400
# Node ID f1ae981927af4d2d75e2a0bc58c733c9a90c085b
# Parent  4991a75faad243e7b80a51bddc5e5a3d86989b3b
tests: port test extension in test-help.t to python 3

The changes required herein suggest to me that we should probably
accept ascii-safe unicode strings for command name, flag name, etc.

Patch

diff --git a/tests/test-help.t b/tests/test-help.t
--- a/tests/test-help.t
+++ b/tests/test-help.t
@@ -685,21 +685,21 @@  this is a section and erroring out weird
   > cmdtable = {}
   > command = registrar.command(cmdtable)
   > 
-  > @command('nohelp',
-  >     [('', 'longdesc', 3, 'x'*90),
-  >     ('n', '', None, 'normal desc'),
-  >     ('', 'newline', '', 'line1\nline2')],
-  >     'hg nohelp',
+  > @command(b'nohelp',
+  >     [(b'', b'longdesc', 3, b'x'*90),
+  >     (b'n', b'', None, b'normal desc'),
+  >     (b'', b'newline', b'', b'line1\nline2')],
+  >     b'hg nohelp',
   >     norepo=True)
-  > @command('debugoptADV', [('', 'aopt', None, 'option is (ADVANCED)')])
-  > @command('debugoptDEP', [('', 'dopt', None, 'option is (DEPRECATED)')])
-  > @command('debugoptEXP', [('', 'eopt', None, 'option is (EXPERIMENTAL)')])
+  > @command(b'debugoptADV', [(b'', b'aopt', None, b'option is (ADVANCED)')])
+  > @command(b'debugoptDEP', [(b'', b'dopt', None, b'option is (DEPRECATED)')])
+  > @command(b'debugoptEXP', [(b'', b'eopt', None, b'option is (EXPERIMENTAL)')])
   > def nohelp(ui, *args, **kwargs):
   >     pass
   > 
   > def uisetup(ui):
-  >     ui.setconfig('alias', 'shellalias', '!echo hi', 'helpext')
-  >     ui.setconfig('alias', 'hgalias', 'summary', 'helpext')
+  >     ui.setconfig(b'alias', b'shellalias', b'!echo hi', b'helpext')
+  >     ui.setconfig(b'alias', b'hgalias', b'summary', b'helpext')
   > 
   > EOF
   $ echo '[extensions]' >> $HGRCPATH