diff options
author | Folker Bernitt <fbernitt@thoughtworks.com> | 2015-08-05 17:49:00 +0200 |
---|---|---|
committer | Folker Bernitt <fbernitt@thoughtworks.com> | 2015-08-11 17:00:32 +0200 |
commit | f29447b4fbed2328f976fdfacd554f051e40b8db (patch) | |
tree | 8d55342670ebd692974ca61fc0b7b54ecab9b263 /service/test | |
parent | cc84a89c5c4b3d48b0ef8767c40fa34ef542bccf (diff) |
Reverted changes to get tests green.
Diffstat (limited to 'service/test')
-rw-r--r-- | service/test/unit/adapter/test_mailboxes.py | 16 |
1 files changed, 10 insertions, 6 deletions
diff --git a/service/test/unit/adapter/test_mailboxes.py b/service/test/unit/adapter/test_mailboxes.py index 4072893f..efd3df6b 100644 --- a/service/test/unit/adapter/test_mailboxes.py +++ b/service/test/unit/adapter/test_mailboxes.py @@ -13,12 +13,13 @@ # # 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 twisted.trial import unittest -from pixelated.adapter.mailstore.leap_mailstore import LeapMail +import unittest +from pixelated.adapter.model.mail import PixelatedMail from pixelated.adapter.services.mailboxes import Mailboxes from mockito import mock, when, verify from twisted.internet import defer +from test.support import test_helper from mock import MagicMock @@ -33,8 +34,11 @@ class PixelatedMailboxesTest(unittest.TestCase): @defer.inlineCallbacks def test_move_to_inbox(self): - when(self.mail_store).move_mail_to_mailbox(1, 'INBOX').thenReturn(defer.succeed(LeapMail('2', None, 'OTHER'))) + mail = PixelatedMail.from_soledad(*test_helper.leap_mail(), soledad_querier=self.querier) + when(self.querier).mail(1).thenReturn(mail) + when(mail).save().thenReturn(None) - moved_mail = yield self.mailboxes.move_to_inbox(1) - - self.assertEqual('2', moved_mail.mail_id) + mail.set_mailbox('TRASH') + recovered_mail = yield self.mailboxes.move_to_inbox(1) + self.assertEquals('INBOX', recovered_mail.mailbox_name) + verify(mail).save() |