Config_test.py 文件源码

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

项目:diffios 作者: robphoenix 项目源码 文件源码
def test_config_is_grouped_correctly_with_file(baseline, baseline_blocks):
    """
    Should return valid config as list of hierarchical blocks,
    from a config given in a file.
    """
    with mock.patch('diffios.config.os.path.isfile') as mock_isfile:
        mock_isfile.return_value = True
        config_data = mock.mock_open(read_data=baseline)
        with mock.patch(
                'diffios.config.open', config_data, create=True) as mock_open:
            actual = diffios.Config(
                'baseline.conf', ignore_lines=[]).included()
            mock_open.assert_called_once_with('baseline.conf')
            assert baseline_blocks == actual
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号