def test_last_update_check_set():
"""Asert last_update_check is set in a config with none."""
mock_config = mock.mock_open(read_data=CONFIG_DATA)
assert 'last_update_check' not in CONFIG_DATA
with mock.patch('two1.commands.util.config.open', mock_config, create=True):
conf = config.Config('config_file', check_update=True)
# last_update_check should now be set after
# initalizing the config object.
assert hasattr(conf, 'last_update_check')
assert 'last_update_check' in json.loads(
mock_config.return_value.write.call_args[0][0])
评论列表
文章目录