diff options
-rw-r--r-- | service/setup.py | 20 | ||||
-rw-r--r-- | service/test/adapter/mail_service_test.py | 4 | ||||
-rw-r--r-- | service/test/adapter/pixelated_mail_test.py | 6 | ||||
-rw-r--r-- | service/test/bitmask_libraries/leap_srp_test.py | 2 | ||||
-rw-r--r-- | service/test/bitmask_libraries/nicknym_test.py | 6 | ||||
-rw-r--r-- | service/test/bitmask_libraries/provider_test.py | 4 | ||||
-rw-r--r-- | service/test/bitmask_libraries/session_test.py | 8 | ||||
-rw-r--r-- | service/test/bitmask_libraries/smtp_test.py | 6 | ||||
-rw-r--r-- | service/test/bitmask_libraries/soledad_test.py | 6 | ||||
-rw-r--r-- | service/test/search/test_search_query.py | 2 | ||||
-rw-r--r-- | service/test/test_tags.py | 2 |
11 files changed, 35 insertions, 31 deletions
diff --git a/service/setup.py b/service/setup.py index 2e575d84..5dc26b28 100644 --- a/service/setup.py +++ b/service/setup.py @@ -1,5 +1,9 @@ #!/usr/bin/env python +import sys +if 'develop' in sys.argv: + sys.argv.append('--always-unzip') + from setuptools import setup import os @@ -14,15 +18,12 @@ setup(name='Pixelated User Agent Service', author_email='pixelated-team@thoughtworks.com', url='http://pixelated-project.github.io', packages=['pixelated'], + test_suite='nose.collector', install_requires=[ - 'scrypt', - 'Twisted==12.2.0', - 'flask==0.10.1', - 'scanner==0.0.5', - 'requests==2.3.0', - 'pytest==2.6.0', - 'mock==1.0.1', - 'httmock==1.2.2', + 'Twisted', + 'flask', + 'scanner', + 'requests', 'srp==1.0.4', 'dirspec==13.10', 'u1db==13.09', @@ -30,5 +31,8 @@ setup(name='Pixelated User Agent Service', 'leap.soledad.common==0.5.2', 'leap.soledad.client==0.5.2', 'leap.mail==0.3.9-1-gc1f9c92', + 'nose', + 'mock', + 'httmock', ], ) diff --git a/service/test/adapter/mail_service_test.py b/service/test/adapter/mail_service_test.py index 5a085ef3..0c6538dc 100644 --- a/service/test/adapter/mail_service_test.py +++ b/service/test/adapter/mail_service_test.py @@ -1,9 +1,9 @@ import unittest -from app.adapter.mail_service import MailService +from pixelated.adapter.mail_service import MailService from mock import Mock, MagicMock, patch import test_helper -from app.tags import Tag +from pixelated.tags import Tag class TestMailService(unittest.TestCase): diff --git a/service/test/adapter/pixelated_mail_test.py b/service/test/adapter/pixelated_mail_test.py index 72ac06b4..923398ed 100644 --- a/service/test/adapter/pixelated_mail_test.py +++ b/service/test/adapter/pixelated_mail_test.py @@ -1,8 +1,8 @@ import unittest -from app.adapter.pixelated_mail import PixelatedMail -from app.tags import Tag -from app.tags import Tags +from pixelated.adapter.pixelated_mail import PixelatedMail +from pixelated.tags import Tag +from pixelated.tags import Tags import test_helper diff --git a/service/test/bitmask_libraries/leap_srp_test.py b/service/test/bitmask_libraries/leap_srp_test.py index b1c05c92..441d5b28 100644 --- a/service/test/bitmask_libraries/leap_srp_test.py +++ b/service/test/bitmask_libraries/leap_srp_test.py @@ -7,7 +7,7 @@ from httmock import urlmatch, all_requests, HTTMock, response from requests.exceptions import Timeout import srp -from app.bitmask_libraries.leap_srp import LeapSecureRemotePassword, LeapAuthException +from pixelated.bitmask_libraries.leap_srp import LeapSecureRemotePassword, LeapAuthException (salt_bytes, verification_key_bytes) = srp.create_salted_verification_key('username', 'password', hash_alg=srp.SHA256, ng_type=srp.NG_1024) verifier = None diff --git a/service/test/bitmask_libraries/nicknym_test.py b/service/test/bitmask_libraries/nicknym_test.py index 6e696e95..9fa5e628 100644 --- a/service/test/bitmask_libraries/nicknym_test.py +++ b/service/test/bitmask_libraries/nicknym_test.py @@ -1,12 +1,12 @@ from mock import patch from leap.keymanager import openpgp, KeyNotFound -from app.bitmask_libraries.nicknym import NickNym +from pixelated.bitmask_libraries.nicknym import NickNym from abstract_leap_test import AbstractLeapTest class NickNymTest(AbstractLeapTest): - @patch('app.bitmask_libraries.nicknym.KeyManager.__init__', return_value=None) + @patch('pixelated.bitmask_libraries.nicknym.KeyManager.__init__', return_value=None) def test_that_keymanager_is_created(self, init_mock): # given @@ -19,7 +19,7 @@ class NickNymTest(AbstractLeapTest): 'https://api.some-server.test:4430', '1', self.uuid, '/path/to/gpg') - @patch('app.bitmask_libraries.nicknym.KeyManager') + @patch('pixelated.bitmask_libraries.nicknym.KeyManager') def test_gen_key(self, keymanager_mock): # given keyman = keymanager_mock.return_value diff --git a/service/test/bitmask_libraries/provider_test.py b/service/test/bitmask_libraries/provider_test.py index 7aa37db9..67bdbfce 100644 --- a/service/test/bitmask_libraries/provider_test.py +++ b/service/test/bitmask_libraries/provider_test.py @@ -3,8 +3,8 @@ import json from httmock import all_requests, HTTMock, urlmatch from requests import HTTPError -from app.bitmask_libraries.config import LeapConfig -from app.bitmask_libraries.provider import LeapProvider +from pixelated.bitmask_libraries.config import LeapConfig +from pixelated.bitmask_libraries.provider import LeapProvider from abstract_leap_test import AbstractLeapTest diff --git a/service/test/bitmask_libraries/session_test.py b/service/test/bitmask_libraries/session_test.py index aa5f012d..58b48c52 100644 --- a/service/test/bitmask_libraries/session_test.py +++ b/service/test/bitmask_libraries/session_test.py @@ -1,6 +1,6 @@ from mock import patch -from app.bitmask_libraries.session import LeapSession +from pixelated.bitmask_libraries.session import LeapSession from abstract_leap_test import AbstractLeapTest @@ -8,7 +8,7 @@ class SessionTest(AbstractLeapTest): def test_background_jobs_are_started(self): self.config.start_background_jobs = True - with patch('app.bitmask_libraries.session.reactor.callFromThread', new=_execute_func) as _: + with patch('pixelated.bitmask_libraries.session.reactor.callFromThread', new=_execute_func) as _: self._create_session() self.mail_fetcher_mock.start_loop.assert_called_once_with() @@ -16,13 +16,13 @@ class SessionTest(AbstractLeapTest): def test_background_jobs_are_not_started(self): self.config.start_background_jobs = False - with patch('app.bitmask_libraries.session.reactor.callFromThread', new=_execute_func) as _: + with patch('pixelated.bitmask_libraries.session.reactor.callFromThread', new=_execute_func) as _: self._create_session() self.assertFalse(self.mail_fetcher_mock.start_loop.called) def test_that_close_stops_background_jobs(self): - with patch('app.bitmask_libraries.session.reactor.callFromThread', new=_execute_func) as _: + with patch('pixelated.bitmask_libraries.session.reactor.callFromThread', new=_execute_func) as _: session = self._create_session() session.close() diff --git a/service/test/bitmask_libraries/smtp_test.py b/service/test/bitmask_libraries/smtp_test.py index 4aa2d01d..84f7766e 100644 --- a/service/test/bitmask_libraries/smtp_test.py +++ b/service/test/bitmask_libraries/smtp_test.py @@ -1,7 +1,7 @@ import os from mock import MagicMock, patch from abstract_leap_test import AbstractLeapTest -from app.bitmask_libraries.smtp import LeapSmtp +from pixelated.bitmask_libraries.smtp import LeapSmtp from httmock import all_requests, HTTMock, urlmatch @@ -47,7 +47,7 @@ class LeapSmtpTest(AbstractLeapTest): def _client_cert_path(self): return os.path.join(self.leap_home, 'providers', 'some-server.test', 'keys', 'client', 'smtp.pem') - @patch('app.bitmask_libraries.smtp.setup_smtp_gateway') + @patch('pixelated.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 @@ -65,7 +65,7 @@ class LeapSmtpTest(AbstractLeapTest): with HTTMock(not_found_mock): smtp.stop() - @patch('app.bitmask_libraries.smtp.setup_smtp_gateway') + @patch('pixelated.bitmask_libraries.smtp.setup_smtp_gateway') def test_that_running_smtp_sevice_is_stopped(self, gateway_mock): smtp = LeapSmtp(self.provider, self.keymanager, self.srp_session) diff --git a/service/test/bitmask_libraries/soledad_test.py b/service/test/bitmask_libraries/soledad_test.py index 0d865291..8ebfb61c 100644 --- a/service/test/bitmask_libraries/soledad_test.py +++ b/service/test/bitmask_libraries/soledad_test.py @@ -1,9 +1,9 @@ from mock import patch -from app.bitmask_libraries.soledad import SoledadSession +from pixelated.bitmask_libraries.soledad import SoledadSession from abstract_leap_test import AbstractLeapTest -@patch('app.bitmask_libraries.soledad.Soledad') +@patch('pixelated.bitmask_libraries.soledad.Soledad') class SoledadSessionTest(AbstractLeapTest): def setUp(self): @@ -16,7 +16,7 @@ class SoledadSessionTest(AbstractLeapTest): } }} - @patch('app.bitmask_libraries.soledad.Soledad.__init__') + @patch('pixelated.bitmask_libraries.soledad.Soledad.__init__') def test_that_soledad_is_created_with_required_params(self, soledad_mock, init_mock): # when SoledadSession(self.provider, 'any-passphrase', self.srp_session) diff --git a/service/test/search/test_search_query.py b/service/test/search/test_search_query.py index 2b92cf0d..8053341a 100644 --- a/service/test/search/test_search_query.py +++ b/service/test/search/test_search_query.py @@ -1,7 +1,7 @@ import sys import os import unittest -import app.search_query as search_query +import pixelated.search_query as search_query class SearchTestCase(unittest.TestCase): diff --git a/service/test/test_tags.py b/service/test/test_tags.py index 52d2f069..280b77a3 100644 --- a/service/test/test_tags.py +++ b/service/test/test_tags.py @@ -1,5 +1,5 @@ import unittest -from app.tags import Tags, Tag +from pixelated.tags import Tags, Tag class TagTestCase(unittest.TestCase): |