Patchwork [8,of,9] test-commandserver: rewrite manual substitution of output by (glob) match

login
register
mail settings
Submitter Yuya Nishihara
Date Sept. 28, 2014, 2:17 p.m.
Message ID <78f284b3c5f8010feada.1411913843@mimosa>
Download mbox | patch
Permalink /patch/6002/
State Accepted
Commit a9ff1b350f6226012db0533734bc82871318a968
Headers show

Comments

Yuya Nishihara - Sept. 28, 2014, 2:17 p.m.
# HG changeset patch
# User Yuya Nishihara <yuya@tcha.org>
# Date 1411883217 -32400
#      Sun Sep 28 14:46:57 2014 +0900
# Node ID 78f284b3c5f8010feada79b9adfbe0a03ef96d10
# Parent  7438880c63d1abd2f6a76c697bf7f2dd0c52f657
test-commandserver: rewrite manual substitution of output by (glob) match

Patch

diff --git a/tests/test-commandserver.t b/tests/test-commandserver.t
--- a/tests/test-commandserver.t
+++ b/tests/test-commandserver.t
@@ -8,19 +8,15 @@ 
   $ hg init repo
   $ cd repo
 
-  >>> import re
   >>> from hgclient import readchannel, runcommand, check
   >>> @check
   ... def hellomessage(server):
   ...     ch, data = readchannel(server)
-  ...     # escaping python tests output not supported
-  ...     print '%c, %r' % (ch, re.sub('encoding: [a-zA-Z0-9-]+',
-  ...                                  'encoding: ***', data))
-  ... 
+  ...     print '%c, %r' % (ch, data)
   ...     # run an arbitrary command to make sure the next thing the server
   ...     # sends isn't part of the hello message
   ...     runcommand(server, ['id'])
-  o, 'capabilities: getencoding runcommand\nencoding: ***'
+  o, 'capabilities: getencoding runcommand\nencoding: *' (glob)
    runcommand id
   000000000000 tip
 
@@ -523,19 +519,15 @@  start without repository:
 
   $ cd ..
 
-  >>> import re
   >>> from hgclient import readchannel, runcommand, check
   >>> @check
   ... def hellomessage(server):
   ...     ch, data = readchannel(server)
-  ...     # escaping python tests output not supported
-  ...     print '%c, %r' % (ch, re.sub('encoding: [a-zA-Z0-9-]+',
-  ...                                  'encoding: ***', data))
-  ... 
+  ...     print '%c, %r' % (ch, data)
   ...     # run an arbitrary command to make sure the next thing the server
   ...     # sends isn't part of the hello message
   ...     runcommand(server, ['id'])
-  o, 'capabilities: getencoding runcommand\nencoding: ***'
+  o, 'capabilities: getencoding runcommand\nencoding: *' (glob)
    runcommand id
   abort: there is no Mercurial repository here (.hg not found)
    [255]