END_TEST START_TEST(test_goal_install_weak_deps) { HySelector sltr = hy_selector_create(test_globals.sack); hy_selector_set(sltr, HY_PKG_NAME, HY_EQ, "B"); HyGoal goal = hy_goal_create(test_globals.sack); fail_if(!hy_goal_install_selector(goal, sltr, NULL)); HyGoal goal2 = hy_goal_clone(goal); fail_if(hy_goal_run(goal)); // recommended package C is installed too assert_iueo(goal, 2, 0, 0, 0); fail_if(hy_goal_run_flags(goal2, DNF_IGNORE_WEAK_DEPS)); assert_iueo(goal2, 1, 0, 0, 0); hy_goal_free(goal); hy_goal_free(goal2); hy_selector_free(sltr); }
END_TEST START_TEST(test_goal_clone) { DnfSack *sack = test_globals.sack; HyGoal goal = hy_goal_create(sack); hy_goal_upgrade_all(goal); HyGoal goal2 = hy_goal_clone(goal); fail_if(hy_goal_run(goal)); assert_iueo(goal, 0, 1, 0, 0); fail_unless(size_and_free(hy_goal_list_reinstalls(goal, NULL)) == 1); hy_goal_free(goal); fail_if(hy_goal_run(goal2)); assert_iueo(goal2, 0, 1, 0, 0); fail_unless(size_and_free(hy_goal_list_reinstalls(goal2, NULL)) == 1); hy_goal_free(goal2); }
static PyObject * deepcopy(_GoalObject *self, PyObject *args, PyObject *kwds) { HyGoal goal = hy_goal_clone(self->goal); return goalToPyObject(goal, self->sack); }