def test_parse_events(good_events): events = [Dep(parent='service1', parent_action='run', child='config1', child_action='run', state='success'), React(parent='config1', parent_action='run', child='service1', child_action='apply_config', state='success')] parsed = cr.parse_events(good_events) assert events == parsed
def test_parse_bad_event(bad_event_type): with pytest.raises(Exception) as execinfo: cr.parse_events(bad_event_type) error = 'Invalid event type: skip' assert error == str(execinfo.value)