[Zope3-checkins] CVS: Zope3/lib/python/Zope/App/OFS/Services/ErrorReportingService/tests - testErrorReportingService.py:1.3

Barry Warsaw barry@wooz.org
Fri, 20 Dec 2002 14:35:13 -0500


Update of /cvs-repository/Zope3/lib/python/Zope/App/OFS/Services/ErrorReportingService/tests
In directory cvs.zope.org:/tmp/cvs-serv11652/lib/python/Zope/App/OFS/Services/ErrorReportingService/tests

Modified Files:
	testErrorReportingService.py 
Log Message:
test module cleanups:

- no docstrings in test methods (convert to comments)
- whitespace normalization
- other minor cleanups


=== Zope3/lib/python/Zope/App/OFS/Services/ErrorReportingService/tests/testErrorReportingService.py 1.2 => 1.3 ===
--- Zope3/lib/python/Zope/App/OFS/Services/ErrorReportingService/tests/testErrorReportingService.py:1.2	Wed Oct 23 12:00:20 2002
+++ Zope3/lib/python/Zope/App/OFS/Services/ErrorReportingService/tests/testErrorReportingService.py	Fri Dec 20 14:34:43 2002
@@ -2,47 +2,48 @@
 #
 # Copyright (c) 2001, 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.
-# 
+#
 ##############################################################################
 """
 
 Revision information:
 $Id$
 """
+import sys
+
 from unittest import TestCase, TestLoader, TextTestRunner
-from Zope.App.OFS.Services.ErrorReportingService.ErrorReportingService import ErrorReportingService
+from Zope.App.OFS.Services.ErrorReportingService.ErrorReportingService \
+     import ErrorReportingService
 from Zope.Testing.CleanUp import CleanUp
 from Zope.Exceptions.ExceptionFormatter import format_exception
 
-import sys
+
 class C1:
     def getAnErrorInfo(self):
-     exc_info = None
-     try:
-        someerror()
-     except:
-         exc_info = sys.exc_info()
-     return exc_info
+        exc_info = None
+        try:
+            someerror()
+        except:
+            exc_info = sys.exc_info()
+        return exc_info
 
-class ErrorReportingServiceTests(CleanUp, TestCase):
 
+class ErrorReportingServiceTests(CleanUp, TestCase):
     def test_checkForEmpryLog(self):
-        """Test Check Empty Log
-        """
+        # Test Check Empty Log
         errService = ErrorReportingService()
         getProp = errService.getLogEntries()
         self.failIf(getProp)
-        
+
     def test_checkProperties(self):
-        """Test Properties test
-        """
+        # Test Properties test
         errService = ErrorReportingService()
         setProp = {
             'keep_entries':10,
@@ -54,9 +55,8 @@
         self.assertEqual(setProp, getProp)
 
     def test_ErrorLog(self):
-        """Test for Logging Error .
-           Create one error and check whether its logged or not.
-        """ 
+        # Test for Logging Error.  Create one error and check whether its
+        # logged or not.
         errService = ErrorReportingService()
         exc_info = C1().getAnErrorInfo()
         errService.raising(exc_info)
@@ -66,10 +66,9 @@
         tb_text = ''.join(format_exception(*exc_info, **{'as_html': 0}))
 
         err_id =  getErrLog[0]['id']
-        self.assertEquals(tb_text, errService.getLogEntryById(err_id)['tb_text'])
+        self.assertEquals(tb_text,
+                          errService.getLogEntryById(err_id)['tb_text'])
 
-        
-