Yes, this test seems to be broken. I'll create a JIRA issue for it.
We need unit tests for the unit tests. :)
Jim
For my WTF moment, have a look at test_req_get_basic_auth_pw in the
test suite. I guess it is supposed to be test req.get_basic_auth_pw (), but
that function isn't even mentioned anywhere. Plus the authenhandler phase
will not even be run since there is no Require directive in the
configuration.
Even if you add the Require directive, it seems to be testing the mod_auth
module and not the ability to call req.get_basic_auth_pw().
Would it perhaps be better as:
def test_req_get_basic_auth_pw_conf(self):
c = VirtualHost("*",
ServerName("test_req_get_basic_auth_pw"),
DocumentRoot(DOCUMENT_ROOT),
Directory(DOCUMENT_ROOT,
SetHandler("mod_python"),
AuthName("blah"),
AuthType("basic"),
#PythonAuthenHandler
("tests::req_get_basic_auth_pw"),
PythonHandler
("tests::req_get_basic_auth_pw"),
PythonDebug("On")))
return str(c)
def req_get_basic_auth_pw(req):
req.get_basic_auth_pw()
if req.user != "spam":
req.write("test failed")
else:
req.write("test ok")
return apache.OK
Graham