diff options
Diffstat (limited to 'service/test')
-rw-r--r-- | service/test/__init__.py | 4 | ||||
-rw-r--r-- | service/test/adapter/__init__.py | 0 | ||||
-rw-r--r-- | service/test/adapter/mail_service_test.py | 1 | ||||
-rw-r--r-- | service/test/bitmask_libraries/leap_srp_test.py | 4 | ||||
-rw-r--r-- | service/test/bitmask_libraries/smtp_test.py | 8 |
5 files changed, 10 insertions, 7 deletions
diff --git a/service/test/__init__.py b/service/test/__init__.py new file mode 100644 index 00000000..acb5b492 --- /dev/null +++ b/service/test/__init__.py @@ -0,0 +1,4 @@ +import sys +import os + +sys.path.insert(0, os.environ['APP_ROOT']) diff --git a/service/test/adapter/__init__.py b/service/test/adapter/__init__.py new file mode 100644 index 00000000..e69de29b --- /dev/null +++ b/service/test/adapter/__init__.py diff --git a/service/test/adapter/mail_service_test.py b/service/test/adapter/mail_service_test.py index 9f0ac616..dfaee058 100644 --- a/service/test/adapter/mail_service_test.py +++ b/service/test/adapter/mail_service_test.py @@ -4,6 +4,7 @@ import unittest from app.adapter.mail_service import MailService + class TestMailService(unittest.TestCase): def test_initialization(self): diff --git a/service/test/bitmask_libraries/leap_srp_test.py b/service/test/bitmask_libraries/leap_srp_test.py index a8b5b3fb..e10be216 100644 --- a/service/test/bitmask_libraries/leap_srp_test.py +++ b/service/test/bitmask_libraries/leap_srp_test.py @@ -1,7 +1,3 @@ -import sys -import os -sys.path.insert(0, os.environ['APP_ROOT']) - import json import unittest import binascii diff --git a/service/test/bitmask_libraries/smtp_test.py b/service/test/bitmask_libraries/smtp_test.py index 3982a50c..ed5fc520 100644 --- a/service/test/bitmask_libraries/smtp_test.py +++ b/service/test/bitmask_libraries/smtp_test.py @@ -1,9 +1,9 @@ +import os from mock import MagicMock, patch from abstract_leap_test import AbstractLeapTest from app.bitmask_libraries.smtp import LeapSmtp from httmock import all_requests, HTTMock, urlmatch -import os -import sys + @all_requests def not_found_mock(url, request): @@ -12,6 +12,7 @@ def not_found_mock(url, request): return {'status_code': 404, 'content': 'foobar'} + @urlmatch(netloc='api.some-server.test:4430', path='/1/cert') def ca_cert_mock(url, request): return { @@ -19,6 +20,7 @@ def ca_cert_mock(url, request): "content": "some content" } + class LeapSmtpTest(AbstractLeapTest): keymanager = MagicMock() @@ -26,7 +28,7 @@ class LeapSmtpTest(AbstractLeapTest): self.provider.fetch_smtp_json.return_value = { 'hosts': { 'leap-mx': { - 'hostname': 'smtp.some-sever.test', + 'hostname': 'smtp.some-sever.test', 'port': '1234' } } |