当前位置: 首页>>代码示例>>Python>>正文


Python FolderSyncEngine.highestmodseq方法代码示例

本文整理汇总了Python中inbox.mailsync.backends.imap.generic.FolderSyncEngine.highestmodseq方法的典型用法代码示例。如果您正苦于以下问题:Python FolderSyncEngine.highestmodseq方法的具体用法?Python FolderSyncEngine.highestmodseq怎么用?Python FolderSyncEngine.highestmodseq使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在inbox.mailsync.backends.imap.generic.FolderSyncEngine的用法示例。


在下文中一共展示了FolderSyncEngine.highestmodseq方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。

示例1: test_condstore_flags_refresh

# 需要导入模块: from inbox.mailsync.backends.imap.generic import FolderSyncEngine [as 别名]
# 或者: from inbox.mailsync.backends.imap.generic.FolderSyncEngine import highestmodseq [as 别名]
def test_condstore_flags_refresh(db, default_account, all_mail_folder,
                                 mock_imapclient, monkeypatch):
    monkeypatch.setattr(
        'inbox.mailsync.backends.imap.generic.CONDSTORE_FLAGS_REFRESH_BATCH_SIZE',
        10)
    uid_dict = uids.example()
    mock_imapclient.add_folder_data(all_mail_folder.name, uid_dict)
    mock_imapclient.capabilities = lambda: ['CONDSTORE']

    folder_sync_engine = FolderSyncEngine(default_account.id,
                                          default_account.namespace.id,
                                          all_mail_folder.name,
                                          default_account.email_address,
                                          'gmail',
                                          BoundedSemaphore(1))
    folder_sync_engine.initial_sync()

    # Change the labels provided by the mock IMAP server
    for k, v in mock_imapclient._data[all_mail_folder.name].items():
        v['X-GM-LABELS'] = ('newlabel',)
        v['MODSEQ'] = (k,)

    folder_sync_engine.highestmodseq = 0
    folder_sync_engine.poll_impl()
    imapuids = db.session.query(ImapUid). \
        filter_by(folder_id=all_mail_folder.id).all()
    for imapuid in imapuids:
        assert 'newlabel' in [l.name for l in imapuid.labels]

    assert folder_sync_engine.highestmodseq == mock_imapclient.folder_status(
        all_mail_folder.name, ['HIGHESTMODSEQ'])['HIGHESTMODSEQ']
开发者ID:GordonYip,项目名称:sync-engine,代码行数:33,代码来源:test_folder_sync.py


注:本文中的inbox.mailsync.backends.imap.generic.FolderSyncEngine.highestmodseq方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。