test_config.py 文件源码

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

项目:projects 作者: tiborsimon 项目源码 文件源码
def test__file_not_found__raises_error(self, mock_yaml):
        error_message = 'file not found'
        mock_open = mock.MagicMock(side_effect = IOError(error_message))
        with self.assertRaises(Exception) as cm:
            with mock.patch(open_mock_string, mock_open):
                config._load_config()
        assert_exception(self, cm, IOError, error_message)
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号