diff options
| author | Vinay Sajip <vinay_sajip@yahoo.co.uk> | 2011-11-21 16:51:43 +0000 |
|---|---|---|
| committer | Vinay Sajip <vinay_sajip@yahoo.co.uk> | 2011-11-21 16:51:43 +0000 |
| commit | 66013d7a6c8594d435e6d3ff0b468b51c40318b6 (patch) | |
| tree | 3f8251fc600a63169282d66869ea8d82864b47f1 /tests/test_dictconfig.py | |
| parent | ff08c6c2163075ea0d3a12c1c2a2e2d52bcc7bc7 (diff) | |
| download | logutils-git-0.3.2.tar.gz | |
Made ready for 0.3.2.0.3.2
Diffstat (limited to 'tests/test_dictconfig.py')
| -rw-r--r-- | tests/test_dictconfig.py | 39 |
1 files changed, 39 insertions, 0 deletions
diff --git a/tests/test_dictconfig.py b/tests/test_dictconfig.py index d333808..42647a2 100644 --- a/tests/test_dictconfig.py +++ b/tests/test_dictconfig.py @@ -483,6 +483,39 @@ class ConfigDictTest(unittest.TestCase): }, } + # As config10, but declaring a handler in a module using + # absolute imports + config11 = { + 'version': 1, + 'formatters': { + 'form1' : { + 'format' : '%(levelname)s ++ %(message)s', + }, + }, + 'filters' : { + 'filt1' : { + 'name' : 'compiler.parser', + }, + }, + 'handlers' : { + 'hand1' : { + '()': 'mytest.MyTestHandler', + 'formatter': 'form1', + 'filters' : ['filt1'], + } + }, + 'loggers' : { + 'compiler.parser' : { + 'level' : 'DEBUG', + 'filters' : ['filt1'], + }, + }, + 'root' : { + 'level' : 'WARNING', + 'handlers' : ['hand1'], + }, + } + def apply_config(self, conf): dictConfig(conf) @@ -660,3 +693,9 @@ class ConfigDictTest(unittest.TestCase): dict(levelname='ERROR', message='4'), ])) + def test_config_11_ok(self): + self.apply_config(self.config11) + h = logging.getLogger().handlers[0] + self.assertEqual(h.__module__, 'mytest') + self.assertEqual(h.__class__.__name__, 'MyTestHandler') + |
