Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

notifications: new test for notification_recipients endpoint #14592

Merged
merged 1 commit into from
Apr 8, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
29 changes: 29 additions & 0 deletions tests/foreman/api/test_notifications.py
Original file line number Diff line number Diff line change
Expand Up @@ -333,3 +333,32 @@ def test_positive_notification_failed_repo_sync(failed_repo_sync_task, root_mail
body_text = mime_body.as_string()
assert product_name in body_text
assert f'/foreman_tasks/tasks/{task_id}' in body_text


@pytest.mark.tier1
pnovotny marked this conversation as resolved.
Show resolved Hide resolved
def test_positive_notification_recipients(target_sat):
"""Check that endpoint `/notification_recipients` works and returns correct data structure.

:id: 10e0fac2-f11f-11ee-ba60-000c2989e153

:steps:
1. Do a GET request to /notification_recipients endpoint.
2. Check the returned data structure for expected keys.

:BZ: 2249970

:customerscenario: true
"""
notification_keys = [
'id',
'seen',
'level',
'text',
'created_at',
'group',
'actions',
]
pnovotny marked this conversation as resolved.
Show resolved Hide resolved

recipients = target_sat.api.NotificationRecipients().read()
for notification in recipients.notifications:
assert set(notification_keys) == set(notification.keys())
Loading