def test_can_modify_root_configuration(self, mocked_flags, mocked_conf): """Test the can_modify_root_configuration function.""" users_module = Mock() mocked_flags.automatedInstall = False assert can_modify_root_configuration(users_module) mocked_flags.automatedInstall = True mocked_conf.ui.can_change_root = True assert can_modify_root_configuration(users_module) mocked_flags.automatedInstall = True mocked_conf.ui.can_change_root = False users_module.CanChangeRootPassword = True assert can_modify_root_configuration(users_module) mocked_flags.automatedInstall = True mocked_conf.ui.can_change_root = False users_module.CanChangeRootPassword = False assert not can_modify_root_configuration(users_module)
def showable(self): return can_modify_root_configuration(self._users_module)
def sensitive(self): return can_modify_root_configuration(self._users_module)