def test_install_by_provides(self): """ Test the package to be installed can be specified by provide. """ self.yumbase.install("henry(the_horse)") self.assertGreater(self.yumbase._goal.req_length(), 0) trampoline = available_by_name(self.yumbase.sack, "trampoline") new_set = self.installed + trampoline self.assertResult(self.yumbase, new_set)
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_update_all(self): """ Update all you can. """ yumbase = base.mock_yum_base("main", "updates") sack = yumbase.sack ret = yumbase.update() expected = available_by_name(sack, "pepper", latest_only=True) self.assertItemsEqual((txmem.po for txmem in ret), expected)
def test_install(self): """ Installing a package existing in multiple architectures attempts installing all of them. """ cnt = self.yumbase.install("lotus") self.assertEqual(cnt, 2) new_set = self.installed + available_by_name(self.yumbase.sack, "lotus") self.assertResult(self.yumbase, new_set)
def test_install(self): """ Simple install. """ self.yumbase.install("mrkite") expected = available_by_name(self.yumbase.sack, ["mrkite", "trampoline"]) # ensure sanity of the test (otherwise it would pass no matter what): self.assertEqual(len(expected), 2) new_set = dnf.queries.installed(self.yumbase.sack) + expected self.assertResult(self.yumbase, new_set)
def test_install_glob(self): self.yumbase.install("mrkite*") new_set = self.installed + available_by_name(self.yumbase.sack, "mrkite*") installed, removed = self.installed_removed(self.yumbase) self.assertItemsEqual(map(str, installed), ['mrkite-2-0.x86_64', 'mrkite-k-h-1-1.x86_64', 'trampoline-2.1-1.noarch'])
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 pkgtup2pid_test(self): """ Check pkg2pid() correctly delegates to _*2pid()s. """ hpkg = dnf.yum.history.YumHistoryPackage("n", "a", "e", "v", "r") with mock.patch.object(self.history, "_hpkg2pid") as hpkg2pid: self.history.pkg2pid(hpkg) hpkg2pid.assert_called_with(hpkg, True) ipkg = installed_by_name(self.sack, "pepper")[0] with mock.patch.object(self.history, "_ipkg2pid") as ipkg2pid: self.history.pkg2pid(ipkg) ipkg2pid.assert_called_with(ipkg, True) apkg = available_by_name(self.sack, "lotus")[0] with mock.patch.object(self.history, "_apkg2pid") as apkg2pid: self.history.pkg2pid(apkg) apkg2pid.assert_called_with(apkg, True)
def test_install_nevra(self): self.yumbase.install("lotus-3-16.i686") available = available_by_name(self.yumbase.sack, "lotus", get_query=True) lotus = available.filter(arch="i686")[0] new_set = dnf.queries.installed(self.yumbase.sack) + [lotus] self.assertResult(self.yumbase, new_set)