summaryrefslogtreecommitdiff
path: root/tests/integration/mail/smtp/test_gateway.py
diff options
context:
space:
mode:
authorRuben Pollan <meskio@sindominio.net>2017-12-16 21:04:01 +0200
committerKali Kaneko <kali@leap.se>2017-12-22 20:03:30 +0100
commit90503627ef5047cd7e6e253266f0b25f2b1daa4d (patch)
treec4e5908db4d5e81e97a4d0f920af7ef44b5ab971 /tests/integration/mail/smtp/test_gateway.py
parentf4a3c23be148a822352d484c263ead0e4fd2b907 (diff)
[refactor] Use sender interface in outgoing service
Diffstat (limited to 'tests/integration/mail/smtp/test_gateway.py')
-rw-r--r--tests/integration/mail/smtp/test_gateway.py9
1 files changed, 6 insertions, 3 deletions
diff --git a/tests/integration/mail/smtp/test_gateway.py b/tests/integration/mail/smtp/test_gateway.py
index aac90b50..254ee029 100644
--- a/tests/integration/mail/smtp/test_gateway.py
+++ b/tests/integration/mail/smtp/test_gateway.py
@@ -29,6 +29,7 @@ from twisted.test import proto_helpers
from mock import Mock
from leap.bitmask.keymanager import openpgp, errors
+from leap.bitmask.mail.outgoing.service import OutgoingMail
from leap.bitmask.mail.testing import KeyManagerWithSoledadTestCase
from leap.bitmask.mail.testing import ADDRESS, ADDRESS_2
from leap.bitmask.mail.testing.smtp import getSMTPFactory, TEST_USER
@@ -91,7 +92,8 @@ class TestSmtpGateway(KeyManagerWithSoledadTestCase):
'354 Continue']
user = TEST_USER
- proto = getSMTPFactory({user: None}, {user: self.km}, {user: None})
+ proto = getSMTPFactory({user: OutgoingMail(user, self.km)},
+ {user: None})
transport = proto_helpers.StringTransport()
proto.makeConnection(transport)
reply = ""
@@ -117,7 +119,7 @@ class TestSmtpGateway(KeyManagerWithSoledadTestCase):
return_value=fail(errors.KeyNotFound()))
user = TEST_USER
proto = getSMTPFactory(
- {user: None}, {user: self.km}, {user: None},
+ {user: OutgoingMail(user, self.km)}, {user: None},
encrypted_only=True)
transport = proto_helpers.StringTransport()
proto.makeConnection(transport)
@@ -147,7 +149,8 @@ class TestSmtpGateway(KeyManagerWithSoledadTestCase):
self.km._fetch_keys_from_server_and_store_local = Mock(
return_value=fail(errors.KeyNotFound()))
user = TEST_USER
- proto = getSMTPFactory({user: None}, {user: self.km}, {user: None})
+ proto = getSMTPFactory({user: OutgoingMail(user, self.km)},
+ {user: None})
transport = proto_helpers.StringTransport()
proto.makeConnection(transport)
yield self.getReply(self.EMAIL_DATA[0] + '\r\n', proto, transport)