'Setting and retrieving log levels.'

def test_setLogLevel(self):

    predicate = LogLevelFilterPredicate()
    predicate.setLogLevelForNamespace(None, LogLevel.error)
    predicate.setLogLevelForNamespace('twext.web2', LogLevel.debug)
    predicate.setLogLevelForNamespace('twext.web2.dav', LogLevel.warn)
    self.assertEqual(predicate.logLevelForNamespace(None), LogLevel.error)
    self.assertEqual(predicate.logLevelForNamespace('twisted'), LogLevel.error)
    self.assertEqual(predicate.logLevelForNamespace('twext.web2'), LogLevel.debug)
    self.assertEqual(predicate.logLevelForNamespace('twext.web2.dav'), LogLevel.warn)
    self.assertEqual(predicate.logLevelForNamespace('twext.web2.dav.test'), LogLevel.warn)
    self.assertEqual(predicate.logLevelForNamespace('twext.web2.dav.test1.test2'), LogLevel.warn)
