本文整理汇总了Python中miro.item.Item.set_downloader方法的典型用法代码示例。如果您正苦于以下问题:Python Item.set_downloader方法的具体用法?Python Item.set_downloader怎么用?Python Item.set_downloader使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类miro.item.Item
的用法示例。
在下文中一共展示了Item.set_downloader方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: test_remove_before_downloader_referenced
# 需要导入模块: from miro.item import Item [as 别名]
# 或者: from miro.item.Item import set_downloader [as 别名]
def test_remove_before_downloader_referenced(self):
# when items are restored from the DB, the downloader
# attribute is loaded lazily. Make sure that if we remove the
# item, the downloader is still removed.
feed = Feed(u"http://example.com/1")
item = Item(fp_values_for_url(u"http://example.com/1/item1"), feed_id=feed.id)
item.set_downloader(RemoteDownloader(u"http://example.com/1/item1/movie.mpeg", item))
downloader = item.downloader
feed = self.reload_object(feed)
downloader = self.reload_object(downloader)
item = self.reload_object(item)
item.remove()
self.assert_(not downloader.id_exists())
示例2: make_regular_item
# 需要导入模块: from miro.item import Item [as 别名]
# 或者: from miro.item.Item import set_downloader [as 别名]
def make_regular_item(self, feed):
url = u'http://example.com/1/item1'
item = Item(fp_values_for_url(url), feed_id=feed.id)
item.set_downloader(RemoteDownloader(url, item))
return item