test: configuration/use of new logging system
This commit is contained in:
parent
a3186ac2e3
commit
edf5db192f
1 changed files with 23 additions and 14 deletions
|
|
@ -24,11 +24,12 @@ from constants import Const
|
|||
from sat.test import helpers
|
||||
from sat.plugins import plugin_xep_0033 as plugin
|
||||
from sat.core.sat_main import AbortSendMessage, MessageSentAndStored
|
||||
from sat.core.log import getLogger
|
||||
from copy import deepcopy
|
||||
from twisted.internet import defer
|
||||
from wokkel.generic import parseXml
|
||||
from twisted.words.protocols.jabber.jid import JID
|
||||
import logging
|
||||
from logging import ERROR
|
||||
|
||||
|
||||
class XEP_0033Test(helpers.SatTestCase):
|
||||
|
|
@ -109,9 +110,9 @@ class XEP_0033Test(helpers.SatTestCase):
|
|||
for to_s in [addresses[1], addresses[3], addresses[5]]:
|
||||
to_jid = JID(to_s)
|
||||
host = JID(to_jid.host)
|
||||
logger = logging.getLogger()
|
||||
logger = getLogger()
|
||||
level = logger.getEffectiveLevel()
|
||||
logger.setLevel(logging.ERROR) # remove log.warning pollution
|
||||
logger.setLevel(ERROR) # remove log.warning pollution
|
||||
if self.host.memory.hasServerFeature(plugin.NS_ADDRESS, host, Const.PROFILE[0]):
|
||||
if host not in cache:
|
||||
sent.append(host)
|
||||
|
|
@ -134,9 +135,9 @@ class XEP_0033Test(helpers.SatTestCase):
|
|||
@param data: the data to be processed by self.plugin.sendMessageTrigger
|
||||
@param exception: AbortSendMessage or MessageSentAndStored
|
||||
"""
|
||||
logger = logging.getLogger()
|
||||
logger = getLogger()
|
||||
level = logger.getEffectiveLevel()
|
||||
logger.setLevel(logging.ERROR) # remove log.warning pollution
|
||||
logger.setLevel(ERROR) # remove log.warning pollution
|
||||
pre_treatments = defer.Deferred()
|
||||
post_treatments = defer.Deferred()
|
||||
self.plugin.sendMessageTrigger(data, pre_treatments, post_treatments, Const.PROFILE[0])
|
||||
|
|
|
|||
Loading…
Reference in a new issue