mirror of
https://github.com/GSA/notifications-api.git
synced 2026-02-02 17:31:14 -05:00
Update tests to use set() otherwise is possible to fail
This commit is contained in:
@@ -40,7 +40,8 @@ def test_should_get_all_statuses_for_notifications_associated_with_job(
|
|||||||
notify_db,
|
notify_db,
|
||||||
notify_db_session,
|
notify_db_session,
|
||||||
sample_service,
|
sample_service,
|
||||||
sample_job):
|
sample_job
|
||||||
|
):
|
||||||
notification = partial(create_notification, notify_db, notify_db_session, service=sample_service, job=sample_job)
|
notification = partial(create_notification, notify_db, notify_db_session, service=sample_service, job=sample_job)
|
||||||
notification(status='created')
|
notification(status='created')
|
||||||
notification(status='sending')
|
notification(status='sending')
|
||||||
@@ -53,7 +54,7 @@ def test_should_get_all_statuses_for_notifications_associated_with_job(
|
|||||||
notification(status='sent')
|
notification(status='sent')
|
||||||
|
|
||||||
results = dao_get_notification_outcomes_for_job(sample_service.id, sample_job.id)
|
results = dao_get_notification_outcomes_for_job(sample_service.id, sample_job.id)
|
||||||
assert [(row.count, row.status) for row in results] == [
|
assert set([(row.count, row.status) for row in results]) == set([
|
||||||
(1, 'created'),
|
(1, 'created'),
|
||||||
(1, 'sending'),
|
(1, 'sending'),
|
||||||
(1, 'delivered'),
|
(1, 'delivered'),
|
||||||
@@ -63,17 +64,19 @@ def test_should_get_all_statuses_for_notifications_associated_with_job(
|
|||||||
(1, 'temporary-failure'),
|
(1, 'temporary-failure'),
|
||||||
(1, 'permanent-failure'),
|
(1, 'permanent-failure'),
|
||||||
(1, 'sent')
|
(1, 'sent')
|
||||||
]
|
])
|
||||||
|
|
||||||
|
|
||||||
def test_should_count_of_statuses_for_notifications_associated_with_job(
|
def test_should_count_of_statuses_for_notifications_associated_with_job(
|
||||||
notify_db,
|
notify_db,
|
||||||
notify_db_session,
|
notify_db_session,
|
||||||
sample_service,
|
sample_service,
|
||||||
sample_job):
|
sample_job
|
||||||
|
):
|
||||||
notification = partial(create_notification, notify_db, notify_db_session, service=sample_service, job=sample_job)
|
notification = partial(create_notification, notify_db, notify_db_session, service=sample_service, job=sample_job)
|
||||||
notification(status='created')
|
notification(status='created')
|
||||||
notification(status='created')
|
notification(status='created')
|
||||||
|
|
||||||
notification(status='sending')
|
notification(status='sending')
|
||||||
notification(status='sending')
|
notification(status='sending')
|
||||||
notification(status='sending')
|
notification(status='sending')
|
||||||
@@ -82,11 +85,11 @@ def test_should_count_of_statuses_for_notifications_associated_with_job(
|
|||||||
notification(status='delivered')
|
notification(status='delivered')
|
||||||
|
|
||||||
results = dao_get_notification_outcomes_for_job(sample_service.id, sample_job.id)
|
results = dao_get_notification_outcomes_for_job(sample_service.id, sample_job.id)
|
||||||
assert [(row.count, row.status) for row in results] == [
|
assert set([(row.count, row.status) for row in results]) == set([
|
||||||
(2, 'created'),
|
(2, 'created'),
|
||||||
(4, 'sending'),
|
(4, 'sending'),
|
||||||
(2, 'delivered')
|
(2, 'delivered')
|
||||||
]
|
])
|
||||||
|
|
||||||
|
|
||||||
def test_should_return_zero_length_array_if_no_notifications_for_job(sample_service, sample_job):
|
def test_should_return_zero_length_array_if_no_notifications_for_job(sample_service, sample_job):
|
||||||
|
|||||||
Reference in New Issue
Block a user