[Checkins] SVN: Products.CMFCore/trunk/Products/CMFCore/tests/ - import rfc1123_date directly from App.Common

Yvo Schubbe y.2011 at wcm-solutions.de
Wed Mar 2 11:39:20 EST 2011


Log message for revision 120679:
  - import rfc1123_date directly from App.Common

Changed:
  U   Products.CMFCore/trunk/Products/CMFCore/tests/base/dummy.py
  U   Products.CMFCore/trunk/Products/CMFCore/tests/test_FSDTMLMethod.py
  U   Products.CMFCore/trunk/Products/CMFCore/tests/test_FSFile.py
  U   Products.CMFCore/trunk/Products/CMFCore/tests/test_FSImage.py
  U   Products.CMFCore/trunk/Products/CMFCore/tests/test_FSReSTMethod.py
  U   Products.CMFCore/trunk/Products/CMFCore/tests/test_FSSTXMethod.py

-=-
Modified: Products.CMFCore/trunk/Products/CMFCore/tests/base/dummy.py
===================================================================
--- Products.CMFCore/trunk/Products/CMFCore/tests/base/dummy.py	2011-03-02 16:37:44 UTC (rev 120678)
+++ Products.CMFCore/trunk/Products/CMFCore/tests/base/dummy.py	2011-03-02 16:39:20 UTC (rev 120679)
@@ -14,11 +14,11 @@
 """
 
 from Acquisition import Implicit, aq_base, aq_inner, aq_parent
+from App.Common import rfc1123_date
 from OFS.event import ObjectWillBeAddedEvent
 from OFS.event import ObjectWillBeRemovedEvent
 from OFS.interfaces import IObjectManager
 from OFS.SimpleItem import Item
-from webdav.common import rfc1123_date
 from zope.component.factory import Factory
 from zope.container.contained import notifyContainerModified
 from zope.container.contained import ObjectAddedEvent

Modified: Products.CMFCore/trunk/Products/CMFCore/tests/test_FSDTMLMethod.py
===================================================================
--- Products.CMFCore/trunk/Products/CMFCore/tests/test_FSDTMLMethod.py	2011-03-02 16:37:44 UTC (rev 120678)
+++ Products.CMFCore/trunk/Products/CMFCore/tests/test_FSDTMLMethod.py	2011-03-02 16:39:20 UTC (rev 120679)
@@ -20,6 +20,7 @@
 
 from AccessControl.SecurityManagement import newSecurityManager
 from Acquisition import aq_base
+from App.Common import rfc1123_date
 from DateTime import DateTime
 from OFS.Folder import Folder
 from Products.StandardCacheManagers import RAMCacheManager
@@ -89,9 +90,6 @@
 
     def test_304_response_from_cpm( self ):
         # test that we get a 304 response from the cpm via this template
-
-        from webdav.common import rfc1123_date
-
         mod_time = DateTime()
         self._setupCachingPolicyManager(DummyCachingManagerWithPolicy())
         content = DummyContent(id='content')
@@ -140,9 +138,6 @@
         self.failUnless( 'testDTML' in self.custom.objectIds() )
 
     def test_customize_alternate_root( self ):
-
-        from OFS.Folder import Folder
-
         self.root.other = Folder('other')
 
         self.fsDTML.manage_doCustomize( folder_path='other', root=self.root )
@@ -158,9 +153,6 @@
         self.failUnless( 'testDTML' in self.skins.objectIds() )
 
     def test_customize_manual_clone( self ):
-
-        from OFS.Folder import Folder
-
         clone = Folder('testDTML')
 
         self.fsDTML.manage_doCustomize( folder_path='custom', obj=clone )

Modified: Products.CMFCore/trunk/Products/CMFCore/tests/test_FSFile.py
===================================================================
--- Products.CMFCore/trunk/Products/CMFCore/tests/test_FSFile.py	2011-03-02 16:37:44 UTC (rev 120678)
+++ Products.CMFCore/trunk/Products/CMFCore/tests/test_FSFile.py	2011-03-02 16:39:20 UTC (rev 120679)
@@ -15,6 +15,10 @@
 
 import unittest
 
+import os
+from App.Common import rfc1123_date
+
+from Products.CMFCore.tests.base.dummy import FAKE_ETAG
 from Products.CMFCore.tests.base.testcase import FSDVTest
 from Products.CMFCore.tests.base.testcase import RequestTest
 
@@ -30,8 +34,6 @@
         FSDVTest.tearDown(self)
 
     def _makeOne( self, id, filename ):
-        import os
-
         from Products.CMFCore.FSFile import FSFile
         from Products.CMFCore.FSMetadata import FSMetadata
 
@@ -43,8 +45,6 @@
         return fsfile_ob
 
     def _extractFile( self, filename ):
-        import os
-
         path = os.path.join(self.skin_path_name, filename)
         f = open( path, 'rb' )
         try:
@@ -71,12 +71,7 @@
         self.assertEqual( len(str(file)), len( ref ) )
 
     def test_index_html( self ):
-
         path, ref = self._extractFile('test_file.swf')
-
-        import os
-        from webdav.common import rfc1123_date
-
         mod_time = os.stat( path )[ 8 ]
 
         file = self._makeOne( 'test_file', 'test_file.swf' )
@@ -95,12 +90,7 @@
                         , rfc1123_date( mod_time ) )
 
     def test_index_html_with_304( self ):
-
         path, ref = self._extractFile('test_file.swf')
-
-        import os
-        from webdav.common import rfc1123_date
-
         mod_time = os.stat( path )[ 8 ]
 
         file = self._makeOne( 'test_file', 'test_file.swf' )
@@ -118,12 +108,7 @@
         self.assertEqual( self.RESPONSE.getStatus(), 304 )
 
     def test_index_html_without_304( self ):
-
         path, ref = self._extractFile('test_file.swf')
-
-        import os
-        from webdav.common import rfc1123_date
-
         mod_time = os.stat( path )[ 8 ]
 
         file = self._makeOne( 'test_file', 'test_file.swf' )
@@ -142,11 +127,6 @@
             import DummyCachingManagerWithPolicy
         self.root.caching_policy_manager = DummyCachingManagerWithPolicy()
         path, ref = self._extractFile('test_file.swf')
-
-        import os
-        from webdav.common import rfc1123_date
-        from base.dummy import FAKE_ETAG
-        
         file = self._makeOne( 'test_file', 'test_file.swf' )
         file = file.__of__( self.root )
 
@@ -166,10 +146,6 @@
         from Products.CMFCore.tests.base.dummy import DummyCachingManager
         self.root.caching_policy_manager = DummyCachingManager()
         path, ref = self._extractFile('test_file.swf')
-
-        import os
-        from webdav.common import rfc1123_date
-        
         file = self._makeOne( 'test_file', 'test_file.swf' )
         file = file.__of__( self.root )
 
@@ -201,12 +177,7 @@
         self.assertEqual(headers['test_path'], '/test_file')
 
     def test_forced_content_type( self ):
-
         path, ref = self._extractFile('test_file_two.swf')
-
-        import os
-        from webdav.common import rfc1123_date
-
         mod_time = os.stat( path )[ 8 ]
 
         file = self._makeOne( 'test_file', 'test_file_two.swf' )

Modified: Products.CMFCore/trunk/Products/CMFCore/tests/test_FSImage.py
===================================================================
--- Products.CMFCore/trunk/Products/CMFCore/tests/test_FSImage.py	2011-03-02 16:37:44 UTC (rev 120678)
+++ Products.CMFCore/trunk/Products/CMFCore/tests/test_FSImage.py	2011-03-02 16:39:20 UTC (rev 120679)
@@ -16,10 +16,14 @@
 import unittest
 import Testing
 
+import os
 from os.path import join as path_join
 
+from App.Common import rfc1123_date
+
 from Products.CMFCore.tests.base.dummy import DummyCachingManager
 from Products.CMFCore.tests.base.dummy import DummyCachingManagerWithPolicy
+from Products.CMFCore.tests.base.dummy import FAKE_ETAG
 from Products.CMFCore.tests.base.testcase import FSDVTest
 from Products.CMFCore.tests.base.testcase import RequestTest
 
@@ -62,12 +66,7 @@
         self.assertEqual( image._data, ref )
 
     def test_index_html( self ):
-
         path, ref = self._extractFile()
-
-        import os
-        from webdav.common import rfc1123_date
-
         mod_time = os.stat( path )[ 8 ]
 
         image = self._makeOne( 'test_image', 'test_image.gif' )
@@ -86,12 +85,7 @@
                         , rfc1123_date( mod_time ) )
 
     def test_index_html_with_304( self ):
-
         path, ref = self._extractFile()
-
-        import os
-        from webdav.common import rfc1123_date
-
         mod_time = os.stat( path )[ 8 ]
 
         image = self._makeOne( 'test_image', 'test_image.gif' )
@@ -109,12 +103,7 @@
         self.assertEqual( self.RESPONSE.getStatus(), 304 )
 
     def test_index_html_without_304( self ):
-
         path, ref = self._extractFile()
-
-        import os
-        from webdav.common import rfc1123_date
-
         mod_time = os.stat( path )[ 8 ]
 
         image = self._makeOne( 'test_image', 'test_image.gif' )
@@ -131,11 +120,6 @@
     def test_index_html_with_304_from_cpm( self ):
         self.root.caching_policy_manager = DummyCachingManagerWithPolicy()
         path, ref = self._extractFile()
-
-        import os
-        from webdav.common import rfc1123_date
-        from base.dummy import FAKE_ETAG
-        
         file = self._makeOne( 'test_file', 'test_image.gif' )
         file = file.__of__( self.root )
 
@@ -165,10 +149,6 @@
     def test_index_html_200_with_cpm( self ):
         self.root.caching_policy_manager = DummyCachingManagerWithPolicy()
         path, ref = self._extractFile()
-
-        import os
-        from webdav.common import rfc1123_date
-        
         file = self._makeOne( 'test_file', 'test_image.gif' )
         file = file.__of__( self.root )
 
@@ -188,15 +168,10 @@
                         , rfc1123_date( mod_time ) )
 
     def test_index_html_with_304_and_caching( self ):
-
         # See collector #355
         self.root.caching_policy_manager = DummyCachingManager()
         original_len = len(self.RESPONSE.headers)
         path, ref = self._extractFile()
-
-        import os
-        from webdav.common import rfc1123_date
-
         mod_time = os.stat( path )[ 8 ]
 
         image = self._makeOne( 'test_image', 'test_image.gif' )

Modified: Products.CMFCore/trunk/Products/CMFCore/tests/test_FSReSTMethod.py
===================================================================
--- Products.CMFCore/trunk/Products/CMFCore/tests/test_FSReSTMethod.py	2011-03-02 16:37:44 UTC (rev 120678)
+++ Products.CMFCore/trunk/Products/CMFCore/tests/test_FSReSTMethod.py	2011-03-02 16:39:20 UTC (rev 120679)
@@ -21,6 +21,7 @@
 
 from AccessControl.SecurityManagement import newSecurityManager
 from Acquisition import aq_base
+from App.Common import rfc1123_date
 from zope.testing.cleanup import cleanUp
 
 from Products.CMFCore.testing import TraversingZCMLLayer
@@ -124,7 +125,6 @@
     def test_304_response_from_cpm( self ):
         # test that we get a 304 response from the cpm via this template
         from DateTime import DateTime
-        from webdav.common import rfc1123_date
         from Products.CMFCore.tests.base.dummy \
             import DummyCachingManagerWithPolicy
 

Modified: Products.CMFCore/trunk/Products/CMFCore/tests/test_FSSTXMethod.py
===================================================================
--- Products.CMFCore/trunk/Products/CMFCore/tests/test_FSSTXMethod.py	2011-03-02 16:37:44 UTC (rev 120678)
+++ Products.CMFCore/trunk/Products/CMFCore/tests/test_FSSTXMethod.py	2011-03-02 16:39:20 UTC (rev 120679)
@@ -21,6 +21,7 @@
 
 from AccessControl.SecurityManagement import newSecurityManager
 from Acquisition import aq_base
+from App.Common import rfc1123_date
 from zope.testing.cleanup import cleanUp
 
 from Products.CMFCore.testing import TraversingZCMLLayer
@@ -154,7 +155,6 @@
     def test_304_response_from_cpm( self ):
         # test that we get a 304 response from the cpm via this template
         from DateTime import DateTime
-        from webdav.common import rfc1123_date
         from Products.CMFCore.tests.base.dummy \
             import DummyCachingManagerWithPolicy
 



More information about the checkins mailing list