adds handle_error(self):raise to test modules using asyncore to provide a clearer error message in case something goes wrong

This commit is contained in:
Giampaolo Rodolà 2010-05-06 20:19:32 +00:00
parent 215b6b392d
commit e4499a88c2
2 changed files with 9 additions and 0 deletions

View File

@ -48,6 +48,9 @@ def handle_close(self):
self.close()
self.dtp_conn_closed = True
def handle_error(self):
raise
class DummyFTPHandler(asynchat.async_chat):

View File

@ -366,6 +366,9 @@ def smtp_AUTH(self, arg):
else:
self.push('550 No access for you!')
def handle_error(self):
raise
class SimSMTPServer(smtpd.SMTPServer):
@ -384,6 +387,9 @@ def process_message(self, peer, mailfrom, rcpttos, data):
def add_feature(self, feature):
self._extra_features.append(feature)
def handle_error(self):
raise
# Test various SMTP & ESMTP commands/behaviors that require a simulated server
# (i.e., something with more features than DebuggingServer)