def test_simple_handshake(self): mock = self.mox.CreateMockAnything() mock.__call__(IsA(SmtpSession)).AndReturn(mock) mock.handle_banner(IsA(Reply), ('127.0.0.1', 0)) mock.handle_helo(IsA(Reply), 'there') self.mox.ReplayAll() h = SmtpSession(('127.0.0.1', 0), mock, None) h.BANNER_(Reply('220')) h.HELO(Reply('250'), 'there') self.assertEqual('there', h.ehlo_as) self.assertFalse(h.extended_smtp)