From f2d88519b0f7d197f775b7695d46bc9e9bb14ff9 Mon Sep 17 00:00:00 2001 From: frisco <> Date: Sat, 28 Feb 2009 07:27:02 +0000 Subject: [PATCH] Possible fix for one unit test --- src/cryptobox/core/main.py | 12 ++++++++---- src/cryptobox/tests/test.websites.py | 8 ++++---- 2 files changed, 12 insertions(+), 8 deletions(-) diff --git a/src/cryptobox/core/main.py b/src/cryptobox/core/main.py index 7ca925f..d9aab31 100644 --- a/src/cryptobox/core/main.py +++ b/src/cryptobox/core/main.py @@ -87,7 +87,7 @@ class CryptoBox: use it with: 'self.log.[debug|info|warning|error|critical](logmessage)' all classes should get the logging instance during __init__: - self.log = logging.getLogger("CryptoBox") + self.log = logging.getLogger("CryptoNAS") first we output all warnings/errors to stderr as soon as we opened the config file successfully, we redirect debug output @@ -95,12 +95,16 @@ class CryptoBox: """ import logging ## basicConfig(...) needs python >= 2.4 + ################################################ + ## Set the default log level here: + DEFAULT_LOG_LEVEL=logging.ERROR + ################################################ try: - log_handler = logging.getLogger("CryptoBox") + log_handler = logging.getLogger("CryptoNAS") logging.basicConfig( - format = '%(asctime)s CryptoBox %(levelname)s: %(message)s', + format = '%(asctime)s CryptoNAS %(levelname)s: %(message)s', stderr = sys.stderr) - log_handler.setLevel(logging.ERROR) + log_handler.setLevel(DEFAULT_LOG_LEVEL) log_handler.info("loggingsystem is up'n running") ## from now on everything can be logged via self.log... except: diff --git a/src/cryptobox/tests/test.websites.py b/src/cryptobox/tests/test.websites.py index 97a3248..11ba4b3 100755 --- a/src/cryptobox/tests/test.websites.py +++ b/src/cryptobox/tests/test.websites.py @@ -52,11 +52,11 @@ class BuiltinPages(WebInterfaceTestClass): '''display all devices''' self.register_auth(self.url) self.cmd.go(self.url) - self.cmd.find("The CryptoBox") + self.cmd.find("The CryptoNAS") self.cmd.go(self.url + "?weblang=de") - self.cmd.find("Die CryptoBox") + self.cmd.find("Die CryptoNAS") self.cmd.go(self.url + "?weblang=sl") - self.cmd.find("Privatnost v vsako vas") + self.cmd.find("CryptoNAS je projekt") self.cmd.go(self.url + "?weblang=fr") - self.cmd.find("La CryptoBox") + self.cmd.find("La CryptoNAS")