test_contrib_config_iniconfig.py 文件源码

python
阅读 16 收藏 0 点赞 0 评论 0

项目:shelter 作者: seznam 项目源码 文件源码
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')),
    ]
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号