[CMF-checkins] CVS: CMF/CMFDefault/tests - test_Discussions.py:1.14.26.1 test_Document.py:1.28.4.1 test_Favorite.py:1.6.32.1 test_Image.py:1.4.40.1 test_Link.py:1.9.38.1 test_MetadataTool.py:1.6.26.1 test_NewsItem.py:1.7.40.1 test_Portal.py:1.3.34.1 test_utils.py:1.9.16.1

Sidnei da Silva sidnei at awkly.org
Thu Apr 22 13:48:29 EDT 2004


Update of /cvs-repository/CMF/CMFDefault/tests
In directory cvs.zope.org:/tmp/cvs-serv30596/CMFDefault/tests

Modified Files:
      Tag: CMF-1_4-branch
	test_Discussions.py test_Document.py test_Favorite.py 
	test_Image.py test_Link.py test_MetadataTool.py 
	test_NewsItem.py test_Portal.py test_utils.py 
Log Message:
Fix version.txt to right version. Run reindent.py for removing extra tabs and whitespaces


=== CMF/CMFDefault/tests/test_Discussions.py 1.14 => 1.14.26.1 ===
--- CMF/CMFDefault/tests/test_Discussions.py:1.14	Mon Jan  6 15:43:10 2003
+++ CMF/CMFDefault/tests/test_Discussions.py	Thu Apr 22 13:47:55 2004
@@ -54,9 +54,9 @@
 class DiscussionTests( SecurityTest ):
 
     def setUp( self ):
-        
+
         SecurityTest.setUp(self)
-        
+
         root = self.root
         root._setObject( 'portal_discussion', DiscussionTool() )
         self.discussion_tool = root.portal_discussion
@@ -64,14 +64,14 @@
         self.catalog_tool = root.portal_catalog
         root._setObject( 'portal_url', URLTool() )
         self.url_tool = root.portal_url
-        root._setObject( 'portal_workflow', WorkflowTool() ) 
+        root._setObject( 'portal_workflow', WorkflowTool() )
         self.workflow_tool = root.portal_workflow
         root._setObject( 'portal_types', TypesTool() )
         types_tool = self.types_tool = root.portal_types
         try: root._delObject('test')
         except AttributeError: pass
         root._setObject( 'test', DummyContent( 'test', catalog=1 ) )
-            
+
     def test_policy( self ):
 
         test = self.root.test
@@ -110,7 +110,7 @@
         test.allow_discussion = 1
         assert self.discussion_tool.getDiscussionFor( test )
         assert test.talkback
-    
+
     def test_nestedReplies( self ):
         test = self.root.test
         test.allow_discussion = 1


=== CMF/CMFDefault/tests/test_Document.py 1.28 => 1.28.4.1 ===
--- CMF/CMFDefault/tests/test_Document.py:1.28	Sat Mar 15 05:43:22 2003
+++ CMF/CMFDefault/tests/test_Document.py	Thu Apr 22 13:47:55 2004
@@ -71,7 +71,7 @@
         self.assertEqual( len(d.Contributors()), 3 )
 
     def test_EntityInTitle(self):
-        self.REQUEST['BODY'] = ENTITY_IN_TITLE 
+        self.REQUEST['BODY'] = ENTITY_IN_TITLE
         d = self.d
         d.PUT(self.REQUEST, self.RESPONSE)
         self.assertEqual( d.title, '&Auuml;rger' )
@@ -119,17 +119,17 @@
         file = StringIO( html )
         d.edit(text_format='html', text='', file=file)
         self.assertEqual( d.CookedBody(), body )
-        
+
     def test_plain_text(self):
         """test that plain text forrmat works"""
-        d = self.d 
+        d = self.d
         d.edit(text_format='plain', text='*some plain text*\nwith a newline')
         self.assertEqual( d.CookedBody(), '*some plain text*<br>with a newline')
 
     def test_EditStructuredTextWithHTML(self):
         d = self.d
         d.edit(text_format='structured-text', text=STX_WITH_HTML)
-        
+
         self.assertEqual( d.Format(), 'text/plain' )
 
     def test_StructuredText(self):
@@ -210,7 +210,7 @@
         self.assertEqual( d.EditableBody(), STX_NO_HEADERS )
         self.failUnless( d.CookedBody() )
         self.assertEqual( d.Format(), 'text/plain' )
-    
+
     def test_STX_NoHeaders( self ):
         self.REQUEST['BODY']=STX_NO_HEADERS
         d = self.d
