]> granicus.if.org Git - python/commitdiff
#5712: Preemptively fix some other possible timing issues.
authorR David Murray <rdmurray@bitdance.com>
Thu, 21 Mar 2013 02:11:40 +0000 (22:11 -0400)
committerR David Murray <rdmurray@bitdance.com>
Thu, 21 Mar 2013 02:11:40 +0000 (22:11 -0400)
Lib/test/test_smtplib.py

index e5df6c7a60983a258d0a6af4fd8dfd0695ceb6fe..ec971ea52cc84d0b54c2e0531b62b629e8b66c0c 100644 (file)
@@ -626,12 +626,12 @@ class SimSMTPChannel(smtpd.SMTPChannel):
         if self.rcpt_response is None:
             super().smtp_RCPT(arg)
             return
-        self.push(self.rcpt_response[self.rcpt_count])
         self.rcpt_count += 1
+        self.push(self.rcpt_response[self.rcpt_count-1])
 
     def smtp_RSET(self, arg):
-        super().smtp_RSET(arg)
         self.rset_count += 1
+        super().smtp_RSET(arg)
 
     def smtp_DATA(self, arg):
         if self.data_response is None:
@@ -794,7 +794,7 @@ class SMTPSimTests(unittest.TestCase):
         with self.assertRaises(smtplib.SMTPSenderRefused):
             smtp.sendmail('John', 'Sally', 'test message')
         self.assertIsNone(smtp.sock)
-        self.assertEqual(self.serv._SMTPchannel.rcpt_count, 0)
+        self.assertEqual(self.serv._SMTPchannel.rset_count, 0)
 
     def test_421_from_rcpt_cmd(self):
         smtp = smtplib.SMTP(HOST, self.port, local_hostname='localhost', timeout=15)