r147 - branches/rewrite/tests/Config

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


Author: otavio
Date: Sat Jul  3 15:21:18 2004
New Revision: 147

Modified:
   branches/rewrite/tests/Config/test.py
Log:
Reformat it.

Modified: branches/rewrite/tests/Config/test.py
==============================================================================
--- branches/rewrite/tests/Config/test.py	(original)
+++ branches/rewrite/tests/Config/test.py	Sat Jul  3 15:21:18 2004
@@ -26,29 +26,28 @@
 #getLogger().setLevel(DEBUG)
 
 def test(msg, conf, should=None):
-    stdout.write(msg + "... ")
+    stdout.write("Testing Config: " + msg + "... ")
     try:
         Config(conf)
         if not should:
             print "Works."
         else:
-            print "Failed. This doesn't found the expected error."
+            print("Failed. This doesn't found the expected error that should be [%s]."
+                  % should)
     except InvalidOption, msg:
         if should == 'InvalidOption':
-            print("Works. Found the [%s] option on [%s] section."
-                  % (msg.option, msg.section))
+            print "Works."
         else:
             print("Failed. Wrongly found the [%s] option as wrong on [%s] section."
                   % (msg.option, msg.section))
     except InvalidSection, msg:
         if should == 'InvalidSection':
-            print("Works. Found the invalid section [%s]." % msg.section)
+            print "Works."
         else:
             print("Failed. Wrongly found the [%s] section as wrong." % msg.section)
     except RequiredOptionMissing, msg:
         if should == 'RequiredOptionMissing':
-            print("Works. Forgot required option [%s] was found in [%s] section."
-                  % (msg.option, msg.section))
+            print "Works."
         else:
             print("Failed. Found one missing required option [%s] on [%s] section."
                   % (msg.option, msg.section))
@@ -57,5 +56,5 @@
 
 
 test('Good configuration file', 'good.conf')
-test('Missing-required configuration file', 'missingrequired.conf', 'RequiredOptionMissing')
-test('Invalid-option configuration file', 'invalidoption.conf', 'InvalidOption')
+test('Missing Required configuration file', 'missingrequired.conf', 'RequiredOptionMissing')
+test('Invalid Option configuration file', 'invalidoption.conf', 'InvalidOption')