Refactored base64 attachment handling (#1191)

This commit is contained in:
Chris Caron
2024-08-27 18:58:56 -04:00
committed by GitHub
parent ca50cb7820
commit 98fb4865fc
21 changed files with 265 additions and 151 deletions

View File

@ -196,6 +196,12 @@ def test_plugin_sendgrid_attachments(mock_post, mock_get):
mock_post.reset_mock()
mock_get.reset_mock()
# Try again in a use case where we can't access the file
with mock.patch("os.path.isfile", return_value=False):
assert obj.notify(
body='body', title='title', notify_type=NotifyType.INFO,
attach=attach) is False
# Try again in a use case where we can't access the file
with mock.patch("builtins.open", side_effect=OSError):
assert obj.notify(