Bases: object
Simulate some functionality of RPMAdditionalDataPackage
provides text output callback functions for Dependency Solver callback
Bases: unittest.case.TestCase
Check if “system” contains the given pkgs. pkgs must be present, optional_pkgs may be. Any other pkgs result in an error. Pkgs are present if they are in the rpmdb and are not REMOVEd or they are INSTALLed.
Overload this staticmethod to create pkpgs that are used in several test cases. It gets called from __init__ with self.pkgs as first parameter. It is a staticmethod so you can call .buildPkgs() from other Tests to share buildPkg code (inheritance doesn’t work here, because we don’t want to inherit the test cases, too).
Bases: yum.packageSack.PackageSack
We use a PackagePack for a Fake rpmdb insted of the normal RPMDBPackageSack, getProvides works a little different on unversioned requirements so we have to overload an add some extra checkcode.
return dict { packages -> list of matching provides }
Bases: testbase._DepsolveTestsBase
Run depsolver on an manually set up transaction. You can add pkgs to self.rpmdb or self.tsInfo. See yum/transactioninfo.py for details. A typical test case looks like:
po = FakePackage(‘zsh’, ‘1’, ‘1’, None, ‘i386’) po.addRequires(‘zip’, ‘EQ’, (None, ‘1.3’, ‘2’)) self.tsInfo.addInstall(po)
ipo = FakePackage(‘zip’, ‘1.3’, ‘2’, None, ‘i386’) self.rpmdb.addPackage(ipo)
result, msg = self.resolveCode() self.assertEquals(‘ok’, result, msg) self.assertResult((po, ipo))
Called at the start of each test.
Bases: testbase._DepsolveTestsBase
Run a yum command (install, update, remove, ...) in a given set of installed and available pkgs. Typical test case looks like:
To avoid creating the same pkgs over and over again overload the staticmethod buildPkgs. It gets called from __init__ with self.pkgs as first parameter. As it is a static method you can call .buildPkgs() from other Tests to share buildPkg code.
Sets up and runs the depsolver. args[0] must be a valid yum command (“install”, “update”, ...). It might be followed by pkg names as on the yum command line. The pkg objects in installed are added to self.rpmdb and those in available to self.xsack which is the repository to resolve requirements from.