Exemplo n.º 1
0
    def test_add_client_custom(self):
        def fake_class(addr, queue, **kwargs):
            self.assertEqual(('testhost', 25), addr)
            return 'success'

        static = StaticSmtpRelay('testhost', client_class=fake_class)
        self.assertEqual('success', static.add_client())
Exemplo n.º 2
0
 def test_add_client(self):
     static = StaticSmtpRelay('testhost')
     ret = static.add_client()
     self.assertIsInstance(ret, SmtpRelayClient)
 def test_add_client(self):
     static = StaticSmtpRelay('testhost')
     ret = static.add_client()
     self.assertIsInstance(ret, SmtpRelayClient)
 def test_add_client_custom(self):
     def fake_class(addr, queue, **kwargs):
         self.assertEqual(('testhost', 25), addr)
         return 'success'
     static = StaticSmtpRelay('testhost', client_class=fake_class)
     self.assertEqual('success', static.add_client())