def test_get_configparser(m, test_conf_dir):
conf_filename = os.path.join(test_conf_dir, 'example.conf')
conf_d_dir = os.path.join(test_conf_dir, 'example.conf.d')
parser = get_configparser(conf_filename)
assert isinstance(parser, configparser.RawConfigParser)
assert parser.get('DEFAULT', 'test_option') == 'bar'
assert m.mock_calls == [
mock.call.info("Found config '%s'", conf_filename),
mock.call.info("Found config '%s'",
os.path.join(conf_d_dir, '10-app.conf')),
mock.call.info("Found config '%s'",
os.path.join(conf_d_dir, '20-database.conf')),
]
评论列表
文章目录