mirror of
https://github.com/chatmail/relay.git
synced 2026-05-20 04:48:06 +00:00
test: report if rate limit from last test was still active
This commit is contained in:
@@ -202,7 +202,10 @@ def test_exceed_rate_limit(smtp, gencreds):
|
|||||||
try:
|
try:
|
||||||
smtp.conn.sendmail(user, to_addr, mail)
|
smtp.conn.sendmail(user, to_addr, mail)
|
||||||
except smtplib.SMTPSenderRefused as e:
|
except smtplib.SMTPSenderRefused as e:
|
||||||
assert i > 41
|
if i == 0:
|
||||||
|
pytest.fail(f"rate limit was exceeded too early with msg {i} - maybe wait a minute before testing?")
|
||||||
|
if i < 41:
|
||||||
|
pytest.fail(f"rate limit was exceeded too early with msg {i}")
|
||||||
assert e.smtp_code == 450
|
assert e.smtp_code == 450
|
||||||
assert b'4.7.1 Error: too much mail from' in e.smtp_error
|
assert b'4.7.1 Error: too much mail from' in e.smtp_error
|
||||||
return
|
return
|
||||||
|
|||||||
Reference in New Issue
Block a user