'Tests whether two check results are identical.'

def assertResultEqual(self, rslt1, rslt2):

    if (rslt1.check_id != rslt2.check_id):
        self.fail(('Check    IDs    differ:    %s    vs    %s' % (rslt1.check_id, rslt2.check_id)))
    rslt1_anoms = {}
    for a in rslt1.anomaly:
        anoms = rslt1_anoms.setdefault(a.symptom, [])
        anoms.extend(a.finding)
    rslt2_anoms = {}
    for a in rslt2.anomaly:
        anoms = rslt2_anoms.setdefault(a.symptom, [])
        anoms.extend(a.finding)
    self.assertItemsEqual(rslt1_anoms, rslt2_anoms, ('Results    have    different    anomaly    items.:\n%s\n%s' % (rslt1_anoms.keys(), rslt2_anoms.keys())))
    for (symptom, findings) in rslt1_anoms.iteritems():
        rslt1_found = [f.strip() for f in findings]
        rslt2_found = [f.strip() for f in rslt2_anoms[symptom]]
        self.assertItemsEqual(rslt1_found, rslt2_found)
