[Zope-Checkins] CVS: ZODB3/zLOG/tests - testzLogConfig.py:1.3

Fred L. Drake, Jr. fred@zope.com
Thu, 16 Jan 2003 10:36:03 -0500


Update of /cvs-repository/ZODB3/zLOG/tests
In directory cvs.zope.org:/tmp/cvs-serv6543/zLOG/tests

Modified Files:
	testzLogConfig.py 
Log Message:
- move the datatype for logging levels into the zLOG schema component
- add at least something of a test for the datatype


=== ZODB3/zLOG/tests/testzLogConfig.py 1.2 => 1.3 ===
--- ZODB3/zLOG/tests/testzLogConfig.py:1.2	Mon Jan 13 11:16:43 2003
+++ ZODB3/zLOG/tests/testzLogConfig.py	Thu Jan 16 10:35:59 2003
@@ -19,6 +19,7 @@
 import unittest
 
 import ZConfig
+import zLOG.datatypes
 import zLOG.LogHandlers
 import zLOG.tests
 
@@ -44,6 +45,19 @@
                                                StringIO.StringIO(text))
         self.assert_(not handler)
         return conf
+
+    def test_logging_level(self):
+        # Make sure the expected names are supported; it's not clear
+        # how to check the values in a meaningful way.
+        convert = zLOG.datatypes.logging_level
+        convert("all")
+        convert("debug")
+        convert("info")
+        convert("warn")
+        convert("error")
+        convert("fatal")
+        convert("critical")
+        self.assertRaises(ValueError, convert, "hopefully-not-a-valid-value")
 
     def test_config_without_logger(self):
         conf = self.get_config("")