From 821c1a76d80c0259e10e66443eb458f14d840b85 Mon Sep 17 00:00:00 2001 From: Bruno Wagner Goncalves Date: Wed, 6 Aug 2014 01:47:33 -0300 Subject: Found a home for the 'insert base path in python path' hack and fixed some style issues --- service/test/bitmask_libraries/smtp_test.py | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) (limited to 'service/test/bitmask_libraries/smtp_test.py') 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' } } -- cgit v1.2.3