[CMF-checkins] CVS: CMF/CMFCore/tests - test_FSFile.py:1.5 test_FSImage.py:1.8 test_FSPageTemplate.py:1.10

Yvo Schubbe cvs-admin at zope.org
Sun Nov 30 12:17:21 EST 2003


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

Modified Files:
	test_FSFile.py test_FSImage.py test_FSPageTemplate.py 
Log Message:
- moved DummyCachingManager into base/dummy.py
- fixed broken test: added getPhysicalPath() to DummyCachingManager


=== CMF/CMFCore/tests/test_FSFile.py 1.4 => 1.5 ===
--- CMF/CMFCore/tests/test_FSFile.py:1.4	Fri Jan 10 05:24:32 2003
+++ CMF/CMFCore/tests/test_FSFile.py	Sun Nov 30 12:17:20 2003
@@ -1,12 +1,19 @@
 import unittest
-import Zope
-import os.path
 
-class DummyCachingManager:
-    def getHTTPCachingHeaders( self, content, view_name, keywords, time=None ):
-        return ( ( 'foo', 'Foo' ), ( 'bar', 'Bar' ) )
+import Testing
+import Zope
+try:
+    Zope.startup()
+except AttributeError:
+    # for Zope versions before 2.6.1
+    pass
+
+from os.path import join as path_join
+
+from Products.CMFCore.tests.base.dummy import DummyCachingManager
+from Products.CMFCore.tests.base.testcase import FSDVTest
+from Products.CMFCore.tests.base.testcase import RequestTest
 
-from Products.CMFCore.tests.base.testcase import RequestTest, FSDVTest
 
 class FSFileTests( RequestTest, FSDVTest):
 
@@ -22,11 +29,11 @@
 
         from Products.CMFCore.FSFile import FSFile
         
-        return FSFile( id, os.path.join( self.skin_path_name, filename ) )
+        return FSFile( id, path_join(self.skin_path_name, filename) )
 
     def _extractFile( self ):
 
-        path = os.path.join( self.skin_path_name, 'test_file.swf' )
+        path = path_join(self.skin_path_name, 'test_file.swf')
         f = open( path, 'rb' )
         try:
             data = f.read()
@@ -113,6 +120,7 @@
         self.failUnless( data, '' )
         self.assertEqual( self.RESPONSE.getStatus(), 200 )
 
+
 def test_suite():
     return unittest.TestSuite((
         unittest.makeSuite(FSFileTests),
@@ -120,4 +128,3 @@
 
 if __name__ == '__main__':
     unittest.main(defaultTest='test_suite')
-


=== CMF/CMFCore/tests/test_FSImage.py 1.7 => 1.8 ===
--- CMF/CMFCore/tests/test_FSImage.py:1.7	Fri Jan 10 05:24:32 2003
+++ CMF/CMFCore/tests/test_FSImage.py	Sun Nov 30 12:17:20 2003
@@ -1,12 +1,19 @@
 import unittest
-import Zope
-import os.path
 
-class DummyCachingManager:
-    def getHTTPCachingHeaders( self, content, view_name, keywords, time=None ):
-        return ( ( 'foo', 'Foo' ), ( 'bar', 'Bar' ) )
+import Testing
+import Zope
+try:
+    Zope.startup()
+except AttributeError:
+    # for Zope versions before 2.6.1
+    pass
+
+from os.path import join as path_join
+
+from Products.CMFCore.tests.base.dummy import DummyCachingManager
+from Products.CMFCore.tests.base.testcase import FSDVTest
+from Products.CMFCore.tests.base.testcase import RequestTest
 
-from Products.CMFCore.tests.base.testcase import RequestTest, FSDVTest
 
 class FSImageTests( RequestTest, FSDVTest):
 
@@ -22,11 +29,11 @@
 
         from Products.CMFCore.FSImage import FSImage
         
-        return FSImage( id, os.path.join( self.skin_path_name, filename ) )
+        return FSImage( id, path_join(self.skin_path_name, filename) )
 
     def _extractFile( self ):
 
-        path = os.path.join( self.skin_path_name, 'test_image.gif' )
+        path = path_join(self.skin_path_name, 'test_image.gif')
         f = open( path, 'rb' )
         try:
             data = f.read()
@@ -113,6 +120,7 @@
         self.failUnless( data, '' )
         self.assertEqual( self.RESPONSE.getStatus(), 200 )
 
+
 def test_suite():
     return unittest.TestSuite((
         unittest.makeSuite(FSImageTests),
@@ -120,4 +128,3 @@
 
 if __name__ == '__main__':
     unittest.main(defaultTest='test_suite')
-


=== CMF/CMFCore/tests/test_FSPageTemplate.py 1.9 => 1.10 ===
--- CMF/CMFCore/tests/test_FSPageTemplate.py:1.9	Thu Sep  5 16:45:26 2002
+++ CMF/CMFCore/tests/test_FSPageTemplate.py	Sun Nov 30 12:17:21 2003
@@ -1,11 +1,18 @@
 import unittest
-import Zope
 
-class DummyCachingManager:
-    def getHTTPCachingHeaders( self, content, view_name, keywords, time=None ):
-        return ( ( 'foo', 'Foo' ), ( 'bar', 'Bar' ) )
+import Testing
+import Zope
+try:
+    Zope.startup()
+except AttributeError:
+    # for Zope versions before 2.6.1
+    pass
+
+from Products.CMFCore.tests.base.dummy import DummyCachingManager
+from Products.CMFCore.tests.base.testcase import FSDVTest
+from Products.CMFCore.tests.base.testcase import RequestTest
+from Products.CMFCore.tests.base.testcase import SecurityTest
 
-from Products.CMFCore.tests.base.testcase import RequestTest, SecurityTest, FSDVTest
 
 class FSPTMaker(FSDVTest):
 
@@ -16,6 +23,7 @@
 
         return FSPageTemplate( id, join( self.skin_path_name, filename ) )
 
+
 class FSPageTemplateTests( RequestTest, FSPTMaker ):
 
     def setUp(self):
@@ -78,6 +86,7 @@
         self.failUnless( 'foo' in self.RESPONSE.headers.keys() )
         self.failUnless( 'bar' in self.RESPONSE.headers.keys() )
 
+
 class FSPageTemplateCustomizationTests( SecurityTest, FSPTMaker ):
 
     def setUp( self ):
@@ -119,6 +128,7 @@
         SecurityTest.tearDown(self)
         FSPTMaker.tearDown(self)
 
+
 def test_suite():
     return unittest.TestSuite((
         unittest.makeSuite(FSPageTemplateTests),
@@ -127,4 +137,3 @@
 
 if __name__ == '__main__':
     unittest.main(defaultTest='test_suite')
-




More information about the CMF-checkins mailing list