[rhmessaging-commits] rhmessaging commits: r1685 - mgmt/cumin/python/cumin.

rhmessaging-commits at lists.jboss.org rhmessaging-commits at lists.jboss.org
Mon Feb 11 14:53:55 EST 2008


Author: justi9
Date: 2008-02-11 14:53:55 -0500 (Mon, 11 Feb 2008)
New Revision: 1685

Modified:
   mgmt/cumin/python/cumin/test.py
Log:
Move exception message handling into a method on TestCall.



Modified: mgmt/cumin/python/cumin/test.py
===================================================================
--- mgmt/cumin/python/cumin/test.py	2008-02-11 19:44:14 UTC (rev 1684)
+++ mgmt/cumin/python/cumin/test.py	2008-02-11 19:53:55 UTC (rev 1685)
@@ -69,7 +69,7 @@
         if self.failed:
             for call in self.failed:
                 out.write("  %s: %s" % \
-                              (call.test.path(), call.exception.message))
+                              (call.test.path(), call.get_exception_text()))
                 out.write(os.linesep)
 
                 for spec in extract_tb(call.traceback):
@@ -162,17 +162,23 @@
         status = "-"
 
         if self.exception:
-            status = self.exception.__class__.__name__
+            status = self.get_exception_text()
 
-            if hasattr(self.exception, "message"):
-                status = status + ": " + self.exception.message
-
         writer.write("%-40s %s" % (entry, status))
         writer.write(os.linesep)
 
         for call in self.callees:
             call.report(writer, depth + 1)
 
+    def get_exception_text(self):
+        if self.exception:
+            message = self.exception.__class__.__name__
+
+            if hasattr(self.exception, "message"):
+                message = message + ": " + self.exception.message
+
+            return message
+
 class MainTest(Test):
     def __init__(self, env):
         super(MainTest, self).__init__(env, None)




More information about the rhmessaging-commits mailing list