changeset 22571:a9ff1b350f62

test-commandserver: rewrite manual substitution of output by (glob) match
author Yuya Nishihara <yuya@tcha.org>
date Sun, 28 Sep 2014 14:46:57 +0900
parents db497a1ef1c1
children cc3d9f776632
files tests/test-commandserver.t
diffstat 1 files changed, 4 insertions(+), 12 deletions(-) [+]
line wrap: on
line diff
--- a/tests/test-commandserver.t	Sun Sep 28 16:59:30 2014 +0900
+++ b/tests/test-commandserver.t	Sun Sep 28 14:46:57 2014 +0900
@@ -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 @@
 
   $ 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]