def test_resolve_dep_errors_unable_to_detect_problematic_pkgs(self): # Even though resolve_dep_errors was called (meaning that the previous # yum call ended with non-zero status), the string returned by yum # does not hold information recognizable by get_problematic_pkgs pkghandler.resolve_dep_errors("No info about problematic pkgs.", []) self.assertEqual(pkghandler.call_yum_cmd.called, 0)
def test_resolve_dep_errors_unable_to_fix_by_downgrades(self): pkghandler.call_yum_cmd.return_code = 1 pkghandler.call_yum_cmd.return_string = YUM_MULTILIB_ERROR pkghandler.resolve_dep_errors(YUM_PROTECTED_ERROR, []) # Firts call of the resolve_dep_errors, pkgs from protected error # are detected, the second call pkgs from multilib error are detected, # the third call yum_cmd is not called anymore, because the # problematic packages then remain the same (simulating that the # downgrades do not solve the yum errors) self.assertEqual(pkghandler.call_yum_cmd.called, 2)
def test_resolve_dep_errors_one_downgrade_fixes_the_error(self): pkghandler.call_yum_cmd.fail_once = True pkghandler.resolve_dep_errors(YUM_PROTECTED_ERROR, []) self.assertEqual(pkghandler.call_yum_cmd.called, 1)
def test_resolve_dep_errors_one_downgrade_fixes_the_error(self): pkghandler.call_yum_cmd.fail_once = True pkghandler.resolve_dep_errors(yum_protected_error, []) self.assertEqual(pkghandler.call_yum_cmd.called, 1)