diff options
author | Bruno Wagner Goncalves <bwagner@thoughtworks.com> | 2014-08-13 14:27:00 -0300 |
---|---|---|
committer | Bruno Wagner Goncalves <bwagner@thoughtworks.com> | 2014-08-13 14:27:00 -0300 |
commit | e61fdb9721872614f8672b715dadb9cbd23a84ee (patch) | |
tree | 3b27d8fdc19469479500d35f21213d1492ff2791 /service/test/adapter | |
parent | 39b6faf7b1ce4a20cc43bdd4951997f8760f45b7 (diff) |
Pixelated mail class and test
Diffstat (limited to 'service/test/adapter')
-rw-r--r-- | service/test/adapter/pixelated_mail_test.py | 33 |
1 files changed, 33 insertions, 0 deletions
diff --git a/service/test/adapter/pixelated_mail_test.py b/service/test/adapter/pixelated_mail_test.py new file mode 100644 index 00000000..9193464b --- /dev/null +++ b/service/test/adapter/pixelated_mail_test.py @@ -0,0 +1,33 @@ +import unittest + +from app.adapter.pixelated_mail import PixelatedMail +from mock import Mock +from app.tags import Tag + + +class TestPixelatedMail(unittest.TestCase): + + LEAP_FLAGS = ['\\Seen', + '\\Answered', + '\\Flagged', + '\\Deleted', + '\\Draft', + '\\Recent', + 'List'] + + def setUp(self): + self.leap_mail = Mock(getUID=Mock(return_value=0), + getFlags=Mock(return_value=self.LEAP_FLAGS), + bdoc=Mock(content={'raw': 'test'}), + hdoc=Mock(content={'headers': {}})) + + def test_leap_flags_that_are_tags_are_handled(self): + pixelated_mail = PixelatedMail(self.leap_mail) + self.assertIn(Tag('inbox'), pixelated_mail.tags) + self.assertIn(Tag('trash'), pixelated_mail.tags) + self.assertIn(Tag('drafts'), pixelated_mail.tags) + + def test_leap_flags_that_are_status_are_handled(self): + pixelated_mail = PixelatedMail(self.leap_mail) + self.assertIn('read', pixelated_mail.status) + self.assertIn('replied', pixelated_mail.status) |