summaryrefslogtreecommitdiff
path: root/service/test/unit/adapter/test_mailbox.py
diff options
context:
space:
mode:
Diffstat (limited to 'service/test/unit/adapter/test_mailbox.py')
-rw-r--r--service/test/unit/adapter/test_mailbox.py9
1 files changed, 7 insertions, 2 deletions
diff --git a/service/test/unit/adapter/test_mailbox.py b/service/test/unit/adapter/test_mailbox.py
index b44f507b..ed634648 100644
--- a/service/test/unit/adapter/test_mailbox.py
+++ b/service/test/unit/adapter/test_mailbox.py
@@ -17,13 +17,12 @@ import unittest
from pixelated.adapter.model.mail import PixelatedMail
from pixelated.adapter.services.mailbox import Mailbox
-from mockito import *
+from mockito import mock, when, verify
from test.support import test_helper
class PixelatedMailboxTest(unittest.TestCase):
def setUp(self):
- self.tag_service = mock()
self.querier = mock()
self.search_engine = mock()
self.mailbox = Mailbox('INBOX', self.querier, self.search_engine)
@@ -35,3 +34,9 @@ class PixelatedMailboxTest(unittest.TestCase):
self.mailbox.remove(1)
verify(self.querier).remove_mail(mail)
+
+ def test_fresh_mailbox_checking_lastuid(self):
+ when(self.querier).get_lastuid('INBOX').thenReturn(0)
+ self.assertTrue(self.mailbox.fresh)
+ when(self.querier).get_lastuid('INBOX').thenReturn(1)
+ self.assertFalse(self.mailbox.fresh)