[CMF-checkins] CVS: Products/CMFCore/tests - test_DirectoryView.py:1.19.10.3

Jens Vagelpohl jens at dataflake.org
Wed Apr 6 05:54:09 EDT 2005


Update of /cvs-repository/Products/CMFCore/tests
In directory cvs.zope.org:/tmp/cvs-serv24011/CMFCore/tests

Modified Files:
      Tag: CMF-1_5-branch
	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.19.10.2 => 1.19.10.3 ===
--- Products/CMFCore/tests/test_DirectoryView.py:1.19.10.2	Mon Mar  7 18:02:40 2005
+++ Products/CMFCore/tests/test_DirectoryView.py	Wed Apr  6 05:53:39 2005
@@ -145,8 +145,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
@@ -173,6 +175,26 @@
                          )
 
 
+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)
+
+
+
 if DevelopmentMode:
 
   class DebugModeTests( FSDVTest ):
@@ -248,6 +270,7 @@
     return TestSuite((
         makeSuite(DirectoryViewPathTests),
         makeSuite(DirectoryViewTests),
+        makeSuite(DirectoryViewIgnoreTests),
         makeSuite(DebugModeTests),
         ))
 



More information about the CMF-checkins mailing list