本文整理汇总了Python中pixelated.adapter.mailstore.leap_mailstore.LeapMailStore.all_mails方法的典型用法代码示例。如果您正苦于以下问题:Python LeapMailStore.all_mails方法的具体用法?Python LeapMailStore.all_mails怎么用?Python LeapMailStore.all_mails使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类pixelated.adapter.mailstore.leap_mailstore.LeapMailStore
的用法示例。
在下文中一共展示了LeapMailStore.all_mails方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: test_all_mail_graceful_error_handling
# 需要导入模块: from pixelated.adapter.mailstore.leap_mailstore import LeapMailStore [as 别名]
# 或者: from pixelated.adapter.mailstore.leap_mailstore.LeapMailStore import all_mails [as 别名]
def test_all_mail_graceful_error_handling(self):
mail_id, fdoc_id = self._add_mail_fixture_to_soledad_from_file('mbox00000000')
when(self.soledad).get_from_index('by-type', 'meta').thenReturn(defer.succeed([self.doc_by_id[mail_id]]))
when(self.soledad).get_doc(self.doc_by_id[mail_id].content['cdocs'][0]).thenAnswer(lambda: defer.fail(Exception('fail loading attachment')))
store = LeapMailStore(self.soledad)
mails = yield store.all_mails(gracefully_ignore_errors=True)
self.assertEqual(0, len(mails))
示例2: test_all_mails
# 需要导入模块: from pixelated.adapter.mailstore.leap_mailstore import LeapMailStore [as 别名]
# 或者: from pixelated.adapter.mailstore.leap_mailstore.LeapMailStore import all_mails [as 别名]
def test_all_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')
when(self.soledad).get_from_index('by-type', 'meta').thenReturn(defer.succeed([self.doc_by_id[first_mdoc_id], self.doc_by_id[second_mdoc_id]]))
store = LeapMailStore(self.soledad)
mails = yield store.all_mails()
self.assertIsNotNone(mails)
self.assertEqual(2, len(mails))
self.assertEqual('Itaque consequatur repellendus provident sunt quia.', mails[0].subject)
self.assertEqual('Error illum dignissimos autem eos aspernatur.', mails[1].subject)