I'll at least add a JIRA issue then for something to be done about this
for 3.3 and reference this email thread.
I'll probably have a couple of others to add related to tests anyway,
as I
reckon I can change tests slightly so that they will work on a virtual
hosting system such as OpenVPS.
On 05/02/2006, at 12:46 AM, Jim Gallacher wrote:
Nicolas Lehuen wrote:
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.
Good idea. Also, I think any temp files created should be put in the
local directory and removed after the tests run. The obvious place
would be test/tmp.
Also, I just realized that we don't have a unit test for FileSession,
which is my fault, since I didn't write one. I shall rectify that, but
not for the 3.2.7 release. ;)
Jim