def __get_alert(self): alert = Alert() alert.field = Alert.FIELD_OPTIONS["Total Cost"] alert.comparator = Alert.COMPARATOR_OPTIONS["greater than"] alert.percent = Decimal("1.0") alert.compare_to = Alert.COMPARE_TO_OPTIONS["expected"] return alert
def test_alerts_are_triggered(self, field, comparator, percent, compare_to, dataset, expected_result): alert = Alert() alert.field = Alert.FIELD_OPTIONS[field] alert.comparator = Alert.COMPARATOR_OPTIONS[comparator] alert.percent = percent alert.compare_to = Alert.COMPARE_TO_OPTIONS[compare_to] result = alert.get_aberrant_frames(dataset) self.assertEquals(expected_result, len(result) > 0)