-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #21 from voynow/20-implement-side-effect-free-testing
20 implement side effect free testing
- Loading branch information
Showing
5 changed files
with
350 additions
and
135 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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -369,3 +369,20 @@ def send_email( | |
return api_instance.send_transac_email(send_smtp_email) | ||
except ProtocolError: | ||
return api_instance.send_transac_email(send_smtp_email) | ||
|
||
|
||
def mock_send_email( | ||
subject: str, | ||
html_content: str, | ||
to: Dict[str, str], | ||
sender: Dict[str, str] = { | ||
"name": "Jamie Voynow", | ||
"email": "[email protected]", | ||
}, | ||
) -> sib_api_v3_sdk.CreateSmtpEmail: | ||
"""Mock version of send_email for testing""" | ||
print(f"Subject: {subject}") | ||
print(f"To: {to}") | ||
print(f"Sender: {sender}") | ||
print(f"HTML Content: {html_content[:100] + '...'}") | ||
return sib_api_v3_sdk.CreateSmtpEmail(message_id="12345") |
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
Oops, something went wrong.