Product
Introducing SSO
Streamline your login process and enhance security by enabling Single Sign-On (SSO) on the Socket platform, now available for all customers on the Enterprise plan, supporting 20+ identity providers.
smtp-test-server
Readme
Based on the aiosmtpd
, this packages offers you a simple way to integrate
a SMTP server into your test code.
Currently, the server does not support authentication, TLS or anything special instead of sending mails.
All mails are collected in the messages
property of the mock and can be evaluated there.
Looking for a pytest
SMTP mock fixture? Take a look at this project:
git.codebau.dev/pytest-plugins/pytest-smtp-test-server.
pip install smtp-test-server
poetry add --group dev smtp-test-server
Simple usage, with auto assigning a free port number on 127.0.0.1
:
from smtp_test_server.context import SmtpMockServer
def test_send_mail():
with SmtpMockServer() as smtp_mock:
my_mail_method(smtp_host=smtp_mock.host, smtp_port=smtp_mock.port)
assert len(smtp_mock.messages) == 1
assert smtp_mock.messages[0]["from"] == "my-test@sender.org"
Want to have more control over host and port? Use it like this:
with SmtpMockServer(bind_host="223.12.9.177", bind_port=2525):
...
Ports are automatically closed when leaving the context.
FAQs
Simple SMTP test server for running unit and integration tests.
We found that smtp-test-server demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Product
Streamline your login process and enhance security by enabling Single Sign-On (SSO) on the Socket platform, now available for all customers on the Enterprise plan, supporting 20+ identity providers.
Security News
Tea.xyz, a crypto project aimed at rewarding open source contributions, is once again facing backlash due to an influx of spam packages flooding public package registries.
Security News
As cyber threats become more autonomous, AI-powered defenses are crucial for businesses to stay ahead of attackers who can exploit software vulnerabilities at scale.