예제 #1
0
 def setUp(self):
     """
     Create an in-memory mail domain to which messages may be delivered by
     tests and create a factory and transport to do the delivering.
     """
     self.factory = smtp.SMTPFactory()
     self.factory.domains = {}
     self.factory.domains['baz.com'] = DummyDomain(['foo'])
     self.transport = StringTransport()
예제 #2
0
 def testMessages(self):
     factory = smtp.SMTPFactory()
     factory.domains = {}
     factory.domains['foo.bar'] = DummyDomain(['moshez'])
     from twisted.mail.protocols import DomainSMTP
     protocol =  DomainSMTP()
     protocol.service = factory
     protocol.factory = factory
     clientProtocol = self.clientClass()
     return self.loopback(protocol, clientProtocol)
예제 #3
0
 def setUp(self):
     self.factory = smtp.SMTPFactory()
     self.factory.domains = {}
     self.factory.domains['baz.com'] = DummyDomain(['foo'])
     self.output = StringIOWithoutClosing()
     self.transport = internet.protocol.FileWrapper(self.output)