Skip to content
Merged
Show file tree
Hide file tree
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
2 changes: 1 addition & 1 deletion src/CSET/cset_workflow/app/send_email/bin/send_email.py
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ def run():
except ValueError:
body = "The webpage for your run of CSET is now ready, though the address could not be determined.\nCheck that WEB_ADDR and WEB_DIR are set correctly, then consider filing a bug report at https://github.com/MetOffice/CSET"
subprocess.run(
f'printf "{body}" | mail -s "{subject}" -S "from=notifications" "$USER"',
f'printf "{body}" | mail -s "{subject}" "$USER"',
check=True,
shell=True,
)
Expand Down
4 changes: 2 additions & 2 deletions tests/workflow_utils/test_send_email.py
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ def test_send_email(monkeypatch):
def mock_subprocess_run(args, check, shell):
assert (
args
== 'printf "The webpage for your run of CSET is now ready. You can view it here:\nhttps://example.com/~user/CSET" | mail -s "CSET webpage ready" -S "from=notifications" "$USER"'
== 'printf "The webpage for your run of CSET is now ready. You can view it here:\nhttps://example.com/~user/CSET" | mail -s "CSET webpage ready" "$USER"'
)
assert check
assert shell
Expand All @@ -84,7 +84,7 @@ def test_send_email_invalid_environment_variables(monkeypatch):
def mock_subprocess_run(args, check, shell):
assert (
args
== 'printf "The webpage for your run of CSET is now ready, though the address could not be determined.\nCheck that WEB_ADDR and WEB_DIR are set correctly, then consider filing a bug report at https://github.com/MetOffice/CSET" | mail -s "CSET webpage ready" -S "from=notifications" "$USER"'
== 'printf "The webpage for your run of CSET is now ready, though the address could not be determined.\nCheck that WEB_ADDR and WEB_DIR are set correctly, then consider filing a bug report at https://github.com/MetOffice/CSET" | mail -s "CSET webpage ready" "$USER"'
)
assert check
assert shell
Expand Down