Mercurial > hg
comparison tests/dummysmtpd.py @ 39029:78f1899e4202
dummysmtpd: accept additional kwargs from stdlib smtpd
This was causing extremely mysterious failures because smtpd is
implemented using asynchat, which in turn doesn't appear to do
anything *remotely* helpful if an exception occurs.
# no-check-commit because I'm editing a foo_bar function signature
test-patchbomb-tls.t now passes in Python 3, but only because it
doesn't check message bodies like test-patchbomb.t. test-patchbomb.t
is *full* of doubled headers in the output (eg [0]) which seems like
an odd failure mode.
0:
@@ -141,12 +154,17 @@
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
+ MIME-Version: 1.0
+ Content-Type: text/plain; charset="us-ascii"
+ Content-Transfer-Encoding: 7bit
Subject: [PATCH] bookmark
X-Mercurial-Node: 8dab2639fd35f1e337ad866c372a5c44f1064e3c
X-Mercurial-Series-Index: 1
X-Mercurial-Series-Total: 1
Differential Revision: https://phab.mercurial-scm.org/D4219
author | Augie Fackler <augie@google.com> |
---|---|
date | Thu, 09 Aug 2018 17:46:07 -0400 |
parents | ed96d1116302 |
children | 2372284d9457 |
comparison
equal
deleted
inserted
replaced
39028:713126389ef2 | 39029:78f1899e4202 |
---|---|
24 | 24 |
25 class dummysmtpserver(smtpd.SMTPServer): | 25 class dummysmtpserver(smtpd.SMTPServer): |
26 def __init__(self, localaddr): | 26 def __init__(self, localaddr): |
27 smtpd.SMTPServer.__init__(self, localaddr, remoteaddr=None) | 27 smtpd.SMTPServer.__init__(self, localaddr, remoteaddr=None) |
28 | 28 |
29 def process_message(self, peer, mailfrom, rcpttos, data): | 29 def process_message(self, peer, mailfrom, rcpttos, data, **kwargs): |
30 log('%s from=%s to=%s\n' % (peer[0], mailfrom, ', '.join(rcpttos))) | 30 log('%s from=%s to=%s\n' % (peer[0], mailfrom, ', '.join(rcpttos))) |
31 | 31 |
32 def handle_error(self): | 32 def handle_error(self): |
33 # On Windows, a bad SSL connection sometimes generates a WSAECONNRESET. | 33 # On Windows, a bad SSL connection sometimes generates a WSAECONNRESET. |
34 # The default handler will shutdown this server, and then both the | 34 # The default handler will shutdown this server, and then both the |