# HG changeset patch # User Mads Kiilerich # Date 2013-01-27 02:32:09 # Node ID c6a81e54c209e42dcc6271461d84e412cf61e380 # Parent 76ff3a715cf2db991032df27e2ca0ab7044dccae hgweb: make the test suite use hgweb in a more WSGI compliant way - as checked by wsgiref.validate. This makes sure that we don't optimize hgweb for invalid use cases. diff --git a/tests/test-extension.t b/tests/test-extension.t --- a/tests/test-extension.t +++ b/tests/test-extension.t @@ -112,7 +112,8 @@ Check hgweb's load order: > wsgicgi.launch(application) > EOF - $ SCRIPT_NAME='/' SERVER_PORT='80' SERVER_NAME='localhost' python hgweb.cgi \ + $ REQUEST_METHOD='GET' PATH_INFO='/' SCRIPT_NAME='' QUERY_STRING='' \ + > SERVER_PORT='80' SERVER_NAME='localhost' python hgweb.cgi \ > | grep '^[0-9]) ' # ignores HTML output 1) foo imported 1) bar imported diff --git a/tests/test-hgweb-no-path-info.t b/tests/test-hgweb-no-path-info.t --- a/tests/test-hgweb-no-path-info.t +++ b/tests/test-hgweb-no-path-info.t @@ -39,6 +39,7 @@ should be used from d74fc8dec2b4 onward > 'wsgi.multiprocess': False, > 'wsgi.run_once': False, > 'REQUEST_METHOD': 'GET', + > 'PATH_INFO': '/', > 'SCRIPT_NAME': '', > 'SERVER_NAME': '127.0.0.1', > 'SERVER_PORT': os.environ['HGPORT'], @@ -49,6 +50,7 @@ should be used from d74fc8dec2b4 onward > content = app(env, startrsp) > sys.stdout.write(output.getvalue()) > sys.stdout.write(''.join(content)) + > getattr(content, 'close', lambda : None)() > print '---- ERRORS' > print errors.getvalue() > @@ -101,7 +103,7 @@ should be used from d74fc8dec2b4 onward [('Content-Type', 'text/plain; charset=ascii')] ---- DATA - repo/ + /repo/ ---- ERRORS diff --git a/tests/test-hgweb-no-request-uri.t b/tests/test-hgweb-no-request-uri.t --- a/tests/test-hgweb-no-request-uri.t +++ b/tests/test-hgweb-no-request-uri.t @@ -49,6 +49,7 @@ should be used from d74fc8dec2b4 onward > content = app(env, startrsp) > sys.stdout.write(output.getvalue()) > sys.stdout.write(''.join(content)) + > getattr(content, 'close', lambda : None)() > print '---- ERRORS' > print errors.getvalue() >