[CMF-checkins] CVS: Products/CMFCore/tests -
test_DirectoryView.py:1.24
Jens Vagelpohl
jens at dataflake.org
Wed Apr 6 05:55:15 EDT 2005
Update of /cvs-repository/Products/CMFCore/tests
In directory cvs.zope.org:/tmp/cvs-serv24415/CMFCore/tests
Modified Files:
test_DirectoryView.py
Log Message:
- CMFCore.DirectoryView: Made list of file names to ignore configurable.
The previously hardcoded list of files to ignore when creating their
ZODB representations can now be configured by passing a sequence of
names to registerDirectory, which will be ignored in addition to the
standard list of ignored names (http://www.zope.org/Collectors/CMF/319).
=== Products/CMFCore/tests/test_DirectoryView.py 1.23 => 1.24 ===
--- Products/CMFCore/tests/test_DirectoryView.py:1.23 Mon Mar 7 18:03:04 2005
+++ Products/CMFCore/tests/test_DirectoryView.py Wed Apr 6 05:54:45 2005
@@ -155,8 +155,10 @@
self.assertEqual(self.ob.fake_skin.testPT.title, 'Zope Pope')
def test_ignored(self):
- # Test that the .test1.py is ignored
- assert('#test1' not in self.ob.fake_skin.objectIds())
+ # Test that "artifact" files and dirs are ignored
+ for name in '#test1', 'CVS', '.test1', 'test1~':
+ assert(name not in self.ob.fake_skin.objectIds(),
+ '%s not ignored' % name)
def test_surrogate_writethrough(self):
# CMF Collector 316: It is possible to cause ZODB writes because
@@ -183,6 +185,25 @@
)
+class DirectoryViewIgnoreTests(FSDVTest):
+
+ def setUp( self ):
+ FSDVTest.setUp(self)
+ self.manual_ign = ('CVS', 'SVN', 'test_manual_ignore.py')
+ self._registerDirectory(self , ignore=self.manual_ign)
+
+ def test_ignored(self):
+ # Test that "artifact" files and dirs are ignored,
+ # even when a custom ignore list is used; and that the
+ # custom ignore list is also honored
+ auto_ign = ('#test1', '.test1', 'test1~')
+ must_ignore = self.manual_ign + auto_ign + ('test_manual_ignore',)
+ visible = self.ob.fake_skin.objectIds()
+
+ for name in must_ignore:
+ self.failIf(name in visible)
+
+
class DirectoryViewFolderTests(FSDVTest):
def setUp(self):
@@ -300,6 +321,7 @@
return TestSuite((
makeSuite(DirectoryViewPathTests),
makeSuite(DirectoryViewTests),
+ makeSuite(DirectoryViewIgnoreTests),
makeSuite(DirectoryViewFolderTests),
makeSuite(DebugModeTests),
))
More information about the CMF-checkins
mailing list