Browse Source

Possible fix for one unit test

master
frisco 13 years ago
parent
commit
f2d88519b0
  1. 12
      src/cryptobox/core/main.py
  2. 8
      src/cryptobox/tests/test.websites.py

12
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:

8
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")

Loading…
Cancel
Save