2006/2/4, Graham Dumpleton <[EMAIL PROTECTED]>:
> Jim, Nicolas
>
> Would it make sense to change test_Session_Session_conf() function in
> unit tests to something like:
>
>      def test_Session_Session_conf(self):
>
>          import tempfile
>          tempdir = tempfile.gettempdir()
>          database = os.path.join(tempdir,"mp_sess_test.dbm")
>
>          c = VirtualHost("*",
>                          ServerName("test_Session_Session"),
>                          DocumentRoot(DOCUMENT_ROOT),
>                          Directory(DOCUMENT_ROOT,
>                                    PythonOption('session_dbm "%s"' %
> database),
>                                    SetHandler("mod_python"),
>
> PythonHandler("tests::Session_Session"),
>                                    PythonDebug("On")))
>          return str(c)
>
> Ie., explicitly set "session_dbm" to some other location than default.
> Without this the test can fail if main Apache is run as different
> account to what test is run as. I put database in "/tmp" under a
> different
> name, but might be better somewhere in the test directory of the source
> code.
>
> Does this make sense?

Of course, no problem ! I agree with you that it would be better if
the session file was in the local directory, making sure it is removed
before the test runs. Maybe the unit test could open the session dbm
after the test has run to check whether the session is saved, for
additional safety.

Regards,
Nicolas

>
> That gets rid of one of the failures, now for the others. :-)
>
> Graham
>
>

Reply via email to