Skip to content

Commit b81024c

Browse files
committed
Update dependencies.
1 parent c299a95 commit b81024c

4 files changed

Lines changed: 935 additions & 1023 deletions

File tree

clients/mail.py

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -29,12 +29,7 @@ def send_email(self, body: dict, test_mode=False) -> Response:
2929
try:
3030
if test_mode is True:
3131
body.update({"o:testmode": True})
32-
return requests.post(
33-
self.endpoint,
34-
auth=("api", self.api_key),
35-
data=body,
36-
timeout=20
37-
)
32+
return requests.post(self.endpoint, auth=("api", self.api_key), data=body, timeout=20)
3833
except HTTPError as e:
3934
LOGGER.error(f"HTTPError error while sending email to `{body['to']}` subject `{body['subject']}`: {e}")
4035
except Exception as e:
@@ -73,7 +68,7 @@ def email_notification_new_comment(self, post: dict, recipient: List[str], comme
7368
}
7469
LOGGER.error(
7570
f"Failed to send comment notification to {recipient} with error {email_response.status_code} ({email_response.json()}): {body}"
76-
)
71+
)
7772
return {
7873
"status": {
7974
"sent": False,

clients/tests/test_mail.py

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,13 @@
11
"""Test cases for email notifications related to user-generated comments on posts."""
2+
23
import pytest
34

45

56
@pytest.fixture
67
def comment_body() -> dict:
78
"""
89
Sample payload for a user-generated comment.
9-
10+
1011
:returns: dict
1112
"""
1213
return {
@@ -25,11 +26,11 @@ def comment_body() -> dict:
2526
def test_comment_email(comment_body: dict, ghost, mailgun):
2627
"""
2728
Send test email notification for new comment on post.
28-
29+
2930
:param dict comment_body: Comment body to be used in the test.
3031
:param ghost: Ghost client fixture.
3132
:param mailgun: Mailgun client fixture.
32-
33+
3334
:returns: None
3435
"""
3536
post = ghost.get_post("61304d8374047afda1c2168b")

0 commit comments

Comments
 (0)