Fix style nit and add some comments to tests.
authorDirkjan Ochtman <dirkjan@ochtman.nl>
Sun, 02 Dec 2007 10:12:26 +0100
changeset 5580 f429e0e067a8
parent 5579 e15f7db0f0ee
child 5582 60d46e0bd656
Fix style nit and add some comments to tests.
mercurial/hgweb/wsgicgi.py
tests/test-hgweb
tests/test-hgweb-no-request-uri
tests/test-hgwebdir
tests/test-newcgi
tests/test-newercgi
tests/test-non-interactive-wsgi
tests/test-oldcgi
--- a/mercurial/hgweb/wsgicgi.py	Sat Dec 01 19:19:08 2007 +0100
+++ b/mercurial/hgweb/wsgicgi.py	Sun Dec 02 10:12:26 2007 +0100
@@ -16,9 +16,7 @@
     util.set_binary(sys.stdout)
 
     environ = dict(os.environ.items())
-    if 'PATH_INFO' not in environ:
-    	environ['PATH_INFO'] = ''
-
+    environ.setdefault('PATH_INFO', '')
     environ['wsgi.input'] = sys.stdin
     environ['wsgi.errors'] = sys.stderr
     environ['wsgi.version'] = (1, 0)
--- a/tests/test-hgweb	Sat Dec 01 19:19:08 2007 +0100
+++ b/tests/test-hgweb	Sun Dec 02 10:12:26 2007 +0100
@@ -1,4 +1,5 @@
 #!/bin/sh
+# Some tests for hgweb. Tests static files, plain files and different 404's.
 
 hg init test
 cd test
--- a/tests/test-hgweb-no-request-uri	Sat Dec 01 19:19:08 2007 +0100
+++ b/tests/test-hgweb-no-request-uri	Sun Dec 02 10:12:26 2007 +0100
@@ -1,4 +1,7 @@
 #!/bin/sh
+# This tests if hgweb and hgwebdir still work if the REQUEST_URI variable is
+# no longer passed with the request. Instead, SCRIPT_NAME and PATH_INFO
+# should be used from d74fc8dec2b4 onward to route the request.
 
 mkdir repo
 cd repo
--- a/tests/test-hgwebdir	Sat Dec 01 19:19:08 2007 +0100
+++ b/tests/test-hgwebdir	Sun Dec 02 10:12:26 2007 +0100
@@ -1,4 +1,6 @@
 #!/bin/sh
+# Tests some basic hgwebdir functionality. Tests setting up paths and
+# collection, different forms of 404s and the subdirectory support.
 
 mkdir webdir
 cd webdir
--- a/tests/test-newcgi	Sat Dec 01 19:19:08 2007 +0100
+++ b/tests/test-newcgi	Sun Dec 02 10:12:26 2007 +0100
@@ -1,4 +1,6 @@
 #!/bin/sh
+# This tests if CGI files from after d0db3462d568 but
+# before d74fc8dec2b4 still work.
 
 hg init test
 
--- a/tests/test-newercgi	Sat Dec 01 19:19:08 2007 +0100
+++ b/tests/test-newercgi	Sun Dec 02 10:12:26 2007 +0100
@@ -1,4 +1,5 @@
 #!/bin/sh
+# This is a rudimentary test of the CGI files as of d74fc8dec2b4.
 
 hg init test
 
--- a/tests/test-non-interactive-wsgi	Sat Dec 01 19:19:08 2007 +0100
+++ b/tests/test-non-interactive-wsgi	Sun Dec 02 10:12:26 2007 +0100
@@ -1,4 +1,6 @@
 #!/bin/sh
+# Tests if hgweb can run without touching sys.stdin, as is required
+# by the WSGI standard and strictly implemented by mod_wsgi.
 
 mkdir repo
 cd repo
--- a/tests/test-oldcgi	Sat Dec 01 19:19:08 2007 +0100
+++ b/tests/test-oldcgi	Sun Dec 02 10:12:26 2007 +0100
@@ -1,4 +1,5 @@
 #!/bin/sh
+# This tests if CGI files from before d0db3462d568 still work.
 
 hg init test