def test_backup_and_track_removed_pkg(self): control = utils.ChangedRPMPackagesController() pkgs = ['pkg1', 'pkg2', 'pkg3'] for pkg in pkgs: control.backup_and_track_removed_pkg(pkg) self.assertEqual(utils.RestorablePackage.backup.called, len(pkgs)) self.assertEqual(len(control.removed_pkgs), len(pkgs))
def test_track_installed_pkg(self): control = utils.ChangedRPMPackagesController() pkgs = ['pkg1', 'pkg2', 'pkg3'] for pkg in pkgs: control.track_installed_pkg(pkg) self.assertEqual(control.installed_pkgs, pkgs)