summaryrefslogtreecommitdiffstats
path: root/tests/unit/test_log.py
diff options
context:
space:
mode:
authorEric Windisch <eric@cloudscaling.com>2012-11-04 21:19:29 -0500
committerEric Windisch <eric@cloudscaling.com>2012-11-05 12:27:54 -0500
commit4d1d9cb9cf20bc4081e17d9c7cf9cd10641ff297 (patch)
treea53f214b4e25ffca4f16d80db2fb47349985c31a /tests/unit/test_log.py
parentaca1805d911caefe14a73edb6ced281cf54e7ad2 (diff)
downloadoslo-4d1d9cb9cf20bc4081e17d9c7cf9cd10641ff297.tar.gz
oslo-4d1d9cb9cf20bc4081e17d9c7cf9cd10641ff297.tar.xz
oslo-4d1d9cb9cf20bc4081e17d9c7cf9cd10641ff297.zip
Restore proper LoggerTestCase
Addresses bug #1075022 Addresses bug #1075028 LoggerTestCase was no longer running as another test was created with this name (presumably due to copy-paste) The duplicate has been renamed to a more appropriate name: LogLevelTestCase. Because LoggerTestCase was not executing, bitrot has occurred. This patch also addresses those resultant test failures. Change-Id: I4f3820ba748d20606bb484d0adbfe678fa1fa38d
Diffstat (limited to 'tests/unit/test_log.py')
-rw-r--r--tests/unit/test_log.py14
1 files changed, 8 insertions, 6 deletions
diff --git a/tests/unit/test_log.py b/tests/unit/test_log.py
index b64fe8c..2530339 100644
--- a/tests/unit/test_log.py
+++ b/tests/unit/test_log.py
@@ -43,13 +43,15 @@ class LoggerTestCase(test_utils.BaseTestCase):
def test_will_be_verbose_if_verbose_flag_set(self):
self.config(verbose=True)
- log.setup()
- self.assertEqual(logging.DEBUG, self.log.logger.getEffectiveLevel())
+ log.setup("test_is_verbose")
+ logger = logging.getLogger("test_is_verbose")
+ self.assertEqual(logging.DEBUG, logger.getEffectiveLevel())
def test_will_not_be_verbose_if_verbose_flag_not_set(self):
self.config(verbose=False)
- log.setup()
- self.assertEqual(logging.INFO, self.log.logger.getEffectiveLevel())
+ log.setup("test_is_not_verbose")
+ logger = logging.getLogger("test_is_not_verbose")
+ self.assertEqual(logging.INFO, logger.getEffectiveLevel())
def test_no_logging_via_module(self):
for func in ('critical', 'error', 'exception', 'warning', 'warn',
@@ -101,9 +103,9 @@ class PublishErrorsHandlerTestCase(test_utils.BaseTestCase):
self.assertTrue(self.stub_flg)
-class LoggerTestCase(test_utils.BaseTestCase):
+class LogLevelTestCase(test_utils.BaseTestCase):
def setUp(self):
- super(LoggerTestCase, self).setUp()
+ super(LogLevelTestCase, self).setUp()
levels = CONF.default_log_levels
levels.append("nova-test=AUDIT")
self.config(default_log_levels=levels,