def test_reinstall(self): cnt = self.base.reinstall('pepper') self.assertEqual(cnt, 1) new_set = support.installed_but(self.sack, "pepper") available_query = self.sack.query().available() new_set += list(available_query._nevra("pepper-20-0.x86_64")) self.assertResult(self.base, new_set)
def test_distro_sync_all(self): self.base.distro_sync() self.assertIn(rpm.RPMPROB_FILTER_OLDPACKAGE, self.base.rpm_probfilter) packages = support.installed_but(self.sack, "pepper", "librita").run() q = self.sack.query().available().filter(name=["pepper", "librita"]) packages.extend(q) self.assertResult(self.base, packages)
def test_distro_sync(self): self.yumbase.distro_sync() self.assertIn(rpm.RPMPROB_FILTER_OLDPACKAGE, self.yumbase.rpm_probfilter) packages = support.installed_but(self.sack, "pepper", "librita").run() packages.extend(available_by_name(self.sack, ["pepper", "librita"])) packages.extend(installed_by_nevra(self.sack, "librita-1-1.i686")) self.assertResult(self.yumbase, packages)
def test_reinstall(self): cnt = self.yumbase.reinstall("pepper") self.assertEqual(cnt, 1) new_set = support.installed_but(self.sack, "pepper") new_pkg = dnf.queries.available_by_nevra(self.sack, "pepper-20-0.x86_64") new_set += list(new_pkg) self.assertResult(self.yumbase, new_set)
def test_distro_sync_all(self): self.base.distro_sync() self.assertIn(rpm.RPMPROB_FILTER_OLDPACKAGE, self.base._rpm_probfilter) packages = support.installed_but(self.sack, "pepper", "librita").run() q = self.sack.query().available().filter(name=["pepper", "librita"]) packages.extend(q) self.assertResult(self.base, packages)
def test_reinstall(self): cnt = self.base.reinstall('pepper') self.assertEqual(cnt, 1) new_set = support.installed_but(self.sack, "pepper") available_query = self.sack.query().available() new_set += list(available_query.nevra("pepper-20-0.x86_64")) self.assertResult(self.base, new_set)
def test_upgrade_to(self): yumbase = support.MockYumBase("main", "updates") sack = yumbase.sack yumbase.upgrade_to("pepper-20-1.x86_64") new_set = support.installed_but(sack, "pepper").run() new_set.extend(dnf.queries.available_by_nevra(sack, "pepper-20-1.x86_64")) self.assertResult(yumbase, new_set)
def test_update_local(self): yumbase = support.MockYumBase() sack = yumbase.sack cnt = yumbase.update_local(support.TOUR_51_PKG_PATH) self.assertEqual(cnt, 1) new_pkg = available_by_name(sack, "tour")[0] new_set = support.installed_but(yumbase.sack, "tour") + [new_pkg] self.assertResult(yumbase, new_set)
def test_update_local(self): yumbase = support.MockBase() sack = yumbase.sack cnt = yumbase.update_local(support.TOUR_51_PKG_PATH) self.assertEqual(cnt, 1) new_pkg = sack.query().available().filter(name="tour")[0] new_set = support.installed_but(yumbase.sack, "tour") + [new_pkg] self.assertResult(yumbase, new_set)
def test_upgrade_to_package(self): base = support.MockBase() pkg = base.add_remote_rpm(support.TOUR_51_PKG_PATH) cnt = base.package_upgrade(pkg) self.assertEqual(cnt, 1) new_pkg = base.sack.query().available().filter(name="tour")[0] new_set = support.installed_but(base.sack, "tour") + [new_pkg] self.assertResult(base, new_set)
def test_upgrade_all(self): """ upgrade() without parameters upgrade everything it can that has its deps in trim. Broken packages are silently skipped. """ self.base.upgrade_all() new_set = support.installed_but(self.sack, "pepper").run() new_set.extend(self.sack.query().available().nevra("pepper-20-1.x86_64")) self.assertResult(self.base, new_set)
def test_upgrade_to(self): base = support.MockBase("main", "updates") sack = base.sack base.upgrade_to("pepper-20-1.x86_64") new_set = support.installed_but(sack, "pepper").run() q = sack.query().available()._nevra("pepper-20-1.x86_64") new_set.extend(q) self.assertResult(base, new_set)
def test_upgrade_to_package(self): base = support.MockBase() pkgs = base.add_remote_rpms([support.TOUR_51_PKG_PATH]) cnt = base.package_upgrade(pkgs[0]) self.assertEqual(cnt, 1) new_pkg = base.sack.query().available().filter(name="tour")[0] new_set = support.installed_but(base.sack, "tour") + [new_pkg] self.assertResult(base, new_set)
def test_upgrade_all(self): """ upgrade() without parameters upgrade everything it can that has its deps in trim. Broken packages are silently skipped. """ self.base.upgrade_all() new_set = support.installed_but(self.sack, "pepper").run() new_set.extend(self.sack.query().available()._nevra("pepper-20-1.x86_64")) self.assertResult(self.base, new_set)
def test_upgrade_to(self): base = support.MockBase("main", "updates") sack = base.sack base.upgrade_to("pepper-20-1.x86_64") new_set = support.installed_but(sack, "pepper").run() q = sack.query().available().nevra("pepper-20-1.x86_64") new_set.extend(q) self.assertResult(base, new_set)
def test_update_all(self): """ Update all you can. """ base = support.MockBase("main", "updates") sack = base.sack base.upgrade_all() expected = support.installed_but(sack, "pepper", "hole", "tour") + \ list(sack.query().available().nevra("pepper-20-1.x86_64")) + \ list(sack.query().available().nevra("hole-2-1.x86_64")) self.assertResult(base, expected)
def test_update_all(self): """ Update all you can. """ base = support.MockBase("main", "updates") sack = base.sack base.upgrade_all() expected = support.installed_but(sack, "pepper", "hole", "tour") + \ list(sack.query().available()._nevra("pepper-20-1.x86_64")) + \ list(sack.query().available()._nevra("hole-2-1.x86_64")) self.assertResult(base, expected)
def test_update_all(self): """ Update all you can. """ yumbase = support.MockYumBase("main", "updates") sack = yumbase.sack yumbase.update() expected = support.installed_but(sack, "pepper", "hole") + \ list(available_by_nevra(sack, "pepper-20-1.x86_64")) + \ list(available_by_nevra(sack, "hole-2-1.x86_64")) self.assertResult(yumbase, expected)
def test_downgrade(self): base = support.MockBase("main") sack = base.sack cnt = base.downgrade("tour") self.assertGreater(cnt, 0) new_pkg = sack.query().available().filter(name="tour")[0] self.assertEqual(new_pkg.evr, "4.6-1") new_set = support.installed_but(sack, "tour") + [new_pkg] self.assertResult(base, new_set)
def test_downgrade(self): yumbase = support.MockYumBase("main") sack = yumbase.sack cnt = yumbase.downgrade("tour") self.assertGreater(cnt, 0) new_pkg = dnf.queries.available_by_name(sack, "tour")[0] self.assertEqual(new_pkg.evr, "4.6-1") new_set = support.installed_but(sack, "tour") + [new_pkg] self.assertResult(yumbase, new_set)
def test_remove(self): """ Simple remove. """ ret = self.base.remove("pepper") self.assertResult(self.base, support.installed_but(self.base.sack, "pepper"))
def test_remove_dependent(self): """ Remove a lib that some other package depends on. """ ret = self.base.remove("librita") # we should end up with nothing in this case: new_set = support.installed_but(self.base.sack, "librita", "pepper") self.assertResult(self.base, new_set)
def test_remove_depended(self): """ Remove a lib that some other package depends on. """ ret = self.base.remove("librita") # we should end up with nothing in this case: new_set = support.installed_but(self.base.sack, "librita", "pepper") self.assertResult(self.base, new_set)