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

Chris Withers chrisw@nipltd.com
Mon, 5 Aug 2002 10:23:41 -0400


Update of /cvs-repository/CMF/CMFCore/tests
In directory cvs.zope.org:/tmp/cvs-serv28775/CMFCore/tests

Modified Files:
	test_DirectoryView.py 
Log Message:
Hopefully fixed problems with DirectoryView's beign created on one platform and then imported from a .zexp on another.

=== CMF/CMFCore/tests/test_DirectoryView.py 1.8 => 1.9 ===
 import Zope
 from unittest import TestCase, TestSuite, makeSuite, main
 
-from Products.CMFCore.tests.base.dummy import \
-     DummyFolder
+from Products.CMFCore.tests.base.dummy import DummyFolder
+
+from Products.CMFCore.DirectoryView import registerDirectory
+from Products.CMFCore.DirectoryView import addDirectoryViews
+from Products.CMFCore.DirectoryView import DirectoryViewSurrogate
+from Products.CMFCore.DirectoryView import _dirreg
+from Products.CMFCore.DirectoryView import DirectoryInformation
 
-from Products.CMFCore.DirectoryView import \
-     registerDirectory,addDirectoryViews,DirectoryViewSurrogate
 from Globals import package_home, DevelopmentMode
 
 from os import remove, mkdir, rmdir, curdir, stat
@@ -52,9 +55,37 @@
 
 class DirectoryViewTests1( TestCase ):
 
+    def setUp(self):
+        _registerDirectory()
+        self.ob = DummyFolder()
+        
     def test_registerDirectory( self ):
         """ Test registerDirectory  """
-        _registerDirectory()
+        pass
+    
+    def test_getDirectoryInfo1( self ):
+        """ windows INSTANCE_HOME  """
+        addDirectoryViews(self.ob, 'fake_skins', _prefix)
+        self.ob.fake_skin.manage_properties(r'Products\CMFCore\tests\fake_skins\fake_skin')        
+        self.failUnless(hasattr(self.ob.fake_skin,'test1'))
+
+    def test_getDirectoryInfo2( self ):
+        """ windows SOFTWARE_HOME  """
+        addDirectoryViews(self.ob, 'fake_skins', _prefix)
+        self.ob.fake_skin.manage_properties(r'C:\Zope\2.5.1\Products\CMFCore\tests\fake_skins\fake_skin')        
+        self.failUnless(hasattr(self.ob.fake_skin,'test1'))
+
+    def test_getDirectoryInfo3( self ):
+        """ *nix INSTANCE_HOME  """
+        addDirectoryViews(self.ob, 'fake_skins', _prefix)
+        self.ob.fake_skin.manage_properties('Products/CMFCore/tests/fake_skins/fake_skin')        
+        self.failUnless(hasattr(self.ob.fake_skin,'test1'))
+
+    def test_getDirectoryInfo4( self ):
+        """ *nix SOFTWARE_HOME  """
+        addDirectoryViews(self.ob, 'fake_skins', _prefix)
+        self.ob.fake_skin.manage_properties('/usr/local/zope/2.5.1/Products/CMFCore/tests/fake_skins/fake_skin')        
+        self.failUnless(hasattr(self.ob.fake_skin,'test1'))
 
 class DirectoryViewTests2( TestCase ):
 
@@ -81,7 +112,6 @@
         """Make sure the directory view is reading properties"""
         self.assertEqual(self.ob.fake_skin.testPT.title, 'Zope Pope')
 
-
 test1path = join(skin_path_name,'test1.py')
 test2path = join(skin_path_name,'test2.py')
 test3path = join(skin_path_name,'test3')
@@ -204,8 +234,8 @@
 
 def test_suite():
     return TestSuite((
-        # makeSuite(DirectoryViewTests1),
-        # makeSuite(DirectoryViewTests2),
+        makeSuite(DirectoryViewTests1),
+        makeSuite(DirectoryViewTests2),
         makeSuite(DebugModeTests),
         ))