Mercurial > public > mercurial-scm > hg-stable
diff tests/get-with-headers.py @ 7544:c5e37dc38a52
test-hgweb-*: replace "XX years ago" by a fixed string in get-with-headers.py
Note that other sed replacement commands are also filtering get-with-headers.py,
but they seem to be more test specific, hence not handled here.
author | Gilles Moris <gilles.moris@free.fr> |
---|---|
date | Thu, 25 Dec 2008 17:49:08 +0100 |
parents | e837f2294643 |
children | d5ebcf8f6855 |
line wrap: on
line diff
--- a/tests/get-with-headers.py Sat Dec 20 16:12:01 2008 -0600 +++ b/tests/get-with-headers.py Thu Dec 25 17:49:08 2008 +0100 @@ -3,7 +3,7 @@ __doc__ = """This does HTTP get requests given a host:port and path and returns a subset of the headers plus the body of the result.""" -import httplib, sys +import httplib, sys, re try: import msvcrt, os @@ -21,7 +21,9 @@ if response.getheader(h, None) is not None: print "%s: %s" % (h, response.getheader(h)) print -sys.stdout.write(response.read()) +data = response.read() +data = re.sub('\d+ years', 'many years', data) +sys.stdout.write(data) if 200 <= response.status <= 299: sys.exit(0)