Skip to content

Commit

Permalink
Add test
Browse files Browse the repository at this point in the history
  • Loading branch information
VincentAntoine committed Sep 25, 2024
1 parent b7bdbaa commit 9824b80
Showing 1 changed file with 23 additions and 0 deletions.
23 changes: 23 additions & 0 deletions datascience/tests/test_pipeline/test_flows/test_distribute_pnos.py
Original file line number Diff line number Diff line change
Expand Up @@ -1289,6 +1289,20 @@ def pnos_query_string() -> str:
)


@pytest.fixture
def pnos_query_string_empty_result() -> str:
return (
"SELECT "
"public.prior_notification_uploads.report_id, "
"public.prior_notification_uploads.file_name, "
"public.prior_notification_uploads.content "
"\nFROM public.prior_notification_uploads "
"\nWHERE "
"public.prior_notification_uploads.report_id IN "
"('Does', 'Not', 'Exist')"
)


@pytest.fixture
def prior_notification_attachments() -> dict:
return {
Expand Down Expand Up @@ -1733,6 +1747,15 @@ def test_execute_prior_notification_attachments_query(
assert attachments == prior_notification_attachments


def test_execute_prior_notification_attachments_query_when_result_is_empty(
reset_test_data, pnos_query_string_empty_result
):
attachments = execute_prior_notification_attachments_query.run(
sqlalchemy.text(pnos_query_string_empty_result)
)
assert attachments == dict()


@pytest.mark.parametrize("test_mode", [False, True])
def test_create_email(
pno_pdf_document_to_distribute_targeted_vessel_and_segments_assigned,
Expand Down

0 comments on commit 9824b80

Please sign in to comment.