本文整理汇总了Python中YouTubeStorage.YouTubeStorage.getVideoIdStatusFromCache方法的典型用法代码示例。如果您正苦于以下问题:Python YouTubeStorage.getVideoIdStatusFromCache方法的具体用法?Python YouTubeStorage.getVideoIdStatusFromCache怎么用?Python YouTubeStorage.getVideoIdStatusFromCache使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类YouTubeStorage.YouTubeStorage
的用法示例。
在下文中一共展示了YouTubeStorage.getVideoIdStatusFromCache方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: test_getVideoIdStatusFromCache_should_call_cache_GetMulti_to_request_information
# 需要导入模块: from YouTubeStorage import YouTubeStorage [as 别名]
# 或者: from YouTubeStorage.YouTubeStorage import getVideoIdStatusFromCache [as 别名]
def test_getVideoIdStatusFromCache_should_call_cache_GetMulti_to_request_information(self):
storage = YouTubeStorage()
sys.modules["__main__"].cache.getMulti.return_value = ["2"]
storage.getVideoIdStatusFromCache("some_id", [{"videoid": "vid1"}, {"other_id": "stuff"}])
assert sys.modules["__main__"].cache.getMulti.call_count == 1
示例2: test_getVideoIdStatusFromCache_should_not_request_information_for_items_without_a_videoid
# 需要导入模块: from YouTubeStorage import YouTubeStorage [as 别名]
# 或者: from YouTubeStorage.YouTubeStorage import getVideoIdStatusFromCache [as 别名]
def test_getVideoIdStatusFromCache_should_not_request_information_for_items_without_a_videoid(self):
storage = YouTubeStorage()
sys.modules["__main__"].cache.getMulti.return_value = ["2"]
storage.getVideoIdStatusFromCache("some_id", [{"videoid": "vid1"}, {"other_id": "stuff"}])
sys.modules["__main__"].cache.getMulti.assert_any_call("some_id", ["vid1"])
示例3: test_getVideoIdStatusFromCache_should_set_overlay_information_on_requested
# 需要导入模块: from YouTubeStorage import YouTubeStorage [as 别名]
# 或者: from YouTubeStorage.YouTubeStorage import getVideoIdStatusFromCache [as 别名]
def test_getVideoIdStatusFromCache_should_set_overlay_information_on_requested(self):
storage = YouTubeStorage()
sys.modules["__main__"].cache.getMulti.return_value = ["2"]
result = storage.getVideoIdStatusFromCache("some_id", [{"videoid": "vid1", "Overlay": "1"}])
assert result[0]["Overlay"] == "2"
示例4: test_getVideoIdStatusFromCache_should_result_sets_with_missing_items
# 需要导入模块: from YouTubeStorage import YouTubeStorage [as 别名]
# 或者: from YouTubeStorage.YouTubeStorage import getVideoIdStatusFromCache [as 别名]
def test_getVideoIdStatusFromCache_should_result_sets_with_missing_items(self):
storage = YouTubeStorage()
sys.modules["__main__"].cache.getMulti.return_value = ["2"]
result = storage.getVideoIdStatusFromCache(
"some_id", [{"videoid": "vid1", "Overlay": "1"}, {"videoid": "vid2", "Overlay": "1"}]
)
assert result[0]["Overlay"] == "2"
assert result[1]["Overlay"] == "1"