Mercurial > hg-stable
comparison tests/test-archive.t @ 31028:636cf3f7620d
tests: use LOCALIP
This patch replaces hardcoded 127.0.0.1 with $LOCALIP in all tests.
Till now, the IPv6 series should make tests pass on common IPv6 systems
where the local device has the address "::1" and the hostname "localhost"
resolves to "::1".
author | Jun Wu <quark@fb.com> |
---|---|
date | Thu, 16 Feb 2017 09:38:52 -0800 |
parents | b3d2e8cce78c |
children | 75be14993fda |
comparison
equal
deleted
inserted
replaced
31027:bfdb0741f9f2 | 31028:636cf3f7620d |
---|---|
97 > try: | 97 > try: |
98 > stdout = sys.stdout.buffer | 98 > stdout = sys.stdout.buffer |
99 > except AttributeError: | 99 > except AttributeError: |
100 > stdout = sys.stdout | 100 > stdout = sys.stdout |
101 > try: | 101 > try: |
102 > f = util.urlreq.urlopen('http://127.0.0.1:%s/?%s' | 102 > f = util.urlreq.urlopen('http://$LOCALIP:%s/?%s' |
103 > % (os.environ['HGPORT'], requeststr)) | 103 > % (os.environ['HGPORT'], requeststr)) |
104 > stdout.write(f.read()) | 104 > stdout.write(f.read()) |
105 > except util.urlerr.httperror as e: | 105 > except util.urlerr.httperror as e: |
106 > sys.stderr.write(str(e) + '\n') | 106 > sys.stderr.write(str(e) + '\n') |
107 > EOF | 107 > EOF |