示例#1
0
文件: support.py 项目: ryanuber/dnf
    def installed_removed(self, base):
        try:
            base.build_transaction()
        except dnf.exceptions.DepsolveError:
            self.fail()

        installed = base._transaction.install_set
        removed = base._transaction.remove_set
        return installed, removed
示例#2
0
文件: test_base.py 项目: ryanuber/dnf
 def test_build_transaction(self):
     base = support.MockYumBase("updates")
     base.update(pattern="pepper")
     self.assertTrue(base.build_transaction())
     base.ds_callback.assert_has_calls(mock.call.start())
     base.ds_callback.assert_has_calls(mock.call.pkg_added(mock.ANY, 'ud'))
     base.ds_callback.assert_has_calls(mock.call.pkg_added(mock.ANY, 'u'))
     self.assertLength(base.transaction, 1)
示例#3
0
文件: support.py 项目: ryanuber/dnf
    def assertResult(self, base, pkgs):
        """Check whether the system contains the given pkgs.

        pkgs must be present. Any other pkgs result in an error. Pkgs are
        present if they are in the rpmdb and are not REMOVEd or they are
        INSTALLed.
        """

        try:
            base.build_transaction()
        except dnf.exceptions.DepsolveError:
            self.fail()

        installed = set(dnf.queries.installed_by_name(base.sack, None))
        map(installed.remove, base._transaction.remove_set)
        installed.update(base._transaction.install_set)
        self.assertItemsEqual(installed, pkgs)
示例#4
0
文件: support.py 项目: PaulReiber/dnf
 def installed_removed(self, base):
     (rcode, rstring) = base.build_transaction()
     self.assertNotEqual(rcode, 1)
     installed = base._transaction.install_set
     removed = base._transaction.remove_set
     return installed, removed