summaryrefslogtreecommitdiff
path: root/service/test
diff options
context:
space:
mode:
authorBruno Wagner Goncalves <bwagner@thoughtworks.com>2014-08-06 01:53:49 -0300
committerBruno Wagner Goncalves <bwagner@thoughtworks.com>2014-08-06 01:53:49 -0300
commit26cbb616eb3ada3a0fb82e3156737b43cd2bc1ac (patch)
tree7a8c13899a6ddeef15f241166560455e439c48fc /service/test
parent821c1a76d80c0259e10e66443eb458f14d840b85 (diff)
LeapSmtp SMTP_PORT constant is in fact the twisted communication port and must be unique between instances, so it cannot be a constant unless we change LeapSmtp to a singleton
Diffstat (limited to 'service/test')
-rw-r--r--service/test/bitmask_libraries/smtp_test.py4
1 files changed, 3 insertions, 1 deletions
diff --git a/service/test/bitmask_libraries/smtp_test.py b/service/test/bitmask_libraries/smtp_test.py
index ed5fc520..4aa2d01d 100644
--- a/service/test/bitmask_libraries/smtp_test.py
+++ b/service/test/bitmask_libraries/smtp_test.py
@@ -50,12 +50,14 @@ class LeapSmtpTest(AbstractLeapTest):
@patch('app.bitmask_libraries.smtp.setup_smtp_gateway')
def test_that_start_calls_setup_smtp_gateway(self, gateway_mock):
smtp = LeapSmtp(self.provider, self.keymanager, self.srp_session)
+ port = 500
+ smtp._twisted_port = port
gateway_mock.return_value = (None, None)
with HTTMock(ca_cert_mock, not_found_mock):
smtp.start()
cert_path = self._client_cert_path()
- gateway_mock.assert_called_with(keymanager=self.keymanager, smtp_cert=cert_path, smtp_key=cert_path, userid='test_user@some-server.test', smtp_port='1234', encrypted_only=False, smtp_host='smtp.some-sever.test', port=2014)
+ gateway_mock.assert_called_with(keymanager=self.keymanager, smtp_cert=cert_path, smtp_key=cert_path, userid='test_user@some-server.test', smtp_port='1234', encrypted_only=False, smtp_host='smtp.some-sever.test', port=port)
def test_that_client_stop_does_nothing_if_not_started(self):
smtp = LeapSmtp(self.provider, self.keymanager, self.srp_session)