本文整理汇总了Python中pixelated.adapter.mailstore.leap_mailstore.LeapMailStore.get_mail方法的典型用法代码示例。如果您正苦于以下问题:Python LeapMailStore.get_mail方法的具体用法?Python LeapMailStore.get_mail怎么用?Python LeapMailStore.get_mail使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类pixelated.adapter.mailstore.leap_mailstore.LeapMailStore
的用法示例。
在下文中一共展示了LeapMailStore.get_mail方法的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: test_get_two_different_mails
# 需要导入模块: from pixelated.adapter.mailstore.leap_mailstore import LeapMailStore [as 别名]
# 或者: from pixelated.adapter.mailstore.leap_mailstore.LeapMailStore import get_mail [as 别名]
def test_get_two_different_mails(self):
first_mdoc_id, _ = self._add_mail_fixture_to_soledad_from_file('mbox00000000')
second_mdoc_id, _ = self._add_mail_fixture_to_soledad_from_file('mbox00000001')
store = LeapMailStore(self.soledad)
mail1 = yield store.get_mail(first_mdoc_id)
mail2 = yield store.get_mail(second_mdoc_id)
self.assertNotEqual(mail1, mail2)
self.assertEqual('Itaque consequatur repellendus provident sunt quia.', mail1.subject)
self.assertEqual('Error illum dignissimos autem eos aspernatur.', mail2.subject)
示例2: test_get_mail_not_exist
# 需要导入模块: from pixelated.adapter.mailstore.leap_mailstore import LeapMailStore [as 别名]
# 或者: from pixelated.adapter.mailstore.leap_mailstore.LeapMailStore import get_mail [as 别名]
def test_get_mail_not_exist(self):
when(self.soledad).get_doc(ANY()).thenAnswer(lambda: defer.succeed(None))
store = LeapMailStore(self.soledad)
mail = yield store.get_mail(_format_mdoc_id(uuid4(), 1))
self.assertIsNone(mail)
示例3: test_get_mail_not_exist
# 需要导入模块: from pixelated.adapter.mailstore.leap_mailstore import LeapMailStore [as 别名]
# 或者: from pixelated.adapter.mailstore.leap_mailstore.LeapMailStore import get_mail [as 别名]
def test_get_mail_not_exist(self):
with patch('mockito.invocation.AnswerSelector', AnswerSelector):
when(self.soledad).get_doc(ANY()).thenAnswer(lambda: defer.succeed(None))
store = LeapMailStore(self.soledad)
mail = yield store.get_mail(_format_mdoc_id(uuid4(), 1))
self.assertIsNone(mail)
示例4: test_get_mail_from_mailbox
# 需要导入模块: from pixelated.adapter.mailstore.leap_mailstore import LeapMailStore [as 别名]
# 或者: from pixelated.adapter.mailstore.leap_mailstore.LeapMailStore import get_mail [as 别名]
def test_get_mail_from_mailbox(self):
other, _ = self._mock_get_mailbox('OTHER', create_new_uuid=True)
mdoc_id, _ = self._add_mail_fixture_to_soledad_from_file('mbox00000000', other.uuid)
store = LeapMailStore(self.soledad)
mail = yield store.get_mail(mdoc_id)
self.assertEqual('OTHER', mail.mailbox_name)
示例5: test_get_mail_with_body
# 需要导入模块: from pixelated.adapter.mailstore.leap_mailstore import LeapMailStore [as 别名]
# 或者: from pixelated.adapter.mailstore.leap_mailstore.LeapMailStore import get_mail [as 别名]
def test_get_mail_with_body(self):
expeted_body = 'Dignissimos ducimus veritatis. Est tenetur consequatur quia occaecati. Vel sit sit voluptas.\n\nEarum distinctio eos. Accusantium qui sint ut quia assumenda. Facere dignissimos inventore autem sit amet. Pariatur voluptatem sint est.\n\nUt recusandae praesentium aspernatur. Exercitationem amet placeat deserunt quae consequatur eum. Unde doloremque suscipit quia.\n\n'
mdoc_id, _ = self._add_mail_fixture_to_soledad_from_file('mbox00000000')
store = LeapMailStore(self.soledad)
mail = yield store.get_mail(mdoc_id, include_body=True)
self.assertEqual(expeted_body, mail.body)
示例6: test_get_mail
# 需要导入模块: from pixelated.adapter.mailstore.leap_mailstore import LeapMailStore [as 别名]
# 或者: from pixelated.adapter.mailstore.leap_mailstore.LeapMailStore import get_mail [as 别名]
def test_get_mail(self):
mdoc_id, _ = self._add_mail_fixture_to_soledad_from_file('mbox00000000')
store = LeapMailStore(self.soledad)
mail = yield store.get_mail(mdoc_id)
self.assertIsInstance(mail, LeapMail)
self.assertEqual('[email protected]', mail.from_sender)
self.assertEqual(['[email protected]'], mail.to)
self.assertEqual('Itaque consequatur repellendus provident sunt quia.', mail.subject)
self.assertIsNone(mail.body)
self.assertEqual('INBOX', mail.mailbox_name)
示例7: test_update_mail
# 需要导入模块: from pixelated.adapter.mailstore.leap_mailstore import LeapMailStore [as 别名]
# 或者: from pixelated.adapter.mailstore.leap_mailstore.LeapMailStore import get_mail [as 别名]
def test_update_mail(self):
mdoc_id, fdoc_id = self._add_mail_fixture_to_soledad_from_file('mbox00000000')
soledad_fdoc = self.doc_by_id[fdoc_id]
when(self.soledad).put_doc(soledad_fdoc).thenReturn(defer.succeed(None))
store = LeapMailStore(self.soledad)
mail = yield store.get_mail(mdoc_id)
mail.tags.add('new_tag')
yield store.update_mail(mail)
verify(self.soledad).put_doc(soledad_fdoc)
self.assertTrue('new_tag' in soledad_fdoc.content['tags'])