# HG changeset patch # User Martin Geisler # Date 2009-05-16 23:24:45 # Node ID d5ebcf8f6855309164bab114b262f7d6a8243ba0 # Parent e1f4343db7402f6e17be2ccb8bcc62bcb7dfb717 tests: fix doc string in get-with-headers.py diff --git a/tests/get-with-headers.py b/tests/get-with-headers.py --- a/tests/get-with-headers.py +++ b/tests/get-with-headers.py @@ -1,6 +1,6 @@ #!/usr/bin/env python -__doc__ = """This does HTTP get requests given a host:port and path and returns +"""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, re diff --git a/tests/test-highlight.out b/tests/test-highlight.out --- a/tests/test-highlight.out +++ b/tests/test-highlight.out @@ -12,7 +12,7 @@ 200 Script output follows -test: 7c3facd7c58a get-with-headers.py +test: 93b701795893 get-with-headers.py @@ -23,27 +23,27 @@ 200 Script output follows mercurial

test

-

view get-with-headers.py @ 0:7c3facd7c58a

+

view get-with-headers.py @ 0:93b701795893

@@ -98,7 +98,7 @@ 200 Script output follows -test: 7c3facd7c58a isolatin.txt +test: 93b701795893 isolatin.txt @@ -109,27 +109,27 @@ 200 Script output follows mercurial

test

-

view isolatin.txt @ 0:7c3facd7c58a

+

view isolatin.txt @ 0:93b701795893

@@ -195,28 +195,28 @@ 200 Script output follows mercurial

test

-

annotate get-with-headers.py @ 0:7c3facd7c58a

+

annotate get-with-headers.py @ 0:93b701795893

@@ -258,211 +258,211 @@ files, or words in the commit message -test@0 +test@0 1 #!/usr/bin/env python -test@0 +test@0 2 -test@0 +test@0 - 3 __doc__ = """This does HTTP get requests given a host:port and path and returns + 3 """This does HTTP GET requests given a host:port and path and returns -test@0 +test@0 - 4 a subset of the headers plus the body of the result.""" + 4 a subset of the headers plus the body of the result.""" -test@0 +test@0 5 -test@0 +test@0 6 import httplib, sys, re -test@0 +test@0 7 -test@0 +test@0 8 try: -test@0 +test@0 9 import msvcrt, os -test@0 +test@0 10 msvcrt.setmode(sys.stdout.fileno(), os.O_BINARY) -test@0 +test@0 11 msvcrt.setmode(sys.stderr.fileno(), os.O_BINARY) -test@0 +test@0 12 except ImportError: -test@0 +test@0 13 pass -test@0 +test@0 14 -test@0 +test@0 15 headers = [h.lower() for h in sys.argv[3:]] -test@0 +test@0 16 conn = httplib.HTTPConnection(sys.argv[1]) -test@0 +test@0 17 conn.request("GET", sys.argv[2]) -test@0 +test@0 18 response = conn.getresponse() -test@0 +test@0 19 print response.status, response.reason -test@0 +test@0 20 for h in headers: -test@0 +test@0 21 if response.getheader(h, None) is not None: -test@0 +test@0 22 print "%s: %s" % (h, response.getheader(h)) -test@0 +test@0 23 print -test@0 +test@0 24 data = response.read() -test@0 +test@0 25 data = re.sub('\d+ years', 'many years', data) -test@0 +test@0 26 sys.stdout.write(data) -test@0 +test@0 27 -test@0 +test@0 28 if 200 <= response.status <= 299: -test@0 +test@0 29 sys.exit(0) -test@0 +test@0 30 sys.exit(1)