Пример #1
0
 def test_have_data_queueerror(self):
     env = Envelope()
     handoff = self.mox.CreateMockAnything()
     handoff(env).AndReturn([(env, QueueError())])
     self.mox.ReplayAll()
     h = SmtpSession(('127.0.0.1', 0), None, handoff)
     h.envelope = env
     reply = Reply('250')
     h.HAVE_DATA(reply, b'', None)
     self.assertEqual('451', reply.code)
     self.assertEqual('4.3.0 Error queuing message', reply.message)
Пример #2
0
 def test_have_data_queueerror(self):
     env = Envelope()
     handoff = self.mox.CreateMockAnything()
     handoff(env).AndReturn([(env, QueueError())])
     self.mox.ReplayAll()
     h = SmtpSession(('127.0.0.1', 0), None, handoff)
     h.envelope = env
     reply = Reply('250')
     h.HAVE_DATA(reply, b'', None)
     self.assertEqual('451', reply.code)
     self.assertEqual('4.3.0 Error queuing message', reply.message)
 def test_have_data(self):
     env = Envelope()
     handoff = self.mox.CreateMockAnything()
     handoff(env).AndReturn([(env, 'testid')])
     self.mox.ReplayAll()
     h = SmtpSession(('127.0.0.1', 0), None, handoff)
     h.envelope = env
     reply = Reply('250')
     h.HAVE_DATA(reply, b'', None)
     self.assertEqual('250', reply.code)
     self.assertEqual('2.6.0 Message accepted for delivery', reply.message)
 def test_have_data(self):
     env = Envelope()
     handoff = self.mox.CreateMockAnything()
     handoff(env).AndReturn([(env, 'testid')])
     self.mox.ReplayAll()
     h = SmtpSession(('127.0.0.1', 0), None, handoff)
     h.envelope = env
     reply = Reply('250')
     h.HAVE_DATA(reply, '', None)
     assert_equal('250', reply.code)
     assert_equal('2.6.0 Message accepted for delivery', reply.message)
 def test_have_data(self):
     env = Envelope()
     handoff = self.mox.CreateMockAnything()
     handoff(env).AndReturn([(env, "testid")])
     self.mox.ReplayAll()
     h = SmtpSession(("127.0.0.1", 0), None, handoff)
     h.envelope = env
     reply = Reply("250")
     h.HAVE_DATA(reply, "", None)
     self.assertEqual("250", reply.code)
     self.assertEqual("2.6.0 Message accepted for delivery", reply.message)
 def test_have_data_queueerror(self):
     env = Envelope()
     handoff = self.mox.CreateMockAnything()
     handoff(env).AndReturn([(env, QueueError())])
     self.mox.ReplayAll()
     h = SmtpSession(("127.0.0.1", 0), None, handoff)
     h.envelope = env
     reply = Reply("250")
     h.HAVE_DATA(reply, "", None)
     self.assertEqual("550", reply.code)
     self.assertEqual("5.6.0 Error queuing message", reply.message)
Пример #7
0
 def test_have_data(self):
     class PtrLookup(object):
         def finish(self, *args):
             return 'localhost'
     env = Envelope()
     handoff = self.mox.CreateMockAnything()
     handoff(env).AndReturn([(env, 'testid')])
     self.mox.ReplayAll()
     h = SmtpSession(('127.0.0.1', 0), None, handoff)
     h.envelope = env
     h._ptr_lookup = PtrLookup()
     reply = Reply('250')
     h.HAVE_DATA(reply, b'', None)
     self.assertEqual('250', reply.code)
     self.assertEqual('2.6.0 Message accepted for delivery', reply.message)
     self.assertEqual('localhost', env.client['host'])
Пример #8
0
 def test_have_data(self):
     class PtrLookup(object):
         def finish(self, *args):
             return 'localhost'
     env = Envelope()
     handoff = self.mox.CreateMockAnything()
     handoff(env).AndReturn([(env, 'testid')])
     self.mox.ReplayAll()
     h = SmtpSession(('127.0.0.1', 0), None, handoff)
     h.envelope = env
     h._ptr_lookup = PtrLookup()
     reply = Reply('250')
     h.HAVE_DATA(reply, b'', None)
     self.assertEqual('250', reply.code)
     self.assertEqual('2.6.0 Message accepted for delivery', reply.message)
     self.assertEqual('localhost', env.client['host'])