You are viewing a plain text version of this content. The canonical link for it is here.
Posted to mod_python-commits@quetz.apache.org by jg...@apache.org on 2006/01/13 00:14:14 UTC

svn commit: r368511 - in /httpd/mod_python/trunk/test: htdocs/tests.py test.py

Author: jgallacher
Date: Thu Jan 12 15:14:11 2006
New Revision: 368511

URL: http://svn.apache.org/viewcvs?rev=368511&view=rev
Log:
Refactored req_add_empty_handler_string to check the response
from the request for evidence of an exception rather than examining
error_log.
Ref MODPYTHON-98

Modified:
    httpd/mod_python/trunk/test/htdocs/tests.py
    httpd/mod_python/trunk/test/test.py

Modified: httpd/mod_python/trunk/test/htdocs/tests.py
URL: http://svn.apache.org/viewcvs/httpd/mod_python/trunk/test/htdocs/tests.py?rev=368511&r1=368510&r2=368511&view=diff
==============================================================================
--- httpd/mod_python/trunk/test/htdocs/tests.py (original)
+++ httpd/mod_python/trunk/test/htdocs/tests.py Thu Jan 12 15:14:11 2006
@@ -610,7 +610,7 @@
     
     req.log_error("req_add_empty_handler_string")
     req.add_handler("PythonHandler", "")
-    req.write("check error_log")
+    req.write("no exception")
 
     return apache.OK
 

Modified: httpd/mod_python/trunk/test/test.py
URL: http://svn.apache.org/viewcvs/httpd/mod_python/trunk/test/test.py?rev=368511&r1=368510&r2=368511&view=diff
==============================================================================
--- httpd/mod_python/trunk/test/test.py (original)
+++ httpd/mod_python/trunk/test/test.py Thu Jan 12 15:14:11 2006
@@ -511,13 +511,8 @@
         print """\n  * Testing req.add_handler("PythonHandler","")"""
         rsp = self.vhost_get("test_req_add_empty_handler_string")
 
-        # look for evidence of the exception in the error log 
-        time.sleep(1)
-        f = open(os.path.join(SERVER_ROOT, "logs/error_log"))
-        log = f.read()
-        f.close()
-        if log.find("contains no 'handler'") == -1:
-            self.fail("""Could not find "contains no 'handler'" in error_log""")
+        if (rsp == "no exception"):
+            self.fail("Expected an exception")
 
     def test_accesshandler_add_handler_to_empty_hl_conf(self):
         # Note that there is no PythonHandler specified in the the VirtualHost