本文整理汇总了Python中vdirsyncer.storage.memory.MemoryStorage.items["lol"]方法的典型用法代码示例。如果您正苦于以下问题:Python MemoryStorage.items["lol"]方法的具体用法?Python MemoryStorage.items["lol"]怎么用?Python MemoryStorage.items["lol"]使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类vdirsyncer.storage.memory.MemoryStorage
的用法示例。
在下文中一共展示了MemoryStorage.items["lol"]方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: test_moved_href
# 需要导入模块: from vdirsyncer.storage.memory import MemoryStorage [as 别名]
# 或者: from vdirsyncer.storage.memory.MemoryStorage import items["lol"] [as 别名]
def test_moved_href():
"""
Concrete application: ppl_ stores contact aliases in filenames, which means
item's hrefs get changed. Vdirsyncer doesn't synchronize this data, but
also shouldn't do things like deleting and re-uploading to the server.
.. _ppl: http://ppladdressbook.org/
"""
a = MemoryStorage()
b = MemoryStorage()
status = {}
href, etag = a.upload(Item(u"UID:haha"))
sync(a, b, status)
b.items["lol"] = b.items.pop("haha")
a.delete = a.update = a.upload = blow_up
sync(a, b, status)
assert len(status) == 1
assert len(list(a.list())) == len(list(b.list())) == 1
assert status["haha"][1]["href"] == "haha"