Mock SMTP服务器,将收到的消息以JSON格式记录到stdout,便于hitch框架进行解析和测试。
项目描述
HitchSMTP
Mock SMTP服务器,将所有收到的消息以JSON格式记录到stdout,以便HitchServe轻松解析。
HitchSMTP包含用于Hitch的服务定义,但也可以单独使用。
与Hitch一起使用
安装如下
$ hitch install hitchsmtp
# Service definition in your test execution engine's setUp
self.services['HitchSMTP'] = hitchsmtp.HitchSMTPService(
port=10025 # Optional (default: 10025)
)
# Wait for email during test...
containing = "Registration email"
email = self.services['HitchSMTP'].logs.out.tail.until_json(
lambda email: containing in email['payload'] or containing in email['Subject'],
timeout=5,
lines_back=1,
)
在DjangoRemindMe项目中查看此服务的实际应用。
差的SMTP服务器
您可以向特定的电子邮件地址发送邮件来模拟大多数SMTP错误。
例如,向451-please-try-again-later@smtperrors.com发送邮件将导致“451 Please try again later” SMTP错误。
有关这些错误的完整列表以及会触发它们的邮箱地址 @ smtperrors.com,请参阅
https://github.com/hitchtest/hitchsmtp/blob/master/hitchsmtp/smtperrors.py
功能
以易于解析的 JSON 格式记录 SMTP 服务器接收到的电子邮件的所有详细信息。
自动解析您电子邮件中的链接,以便您可以仅检查电子邮件中的链接并在上面“点击”。
还可以模拟 SMTP 错误。
项目详情
关闭
hitchsmtp-0.2.1.tar.gz 的哈希值
算法 | 哈希摘要 | |
---|---|---|
SHA256 | 26bfaafc642336a21d491209703f4d0ebdef432121d223400e6cd80acb09db69 |
|
MD5 | b9307bb3c152e3d4dd3fa69c51958a4d |
|
BLAKE2b-256 | 88cb0bccddb5167a0f89daaf515c34734131b3fb0d0a3e30e7721f3b30b3efdc |