summaryrefslogtreecommitdiffstats
path: root/Lib/test
diff options
context:
space:
mode:
authorVinay Sajip <vinay_sajip@yahoo.co.uk>2010-02-04 21:40:56 (GMT)
committerVinay Sajip <vinay_sajip@yahoo.co.uk>2010-02-04 21:40:56 (GMT)
commitf7610b23de274199185bab686efbf963aca89c47 (patch)
treed5042a69bdb795a426bda4143660bf02c020c240 /Lib/test
parent0e6e97d9adf276572fc409e993d0284871e13ab9 (diff)
downloadcpython-f7610b23de274199185bab686efbf963aca89c47.zip
cpython-f7610b23de274199185bab686efbf963aca89c47.tar.gz
cpython-f7610b23de274199185bab686efbf963aca89c47.tar.bz2
Added unit test for cfg:// resolution.
Diffstat (limited to 'Lib/test')
-rw-r--r--Lib/test/test_logging.py33
1 files changed, 33 insertions, 0 deletions
diff --git a/Lib/test/test_logging.py b/Lib/test/test_logging.py
index 25127c0..9b410e9 100644
--- a/Lib/test/test_logging.py
+++ b/Lib/test/test_logging.py
@@ -1355,6 +1355,36 @@ class ConfigDictTest(BaseTest):
},
}
+ #As config1 but using cfg:// references
+ config11 = {
+ 'true_formatters': {
+ 'form1' : {
+ 'format' : '%(levelname)s ++ %(message)s',
+ },
+ },
+ 'handler_configs': {
+ 'hand1' : {
+ 'class' : 'logging.StreamHandler',
+ 'formatter' : 'form1',
+ 'level' : 'NOTSET',
+ 'stream' : 'ext://sys.stdout',
+ },
+ },
+ 'formatters' : 'cfg://true_formatters',
+ 'handlers' : {
+ 'hand1' : 'cfg://handler_configs[hand1]',
+ },
+ 'loggers' : {
+ 'compiler.parser' : {
+ 'level' : 'DEBUG',
+ 'handlers' : ['hand1'],
+ },
+ },
+ 'root' : {
+ 'level' : 'WARNING',
+ },
+ }
+
def apply_config(self, conf):
logging.config.dictConfig(conf)
@@ -1539,6 +1569,9 @@ class ConfigDictTest(BaseTest):
('ERROR', '4'),
], stream=output)
+ def test_config11_ok(self):
+ self.test_config1_ok(self.config11)
+
def setup_via_listener(self, text):
PORT = 9030
t = logging.config.listen(PORT)