def checkJobList(self, actualJob, expectedJob, exactMatch):
        # check a given set of jobs against a changeList type
        # of jobs.
        erases = trovesource.SimpleTroveSource()
        installs = trovesource.SimpleTroveSource()

        jobList = []
        for job in actualJob:
            for (n, oldInfo, newInfo, isAbs) in job:
                assert(not isAbs)

                if oldInfo[0]:
                    erases.addTrove(n, *oldInfo)
                if newInfo[0]:
                    installs.addTrove(n, *newInfo)

                jobList.append((n, oldInfo, newInfo))

        changeList = cmdline.parseChangeList(expectedJob)
        for (n, oldInfo, newInfo, isAbs), jobStr in zip(changeList, expectedJob):
            if oldInfo != (None, None):
                try:
                    troveList = erases.findTrove(None, (n, oldInfo[0], oldInfo[1]))
                except errors.TroveNotFound:
                    relatedJobs = [x for x in jobList if x[0] == n]
                    if relatedJobs:
                        raise RuntimeError('failed to find erasure for %s.  Jobs involving %s found: %s' % (jobStr, n, relatedJobs))
                    else:
                        raise RuntimeError('failed to find job for %s.  Jobs: %s' % (n, jobList))
                if 1 > len(troveList):
                    raise RuntimeError, (
                        '(%s,%s,%s) matched multiple erased troves' \
                        % (n, oldInfo[0], oldInfo[1]))
                oldVer, oldFla = troveList[0][1:]
            if newInfo != (None, None) or isAbs:
                try:
                    troveList = installs.findTrove(None, (n, newInfo[0],
                                                             newInfo[1]))
                except errors.TroveNotFound:
                    raise RuntimeError('failed to find install for %s.  Jobs involving %s found: %s' % (jobStr, n, [x for x in jobList if x[0] == n]))

                if len(troveList) > 1:
                    raise RuntimeError, (
                        '(%s,%s,%s) matched multiple installed troves' \
                        % (n, newInfo[0], newInfo[1]))
                newVer, newFla = troveList[0][1:]

            if oldInfo == (None, None):
                if isAbs:
                    # we found the trove in the list of installed troves
                    # we didn't specify whether it was a new install or a
                    # install relative to anything, just assume that the
                    # old trove version is correct
                    jobToCheck = [ x for x in jobList \
                                    if x[0] == n and x[2] == (newVer, newFla) ]
                    assert(len(jobToCheck) == 1)
                    jobToCheck = jobToCheck[0]
                else:
                    # this _must_ be a fresh install.
                    jobToCheck = (n, (None, None), (newVer, newFla))
            elif newInfo == (None, None):
                # this _must_ be a fresh install.
                jobToCheck = (n, (oldVer, oldFla), (None, None))
            else:
                jobToCheck = (n, (oldVer, oldFla), (newVer, newFla))

            if jobToCheck in jobList:
                jobList.remove(jobToCheck)
            else:
                raise RuntimeError('expected job %s for job str %s was '
                                   'not included in update' %(jobToCheck,
                                                              jobStr))

        if exactMatch and jobList:
            raise RuntimeError, 'update performed extra jobs %s' % (jobList,)
dataset/ETHPy150Open sassoftware/conary/conary_test/rephelp.py/RepositoryHelper.checkJobList/swapped operands of `>`