def _mocked_user_config(temp_dir, *args, **kwargs): config = Config(*args, **kwargs) config.user_config_file = MagicMock( return_value=os.path.join(temp_dir, config.filename)) return config
def test_config_user_file(): """Test that the Config user_config_file is appropriate.""" config = Config(APP_NAME, APP_AUTHOR, "test_config") assert get_user_config_dir(APP_NAME, APP_AUTHOR) in config.user_config_file()