@@ -226,14 +226,14 @@
         self.failUnless( 'STX' in d.Subject() )
 
         d.PUT(self.REQUEST, self.RESPONSE)
-        
+
         self.assertEqual( d.Format(), 'text/plain' )
         self.assertEqual( d.Title(), 'Plain STX' )
         self.assertEqual( d.Description(), 'Look, Ma, no headers!' )
         self.assertEqual( len( d.Subject() ), 2 )
         self.failUnless( 'plain' in d.Subject() )
         self.failUnless( 'STX' in d.Subject() )
-    
+
     def test_STX_NoHeaders_but_colon( self ):
         d = self.d
         d.editMetadata( title="Plain STX"
@@ -243,7 +243,7 @@
 
         d.edit(text_format='structured-text', text=STX_NO_HEADERS_BUT_COLON)
         self.assertEqual( d.EditableBody(), STX_NO_HEADERS_BUT_COLON )
-    
+
     def test_ZMI_edit( self ):
         d = self.d
         d.editMetadata( title="Plain STX"
@@ -316,7 +316,7 @@
         title_pattern = compile( r'<title>(.*)</title>' )
         simple_headers = []
         while simple_lines and simple_lines[0] != '<BODY>':
-            header = simple_lines[0].strip().lower() 
+            header = simple_lines[0].strip().lower()
             match = meta_pattern.search( header )
             if match:
                 simple_headers.append( match.groups() )
@@ -416,7 +416,7 @@
         self.assertEqual( r.status, 204 )
 
     def test_PutStructuredTextWithHTML(self):
-            
+
         self.REQUEST['BODY'] = STX_WITH_HTML
 
         r = self.d.PUT(self.REQUEST, self.RESPONSE)
@@ -432,10 +432,10 @@
         self.assertEqual( r.status, 204 )
 
     def test_PutHtmlWithDoctype(self):
-        
+
         html = '%s\n\n  \n   %s' % (DOCTYPE, BASIC_HTML)
         self.REQUEST['BODY'] = html
-        
+
         r = self.d.PUT(self.REQUEST, self.RESPONSE)
         self.assertEqual( self.d.Format(), 'text/html' )
         self.assertEqual( self.d.Description(), 'Describe me' )
@@ -451,4 +451,3 @@
 
 if __name__ == '__main__':
     main(defaultTest='test_suite')
-


=== CMF/CMFDefault/tests/test_Favorite.py 1.6 => 1.6.32.1 ===
--- CMF/CMFDefault/tests/test_Favorite.py:1.6	Sat Aug  3 15:25:00 2002
+++ CMF/CMFDefault/tests/test_Favorite.py	Thu Apr 22 13:47:55 2004
@@ -1,14 +1,14 @@
 ##############################################################################
 #
 # Copyright (c) 2001 Zope Corporation and Contributors. All Rights Reserved.
-# 
+#
 # This software is subject to the provisions of the Zope Public License,
 # Version 2.0 (ZPL).  A copy of the ZPL should accompany this distribution.
 # THIS SOFTWARE IS PROVIDED "AS IS" AND ANY AND ALL EXPRESS OR IMPLIED
 # WARRANTIES ARE DISCLAIMED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
 # WARRANTIES OF TITLE, MERCHANTABILITY, AGAINST INFRINGEMENT, AND FITNESS
 # FOR A PARTICULAR PURPOSE
-# 
+#
 ##############################################################################
 """ Unit tests for Favorites.
 


=== CMF/CMFDefault/tests/test_Image.py 1.4 => 1.4.40.1 ===
--- CMF/CMFDefault/tests/test_Image.py:1.4	Fri Feb 15 14:45:34 2002
+++ CMF/CMFDefault/tests/test_Image.py	Thu Apr 22 13:47:55 2004
@@ -28,7 +28,7 @@
 
         assert image.get_size() > 0
         assert image.get_size() == testfilesize
-        
+
 def test_suite():
     return TestSuite((
         makeSuite(TestImageElement),
@@ -36,4 +36,4 @@
     return suite
 
 if __name__ == '__main__':
-    main(defaultTest='test_suite')        
+    main(defaultTest='test_suite')


=== CMF/CMFDefault/tests/test_Link.py 1.9 => 1.9.38.1 ===
--- CMF/CMFDefault/tests/test_Link.py:1.9	Mon Jul  1 12:24:21 2002
+++ CMF/CMFDefault/tests/test_Link.py	Thu Apr 22 13:47:55 2004
@@ -55,7 +55,7 @@
     def test_StructuredText( self ):
         d = Link('foo')
         d._writeFromPUT( body=BASIC_STRUCTUREDTEXT )
-        
+
         self.assertEqual( d.Title(), 'Zope Community' )
         self.assertEqual( d.Description()
                         , 'Link to the Zope Community website.' )
@@ -68,7 +68,7 @@
         d._writeFromPUT( body=STX_W_CONTINUATION )
         rnlinesplit = compile( r'\r?\n?' )
         desc_lines = rnlinesplit.split( d.Description() )
-        
+
         self.assertEqual( d.Title(), 'Zope Community' )
         self.assertEqual( desc_lines[0]
                         , 'Link to the Zope Community website,' )


=== CMF/CMFDefault/tests/test_MetadataTool.py 1.6 => 1.6.26.1 ===
--- CMF/CMFDefault/tests/test_MetadataTool.py:1.6	Mon Jan  6 15:43:20 2003
+++ CMF/CMFDefault/tests/test_MetadataTool.py	Thu Apr 22 13:47:55 2004
@@ -137,7 +137,7 @@
             pass
         else:
             assert 0, "Expected KeyError"
-        
+
         assert not self.tool.listAllowedSubjects()
         assert not self.tool.listAllowedFormats()
         assert not self.tool.listAllowedLanguages()
@@ -270,7 +270,7 @@
         formats = ( 'text/plain', 'text/html' )
         fDef.edit( 0, 0, '', 0, ( 'text/plain', 'text/html' ) )
         assert self.tool.listAllowedFormats() == formats
-        
+
         foo = Foo()
         assert self.tool.listAllowedFormats( foo ) == formats
         fSpec.addPolicy( 'Foo' )


=== CMF/CMFDefault/tests/test_NewsItem.py 1.7 => 1.7.40.1 ===
--- CMF/CMFDefault/tests/test_NewsItem.py:1.7	Mon Apr  1 17:11:21 2002
+++ CMF/CMFDefault/tests/test_NewsItem.py	Thu Apr 22 13:47:55 2004
@@ -91,7 +91,7 @@
         self.REQUEST['BODY'] = BASIC_STRUCTUREDTEXT
         d = NewsItem('foo')
         d.PUT( self.REQUEST, self.RESPONSE )
-        
+
         self.assertEqual( d.Title(), 'My Document')
         self.assertEqual( d.Description(), 'A document by me')
         self.assertEqual( d.Format(), 'text/plain' )


=== CMF/CMFDefault/tests/test_Portal.py 1.3 => 1.3.34.1 ===
--- CMF/CMFDefault/tests/test_Portal.py:1.3	Tue Jul 23 14:38:36 2002
+++ CMF/CMFDefault/tests/test_Portal.py	Thu Apr 22 13:47:55 2004
@@ -1,14 +1,14 @@
 ##############################################################################
 #
 # Copyright (c) 2002 Zope Corporation and Contributors. All Rights Reserved.
-# 
+#
 # This software is subject to the provisions of the Zope Public License,
 # Version 2.0 (ZPL).  A copy of the ZPL should accompany this distribution.
 # THIS SOFTWARE IS PROVIDED "AS IS" AND ANY AND ALL EXPRESS OR IMPLIED
 # WARRANTIES ARE DISCLAIMED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
 # WARRANTIES OF TITLE, MERCHANTABILITY, AGAINST INFRINGEMENT, AND FITNESS
 # FOR A PARTICULAR PURPOSE
-# 
+#
 ##############################################################################
 
 """ Unit / functional tests for a CMFSite.


=== CMF/CMFDefault/tests/test_utils.py 1.9 => 1.9.16.1 ===
--- CMF/CMFDefault/tests/test_utils.py:1.9	Sun Feb 23 07:24:26 2003
+++ CMF/CMFDefault/tests/test_utils.py	Thu Apr 22 13:47:55 2004
@@ -48,7 +48,7 @@
         desc_len = len( headers[ 'Description' ].split('\n') )
         assert( desc_len == 2, '%d!' % desc_len )
         assert( len( body ) == 0, '%d!' % len( body ) )
-    
+
     def test_Body( self ):
         headers, body = parseHeadersBody( '%s\n\n%s'
                                         % ( self.COMMON_HEADERS
@@ -57,7 +57,7 @@
                                         )
         assert( len( headers ) == 2, '%d!' % len( headers ) )
         assert( body == self.TEST_BODY )
-    
+
     def test_Preload( self ):
         preloaded = { 'Author' : 'xxx', 'text_format' : 'structured_text' }
         headers, body = parseHeadersBody( '%s\n%s\n\n%s'




More information about the CMF-checkins mailing list