def test_updated_secinfo_arrived(self): ct = get_alert_event_from_string('Updated SecInfo arrived') self.assertEqual(ct, AlertEvent.UPDATED_SECINFO_ARRIVED)
def test_new_secinfo_arrived(self): ct = get_alert_event_from_string('New SecInfo arrived') self.assertEqual(ct, AlertEvent.NEW_SECINFO_ARRIVED)
def test_none_or_empty(self): ct = get_alert_event_from_string(None) self.assertIsNone(ct) ct = get_alert_event_from_string('') self.assertIsNone(ct)
def test_task_run_status_changed(self): ct = get_alert_event_from_string('Task run status changed') self.assertEqual(ct, AlertEvent.TASK_RUN_STATUS_CHANGED)
def test_invalid(self): with self.assertRaises(InvalidArgument): get_alert_event_from_string('foo')