def __set_config(usrmgr, config): """Sets the config attribute of the passed usermanager instance""" with patch.object(usrmgr, "_UserManager__save_config"): usrmgr.config = config