[CalendarServer-changes] [11269] CalendarServer/trunk/twext/python/test/test_log.py
source_changes at macosforge.org
source_changes at macosforge.org
Thu May 30 12:08:41 PDT 2013
Revision: 11269
http://trac.calendarserver.org//changeset/11269
Author: wsanchez at apple.com
Date: 2013-05-30 12:08:41 -0700 (Thu, 30 May 2013)
Log Message:
-----------
Add test_setInvalidLogLevel
Modified Paths:
--------------
CalendarServer/trunk/twext/python/test/test_log.py
Modified: CalendarServer/trunk/twext/python/test/test_log.py
===================================================================
--- CalendarServer/trunk/twext/python/test/test_log.py 2013-05-30 19:05:35 UTC (rev 11268)
+++ CalendarServer/trunk/twext/python/test/test_log.py 2013-05-30 19:08:41 UTC (rev 11269)
@@ -184,7 +184,7 @@
self.fail("Expected InvalidLogLevelError.")
- def test_logLevel(self):
+ def test_setLogLevel(self):
"""
Setting and retrieving log levels.
"""
@@ -198,6 +198,16 @@
self.assertEquals(logLevelForNamespace("twext.web2.dav.test1.test2"), LogLevel.error)
+ def test_setInvalidLogLevel(self):
+ """
+ Can't pass invalid log levels to setLogLevelForNamespace().
+ """
+ self.assertRaises(InvalidLogLevelError, setLogLevelForNamespace, "twext.web2", object())
+
+ # Level must be a constant, not the name of a constant
+ self.assertRaises(InvalidLogLevelError, setLogLevelForNamespace, "twext.web2", "debug")
+
+
def test_clearLogLevel(self):
"""
Clearing log levels.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.macosforge.org/pipermail/calendarserver-changes/attachments/20130530/cfcaa801/attachment.html>
More information about the calendarserver-changes
mailing list