test_config.py 文件源码

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

项目:two1-python 作者: 21dotco 项目源码 文件源码
def test_needs_update_legacy_last_update_check():
    """Test for a legacy two1.json with an older last_update_check, and that
    it does not throw an error"""
    mock_config = mock.mock_open(read_data=CONFIG_DATA)
    with mock.patch('two1.commands.util.config.open', mock_config, create=True):
        c = config.Config('config_file')
        c.set('last_update_check', "", should_save=True)
        try:
            c.check_update()
        except ValueError:
            pytest.fail("Error dealing with legacy timestamp")
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号