本文整理汇总了Python中inbox.mailsync.backends.imap.generic.FolderSyncEngine.last_slow_refresh方法的典型用法代码示例。如果您正苦于以下问题:Python FolderSyncEngine.last_slow_refresh方法的具体用法?Python FolderSyncEngine.last_slow_refresh怎么用?Python FolderSyncEngine.last_slow_refresh使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类inbox.mailsync.backends.imap.generic.FolderSyncEngine
的用法示例。
在下文中一共展示了FolderSyncEngine.last_slow_refresh方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: test_generic_flags_refresh_expunges_transient_uids
# 需要导入模块: from inbox.mailsync.backends.imap.generic import FolderSyncEngine [as 别名]
# 或者: from inbox.mailsync.backends.imap.generic.FolderSyncEngine import last_slow_refresh [as 别名]
def test_generic_flags_refresh_expunges_transient_uids(
db, generic_account, inbox_folder, mock_imapclient, monkeypatch):
# Check that we delete UIDs which are synced but quickly deleted, so never
# show up in flags refresh.
uid_dict = uids.example()
mock_imapclient.add_folder_data(inbox_folder.name, uid_dict)
inbox_folder.imapfolderinfo = ImapFolderInfo(account=generic_account,
uidvalidity=1,
uidnext=1)
db.session.commit()
folder_sync_engine = FolderSyncEngine(generic_account.id,
generic_account.namespace.id,
inbox_folder.name,
generic_account.email_address,
'custom',
BoundedSemaphore(1))
folder_sync_engine.initial_sync()
folder_sync_engine.poll_impl()
msg = db.session.query(Message).filter_by(
namespace_id=generic_account.namespace.id).first()
transient_uid = ImapUid(folder=inbox_folder, account=generic_account,
message=msg, msg_uid=max(uid_dict) + 1)
db.session.add(transient_uid)
db.session.commit()
folder_sync_engine.last_slow_refresh = None
folder_sync_engine.poll_impl()
with pytest.raises(ObjectDeletedError):
transient_uid.id