-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
3 changed files
with
37 additions
and
54 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -81,9 +81,7 @@ def test_bookplates_metadata_email( | |
mocker, mock_bookplate_metadata, mock_folio_variables | ||
): | ||
|
||
mock_send_email = mocker.patch( | ||
"libsys_airflow.plugins.digital_bookplates.email.send_email_with_server_name", | ||
) | ||
mock_send_email = mocker.patch("libsys_airflow.plugins.shared.utils.send_email") | ||
|
||
bookplates_metadata_email.function( | ||
new=mock_bookplate_metadata["new"], updated=mock_bookplate_metadata["updated"] | ||
|
@@ -121,9 +119,7 @@ def test_bookplates_metadata_email( | |
|
||
|
||
def test_bookplates_metadata_email_none(mocker, mock_folio_variables, caplog): | ||
mock_send_email = mocker.patch( | ||
"libsys_airflow.plugins.digital_bookplates.email.send_email_with_server_name" | ||
) | ||
mock_send_email = mocker.patch("libsys_airflow.plugins.shared.utils.send_email") | ||
|
||
bookplates_metadata_email.function(new=None, updated=None) | ||
|
||
|
@@ -138,9 +134,7 @@ def test_no_new_bookplates_metadata_email( | |
mocker, mock_bookplate_metadata, mock_folio_variables, caplog | ||
): | ||
|
||
mock_send_email = mocker.patch( | ||
"libsys_airflow.plugins.digital_bookplates.email.send_email_with_server_name" | ||
) | ||
mock_send_email = mocker.patch("libsys_airflow.plugins.shared.utils.send_email") | ||
|
||
bookplates_metadata_email.function( | ||
new=[], updated=mock_bookplate_metadata["updated"] | ||
|
@@ -173,9 +167,7 @@ def test_no_updated_bookplates_metadata_email( | |
mocker, mock_bookplate_metadata, mock_folio_variables, caplog | ||
): | ||
|
||
mock_send_email = mocker.patch( | ||
"libsys_airflow.plugins.digital_bookplates.email.send_email_with_server_name" | ||
) | ||
mock_send_email = mocker.patch("libsys_airflow.plugins.shared.utils.send_email") | ||
|
||
bookplates_metadata_email.function( | ||
new=mock_bookplate_metadata["new"], | ||
|
@@ -201,9 +193,7 @@ def test_no_updated_bookplates_metadata_email( | |
|
||
def test_deleted_from_argo_email(mocker, mock_folio_variables): | ||
|
||
mock_send_email = mocker.patch( | ||
"libsys_airflow.plugins.digital_bookplates.email.send_email_with_server_name" | ||
) | ||
mock_send_email = mocker.patch("libsys_airflow.plugins.shared.utils.send_email") | ||
|
||
deleted_druids_info = [ | ||
{"title": "The Happy Fund", "druid": "ab123xy4567", "fund_name": "HAPY"} | ||
|
@@ -226,9 +216,7 @@ def test_deleted_from_argo_email(mocker, mock_folio_variables): | |
|
||
|
||
def test_deleted_from_argo_email_no_druids(mocker, caplog): | ||
mock_send_email = mocker.patch( | ||
"libsys_airflow.plugins.digital_bookplates.email.send_email_with_server_name" | ||
) | ||
mock_send_email = mocker.patch("libsys_airflow.plugins.shared.utils.send_email") | ||
|
||
deleted_from_argo_email.function(deleted_druids=[]) | ||
|
||
|
@@ -237,12 +225,10 @@ def test_deleted_from_argo_email_no_druids(mocker, caplog): | |
|
||
|
||
def test_deleted_from_argo_email_prod(mocker, mock_folio_variables, caplog): | ||
mock_send_email = mocker.patch( | ||
"libsys_airflow.plugins.digital_bookplates.email.send_email_with_server_name" | ||
) | ||
mock_send_email = mocker.patch("libsys_airflow.plugins.shared.utils.send_email") | ||
|
||
mocker.patch( | ||
"libsys_airflow.plugins.digital_bookplates.email.is_production", | ||
"libsys_airflow.plugins.shared.utils.is_production", | ||
return_value=True, | ||
) | ||
|
||
|
@@ -254,9 +240,7 @@ def test_deleted_from_argo_email_prod(mocker, mock_folio_variables, caplog): | |
|
||
|
||
def test_missing_fields_email(mocker, mock_folio_variables): | ||
mock_send_email = mocker.patch( | ||
"libsys_airflow.plugins.digital_bookplates.email.send_email_with_server_name" | ||
) | ||
mock_send_email = mocker.patch("libsys_airflow.plugins.shared.utils.send_email") | ||
|
||
missing_fields_email.function(failures=failures) | ||
|
||
|
@@ -284,12 +268,10 @@ def test_missing_fields_email_no_failures(mock_folio_variables, caplog): | |
|
||
|
||
def test_missing_fields_email_prod(mocker, mock_folio_variables): | ||
mock_send_email = mocker.patch( | ||
"libsys_airflow.plugins.digital_bookplates.email.send_email_with_server_name" | ||
) | ||
mock_send_email = mocker.patch("libsys_airflow.plugins.shared.utils.send_email") | ||
|
||
mocker.patch( | ||
"libsys_airflow.plugins.digital_bookplates.email.is_production", | ||
"libsys_airflow.plugins.shared.utils.is_production", | ||
return_value=True, | ||
) | ||
|
||
|
@@ -301,9 +283,7 @@ def test_missing_fields_email_prod(mocker, mock_folio_variables): | |
|
||
|
||
def test_summary_add_979_dag_runs(mocker, mock_folio_variables): | ||
mock_send_email = mocker.patch( | ||
"libsys_airflow.plugins.digital_bookplates.email.send_email_with_server_name" | ||
) | ||
mock_send_email = mocker.patch("libsys_airflow.plugins.shared.utils.send_email") | ||
|
||
mocker.patch( | ||
"libsys_airflow.plugins.digital_bookplates.email.conf.get", | ||
|
@@ -357,8 +337,11 @@ def test_summary_add_979_dag_runs(mocker, mock_folio_variables): | |
|
||
|
||
def test_summary_add_979_dag_runs_prod(mocker, mock_folio_variables): | ||
mock_send_email = mocker.patch( | ||
"libsys_airflow.plugins.digital_bookplates.email.send_email_with_server_name" | ||
mock_send_email = mocker.patch("libsys_airflow.plugins.shared.utils.send_email") | ||
|
||
mocker.patch( | ||
"libsys_airflow.plugins.shared.utils.is_production", | ||
return_value=True, | ||
) | ||
|
||
mocker.patch( | ||
|
@@ -374,6 +357,6 @@ def test_summary_add_979_dag_runs_prod(mocker, mock_folio_variables): | |
|
||
assert mock_send_email.call_args[1]["to"] == [ | ||
'[email protected]', | ||
'[email protected]', | ||
'[email protected]', | ||
'[email protected]', | ||
] |