This repository has been archived on 2020-03-24. You can view files and clone it, but cannot push or open issues or pull requests.
quay/notifications/test/test_notificationevent.py

22 lines
700 B
Python
Raw Normal View History

2017-07-14 13:49:44 +00:00
import pytest
from notifications.models_interface import Repository
from notifications.notificationevent import NotificationEvent
from test.fixtures import *
2017-07-14 13:49:44 +00:00
@pytest.mark.parametrize('event_name', NotificationEvent.event_names())
def test_build_notification(event_name, initialized_db):
# Create the notification event.
found = NotificationEvent.get_event(event_name)
sample_data = found.get_sample_data(Repository('foo', 'bar'), {'level': 'low'})
2017-07-14 13:49:44 +00:00
# Make sure all calls succeed.
notification_data = {
'performer_data': {},
}
2017-07-14 13:49:44 +00:00
found.get_level(sample_data, notification_data)
found.get_summary(sample_data, notification_data)
found.get_message(sample_data, notification_data)