本文整理汇总了Python中tests.support.installed_but函数的典型用法代码示例。如果您正苦于以下问题:Python installed_but函数的具体用法?Python installed_but怎么用?Python installed_but使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了installed_but函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: test_distro_sync_all
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)
示例2: test_reinstall
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)
示例3: test_distro_sync
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)
示例4: test_reinstall
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)
示例5: test_upgrade_to
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)
示例6: test_upgrade_to_package
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)
示例7: test_upgrade_all
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)
示例8: test_upgrade_to
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)
示例9: test_update_local
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)
示例10: test_update_local
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)
示例11: test_update_all
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)
示例12: test_update_all
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)
示例13: test_downgrade
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)
示例14: test_downgrade
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)
示例15: test_remove_dependent
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)