]> granicus.if.org Git - python/commitdiff
Merged revisions 80882 via svnmerge from
authorGiampaolo Rodolà <g.rodola@gmail.com>
Thu, 6 May 2010 20:21:57 +0000 (20:21 +0000)
committerGiampaolo Rodolà <g.rodola@gmail.com>
Thu, 6 May 2010 20:21:57 +0000 (20:21 +0000)
svn+ssh://pythondev@svn.python.org/python/trunk

........
  r80882 | giampaolo.rodola | 2010-05-06 22:19:32 +0200 (gio, 06 mag 2010) | 1 line

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

Lib/test/test_ftplib.py
Lib/test/test_smtplib.py

index 4e80daee9a1c384b5c19310554d468a0ce1d5579..b949b695ebf54f024b368698e4856694d0fcbd79 100644 (file)
@@ -50,6 +50,9 @@ class DummyDTPHandler(asynchat.async_chat):
     def push(self, what):
         super(DummyDTPHandler, self).push(what.encode('ascii'))
 
+    def handle_error(self):
+        raise
+
 
 class DummyFTPHandler(asynchat.async_chat):
 
index 3a9de5b4b7096d5feb74ccdbf78a1ba4c93d1f64..d0b2b27f03d3e76f1401cb2a17d9580c9dcbd361 100644 (file)
@@ -374,6 +374,9 @@ class SimSMTPChannel(smtpd.SMTPChannel):
         else:
             self.push('550 No access for you!')
 
+    def handle_error(self):
+        raise
+
 
 class SimSMTPServer(smtpd.SMTPServer):
 
@@ -392,6 +395,9 @@ class SimSMTPServer(smtpd.SMTPServer):
     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)