~facundo/magicicada-client/full-closed-venv

« back to all changes in this revision

Viewing changes to magicicadaclient/syncdaemon/tests/test_logger.py

  • Committer: Facundo Batista
  • Date: 2018-06-03 23:00:52 UTC
  • Revision ID: facundo@taniquetil.com.ar-20180603230052-fhzpsr9xzm9q459e
Went full venv.

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
1
# -*- coding: utf-8 -*-
2
2
#
3
 
# Author: Guillermo Gonzalez <guillermo.gonzalez@canonical.com>
4
 
#
5
3
# Copyright 2009-2012 Canonical Ltd.
 
4
# Copyright 2018 Chicharreros (https://launchpad.net/~chicharreros)
6
5
#
7
6
# This program is free software: you can redistribute it and/or modify it
8
7
# under the terms of the GNU General Public License version 3, as published
37
36
from twisted.internet import defer
38
37
from twisted.trial import unittest
39
38
 
40
 
from ubuntuone.devtools.handlers import MementoHandler
41
 
from ubuntuone.devtools.testcases import skipIfOS
42
 
 
 
39
from devtools.handlers import MementoHandler
 
40
from devtools.testcases import skipIfOS
43
41
from magicicadaclient.syncdaemon.logger import (
44
42
    DebugCapture,
45
43
    NOTE,
302
300
        self.handler.addFilter(MultiFilter([self.__class__.__name__]))
303
301
        self.logger.debug('this msg should be logged')
304
302
        self.assertEqual(1, len(self.handler.records))
305
 
        other_logger = logging.getLogger("NO_LOG."+self.__class__.__name__)
 
303
        other_logger = logging.getLogger("NO_LOG." + self.__class__.__name__)
306
304
        other_logger.debug('this msg shouldn\'t be logged')
307
305
        self.assertEqual(1, len(self.handler.records))
308
306
 
311
309
        self.handler.addFilter(
312
310
            MultiFilter([self.__class__.__name__,
313
311
                         self.__class__.__name__ + ".child"]))
314
 
        no_logger = logging.getLogger("NO_LOG."+self.__class__.__name__)
 
312
        no_logger = logging.getLogger("NO_LOG." + self.__class__.__name__)
315
313
        yes_logger = logging.getLogger(self.__class__.__name__ + '.child')
316
314
        self.logger.debug('this msg should be logged')
317
315
        self.assertEqual(1, len(self.handler.records))