예제 #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