'Tests for the assertCheckDetectedAnom() method.'

def testAssertCheckDetectedAnom(self):

    no_checks = {}
    self.assertRaises(AssertionError, self.assertCheckDetectedAnom, 'UNICORN', no_checks, sym=None, findings=None)
    passing_checks = {'EXISTS': checks.CheckResult(check_id='EXISTS')}
    self.assertRaises(AssertionError, self.assertCheckDetectedAnom, 'EXISTS', passing_checks, sym=None, findings=None)
    anomaly = {'finding': ['Finding'], 'symptom': 'Found:    An    issue.', 'type': 'ANALYSIS_ANOMALY'}
    failing_checks = {'EXISTS': checks.CheckResult(check_id='EXISTS', anomaly=rdf_anomaly.Anomaly(**anomaly))}
    self.assertCheckDetectedAnom('EXISTS', failing_checks, sym=None, findings=None)
    self.assertCheckDetectedAnom('EXISTS', failing_checks, sym='Found:    An    issue.', findings=None)
    self.assertCheckDetectedAnom('EXISTS', failing_checks, sym='Found:    An    issue.', findings=['Finding'])
    self.assertCheckDetectedAnom('EXISTS', failing_checks, sym='Found:    An    issue.', findings=['Fin'])
    self.assertRaises(AssertionError, self.assertCheckDetectedAnom, 'EXISTS', failing_checks, sym='wrong    symptom', findings=None)
    self.assertRaises(AssertionError, self.assertCheckDetectedAnom, 'EXISTS', failing_checks, sym='Found:    An    issue.', findings=['Not    found'])
    self.assertRaises(AssertionError, self.assertCheckDetectedAnom, 'EXISTS', failing_checks, sym='Found:    An    issue.', findings=[])
