[CMF-checkins] CVS: CMF/CMFCore/tests - test_DirectoryView.py:1.9.4.1 test_FSSecurity.py:1.3.4.1
Tres Seaver
tseaver@zope.com
Mon, 12 Aug 2002 08:16:12 -0400
Update of /cvs-repository/CMF/CMFCore/tests
In directory cvs.zope.org:/tmp/cvs-serv24564/tests
Modified Files:
Tag: chrisw-dirview-branch
test_DirectoryView.py test_FSSecurity.py
Log Message:
- Check in these attempted fixescomments on a new branch, so
that work can continue on them (reverting the head until the branch
is "clean"). Added 'XXX' comments in places where things seemed
"dodgy".
=== CMF/CMFCore/tests/test_DirectoryView.py 1.9 => 1.9.4.1 ===
--- CMF/CMFCore/tests/test_DirectoryView.py:1.9 Mon Aug 5 10:23:41 2002
+++ CMF/CMFCore/tests/test_DirectoryView.py Mon Aug 12 08:16:11 2002
@@ -3,6 +3,10 @@
from Products.CMFCore.tests.base.dummy import DummyFolder
+#
+# XXX: 2002/08/12 Generic rule: *don't* do imports of the module-under-test
+# at module scope in the unittest; failure here suppresses information!
+#
from Products.CMFCore.DirectoryView import registerDirectory
from Products.CMFCore.DirectoryView import addDirectoryViews
from Products.CMFCore.DirectoryView import DirectoryViewSurrogate
@@ -33,7 +37,13 @@
if self is not None:
ob = self.ob = DummyFolder()
addDirectoryViews(ob, 'fake_skins', _prefix)
-
+
+#
+# XXX: 2002/08/12: Another thumb-rule: don't write to the filesystem
+# as part of a unittest (failure modes are too hard to track down,
+# and it should be possible to run them *anywhere*, including in
+# a setup where the files / directories are readonly.
+#
def _writeFile(filename, stuff):
# write some stuff to a file on disk
# make sure the file's modification time has changed
@@ -63,6 +73,12 @@
""" Test registerDirectory """
pass
+ #
+ # XXX: 2002/08/12: These tests "smell funny"; they are perhaps too
+ # "white box"? # (and two of them fail on Linux, as well;
+ # you are hardwiring assumptions about the shape of
+ # SOFTWARE_HOME/INSTANCE_HOME).
+ #
def test_getDirectoryInfo1( self ):
""" windows INSTANCE_HOME """
addDirectoryViews(self.ob, 'fake_skins', _prefix)
=== CMF/CMFCore/tests/test_FSSecurity.py 1.3 => 1.3.4.1 ===
--- CMF/CMFCore/tests/test_FSSecurity.py:1.3 Mon Aug 5 06:46:53 2002
+++ CMF/CMFCore/tests/test_FSSecurity.py Mon Aug 12 08:16:11 2002
@@ -6,8 +6,17 @@
from AccessControl.Permission import Permission
from Products.CMFCore.tests.base.testcase import RequestTest
+
+#
+# XXX: 2002/08/12: Tests shouldn't depend on one another; common
+# stuff like this should be factored out into a utilty module.
+#
from test_DirectoryView import _registerDirectory
from test_DirectoryView import _prefix
+
+#
+# XXX: 2002/08/12: don't write to the filesystem (see test_DirectoryView)
+#
from test_DirectoryView import _writeFile
from test_DirectoryView import _deleteFile
from Globals import DevelopmentMode