diff options
author | Bruno Wagner <bwagner@riseup.net> | 2016-10-18 20:08:39 -0200 |
---|---|---|
committer | Bruno Wagner <bwagner@riseup.net> | 2016-10-18 20:08:39 -0200 |
commit | 75b633a173f217ccd508cf6b5306a3e93f79c2e6 (patch) | |
tree | e60df5221e5ab15264571bf52233c385a142b49a /service/test/unit | |
parent | 9356d5c3d4e940e5d4ebf1c851a16b43374a6bc3 (diff) |
Adapted imports to reflect new bitmask-dev dependency
Diffstat (limited to 'service/test/unit')
7 files changed, 16 insertions, 20 deletions
diff --git a/service/test/unit/adapter/mailstore/maintenance/test_soledad_maintenance.py b/service/test/unit/adapter/mailstore/maintenance/test_soledad_maintenance.py index be73af93..2aaa969c 100644 --- a/service/test/unit/adapter/mailstore/maintenance/test_soledad_maintenance.py +++ b/service/test/unit/adapter/mailstore/maintenance/test_soledad_maintenance.py @@ -19,7 +19,7 @@ from twisted.internet import defer from twisted.trial import unittest from mockito import mock, when, verify, never from pixelated.adapter.mailstore.maintenance import SoledadMaintenance -from leap.keymanager.openpgp import OpenPGPKey +from leap.bitmask.keymanager.openpgp import OpenPGPKey import logging logging.getLogger('pixelated.adapter.mailstore.maintenance').addHandler(logging.NullHandler()) diff --git a/service/test/unit/adapter/mailstore/test_leap_attachment_store.py b/service/test/unit/adapter/mailstore/test_leap_attachment_store.py index f442b687..2d3daaaa 100644 --- a/service/test/unit/adapter/mailstore/test_leap_attachment_store.py +++ b/service/test/unit/adapter/mailstore/test_leap_attachment_store.py @@ -16,15 +16,15 @@ # along with Pixelated. If not, see <http://www.gnu.org/licenses/>. import json from uuid import uuid4 -import u1db -from leap.mail.adaptors.soledad_indexes import MAIL_INDEXES +from leap.soledad.common import l2db +from leap.bitmask.mail.adaptors.soledad_indexes import MAIL_INDEXES from leap.soledad.common.document import SoledadDocument from mock import patch from mockito import mock, when, verify from twisted.internet import defer from twisted.trial.unittest import TestCase -from leap.mail.adaptors.soledad import SoledadMailAdaptor, MailboxWrapper, ContentDocWrapper +from leap.bitmask.mail.adaptors.soledad import SoledadMailAdaptor, MailboxWrapper, ContentDocWrapper from pixelated.adapter.mailstore.leap_attachment_store import LeapAttachmentStore from test.support.mockito import AnswerSelector @@ -84,7 +84,7 @@ class TestLeapAttachmentStore(TestCase): store = LeapAttachmentStore(self.soledad) - when(self.soledad).create_doc(cdoc_serialized, doc_id=attachment_id).thenRaise(u1db.errors.RevisionConflict()) + when(self.soledad).create_doc(cdoc_serialized, doc_id=attachment_id).thenRaise(l2db.errors.RevisionConflict()) actual_attachment_id = yield store.add_attachment(content, content_type) diff --git a/service/test/unit/adapter/mailstore/test_leap_mailstore.py b/service/test/unit/adapter/mailstore/test_leap_mailstore.py index 62c8ac7a..5e897dd7 100644 --- a/service/test/unit/adapter/mailstore/test_leap_mailstore.py +++ b/service/test/unit/adapter/mailstore/test_leap_mailstore.py @@ -25,16 +25,16 @@ from uuid import uuid4 from email.parser import Parser import os from leap.soledad.common.document import SoledadDocument -from leap.mail.adaptors.soledad_indexes import MAIL_INDEXES +from leap.bitmask.mail.adaptors.soledad_indexes import MAIL_INDEXES from twisted.internet.defer import FirstError from twisted.trial.unittest import TestCase -from leap.mail import constants +from leap.bitmask.mail import constants from twisted.internet import defer from mock import patch from mockito import mock, when, verify, any as ANY -from leap.mail.adaptors.soledad import SoledadMailAdaptor, MailboxWrapper, ContentDocWrapper +from leap.bitmask.mail.adaptors.soledad import SoledadMailAdaptor, MailboxWrapper, ContentDocWrapper import pkg_resources -from leap.mail.mail import Message +from leap.bitmask.mail.mail import Message from pixelated.adapter.mailstore import underscore_uuid from pixelated.adapter.mailstore.leap_mailstore import LeapMailStore, LeapMail @@ -242,7 +242,7 @@ class TestLeapMailStore(TestCase): message = yield store.add_mail('INBOX', input_mail.as_string()) - expected = [{'ident': self._cdoc_phash_from_message(mocked_message, 2), 'name': 'filename.txt', 'encoding': 'base64', 'size': 197, 'content-type': 'application/octet-stream'}] + expected = [{'ident': self._cdoc_phash_from_message(mocked_message, 2), 'name': 'filename.txt', 'encoding': 'base64', 'size': 48, 'content-type': 'application/octet-stream'}] self.assertEqual(expected, message.as_dict()['attachments']) @defer.inlineCallbacks @@ -257,7 +257,7 @@ class TestLeapMailStore(TestCase): message = yield store.add_mail('INBOX', input_mail.as_string()) - expected = [{'ident': self._cdoc_phash_from_message(mocked_message, 2), 'name': 'super_nice_photo.jpg', 'encoding': 'base64', 'size': 202, 'content-type': 'application/octet-stream'}] + expected = [{'ident': self._cdoc_phash_from_message(mocked_message, 2), 'name': 'super_nice_photo.jpg', 'encoding': 'base64', 'size': 48, 'content-type': 'application/octet-stream'}] self.assertEqual(expected, message.as_dict()['attachments']) @defer.inlineCallbacks @@ -274,7 +274,7 @@ class TestLeapMailStore(TestCase): message = yield store.add_mail('INBOX', input_mail.as_string()) - expected = [{'ident': self._cdoc_phash_from_message(mocked_message, 2), 'name': 'filename.txt', 'encoding': 'base64', 'size': 197, 'content-type': 'application/octet-stream'}] + expected = [{'ident': self._cdoc_phash_from_message(mocked_message, 2), 'name': 'filename.txt', 'encoding': 'base64', 'size': 48, 'content-type': 'application/octet-stream'}] self.assertEqual(expected, message.as_dict()['attachments']) def test_extract_attachment_filename_with_or_without_quotes(self): diff --git a/service/test/unit/adapter/services/test_mail_sender.py b/service/test/unit/adapter/services/test_mail_sender.py index 863ac81a..4daa7f24 100644 --- a/service/test/unit/adapter/services/test_mail_sender.py +++ b/service/test/unit/adapter/services/test_mail_sender.py @@ -13,7 +13,7 @@ # # You should have received a copy of the GNU Affero General Public License # along with Pixelated. If not, see <http://www.gnu.org/licenses/>. -from leap.mail.outgoing.service import OutgoingMail +from leap.bitmask.mail.outgoing.service import OutgoingMail from twisted.mail.smtp import User from twisted.trial import unittest diff --git a/service/test/unit/resources/test_keys_resources.py b/service/test/unit/resources/test_keys_resources.py index a7c885ca..17297206 100644 --- a/service/test/unit/resources/test_keys_resources.py +++ b/service/test/unit/resources/test_keys_resources.py @@ -1,8 +1,8 @@ import json import ast from mockito import mock, when, any as ANY -from leap.keymanager import KeyNotFound -from leap.keymanager.keys import OpenPGPKey +from leap.bitmask.keymanager import KeyNotFound +from leap.bitmask.keymanager.keys import OpenPGPKey from pixelated.application import UserAgentMode from pixelated.config.services import ServicesFactory diff --git a/service/test/unit/resources/test_logout_resources.py b/service/test/unit/resources/test_logout_resources.py index 845fcde9..33c8537f 100644 --- a/service/test/unit/resources/test_logout_resources.py +++ b/service/test/unit/resources/test_logout_resources.py @@ -1,5 +1,3 @@ -import logging - from mock import patch, MagicMock from twisted.internet import defer from twisted.trial import unittest @@ -9,8 +7,6 @@ from twisted.web.test.requesthelper import DummyRequest from pixelated.resources.logout_resource import LogoutResource from test.unit.resources import DummySite -logging.getLogger('pixelated.resources').addHandler(logging.NullHandler()) - class TestLogoutResource(unittest.TestCase): def setUp(self): diff --git a/service/test/unit/resources/test_user_settings_resource.py b/service/test/unit/resources/test_user_settings_resource.py index a33ad571..30a3c4cd 100644 --- a/service/test/unit/resources/test_user_settings_resource.py +++ b/service/test/unit/resources/test_user_settings_resource.py @@ -7,7 +7,7 @@ from pixelated.resources.user_settings_resource import UserSettingsResource, FIN from mockito import mock, when, any from test.unit.resources import DummySite from twisted.web.test.requesthelper import DummyRequest -from leap.keymanager.keys import OpenPGPKey +from leap.bitmask.keymanager.keys import OpenPGPKey from twisted.internet import defer from twisted.python.failure import Failure |