[CMF-checkins] CVS: Products/CMFCore/tests - test_SkinsTool.py:1.5.14.1

Jens Vagelpohl jens at dataflake.org
Wed Apr 6 09:38:19 EDT 2005


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

Modified Files:
      Tag: CMF-1_5-branch
	test_SkinsTool.py 
Log Message:
- CMFCore.SkinsTool: Prevent adding skin layers with invalid path elements
  There is a disconnect between the ability to define what can be ignored
  inside DirectoryViews and what can be put into skins paths in
  the SkinsTool. Now a check is done inside addSkinSelection that makes
  sure the same ignore-policy that is used for the DirectoryView is
  applied to the elements of a skin path.
  (http://www.zope.org/Collectors/CMF/336)


=== Products/CMFCore/tests/test_SkinsTool.py 1.5 => 1.5.14.1 ===
--- Products/CMFCore/tests/test_SkinsTool.py:1.5	Mon Apr 26 08:14:17 2004
+++ Products/CMFCore/tests/test_SkinsTool.py	Wed Apr  6 09:38:19 2005
@@ -31,6 +31,25 @@
         verifyClass(ISkinsContainer, SkinsTool)
         verifyClass(IActionProvider, SkinsTool)
 
+    def test_add_invalid_path(self):
+        tool = SkinsTool()
+
+        # We start out with no wkin selections
+        self.assertEquals(len(tool.getSkinSelections()), 0)
+
+        # Add a skin selection with an invalid path element
+        paths = 'foo, bar, .svn'
+        tool.addSkinSelection('fooskin', paths)
+
+        # Make sure the skin selection exists
+        paths = tool.getSkinPath('fooskin')
+        self.failIf(paths is None)
+
+        # Test for the contents
+        self.failIf(paths.find('foo') == -1)
+        self.failIf(paths.find('bar') == -1)
+        self.failUnless(paths.find('.svn') == -1)
+
 
 def test_suite():
     return TestSuite((



More information about the CMF-checkins mailing list