r144 - branches/rewrite/tests/Config

Otavio Salvador partial-mirror-devel@lists.alioth.debian.org
Sat, 03 Jul 2004 15:00:01 -0600


Author: otavio
Date: Sat Jul  3 15:00:01 2004
New Revision: 144

Modified:
   branches/rewrite/tests/Config/test.py
Log:
Added code to handle with required option nicely.

Modified: branches/rewrite/tests/Config/test.py
==============================================================================
--- branches/rewrite/tests/Config/test.py	(original)
+++ branches/rewrite/tests/Config/test.py	Sat Jul  3 15:00:01 2004
@@ -46,8 +46,12 @@
         else:
             print("Failed. Wrongly found the [%s] section as wrong." % msg.section)
     except RequiredOptionMissing, msg:
-        print("Required option [%s] in [%s] section not found."
-              % (msg.option, msg.section))
+        if should == 'RequiredOptionMissing':
+            print("Works. Forgot required option [%s] was found in [%s] section."
+                  % (msg.option, msg.section))
+        else:
+            print("Failed. Found one missing required option [%s] on [%s] section."
+                  % (msg.option, msg.section))
     except Exception, msg:
         print "Failed. Returned", msg