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


Python YouTubeStorage.getVideoIdStatusFromCache方法代码示例

本文整理汇总了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
开发者ID:aerickson,项目名称:youtube-xbmc-plugin,代码行数:9,代码来源:TestYouTubeStorage.py

示例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"])
开发者ID:aerickson,项目名称:youtube-xbmc-plugin,代码行数:9,代码来源:TestYouTubeStorage.py

示例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"
开发者ID:aerickson,项目名称:youtube-xbmc-plugin,代码行数:9,代码来源:TestYouTubeStorage.py

示例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"
开发者ID:aerickson,项目名称:youtube-xbmc-plugin,代码行数:12,代码来源:TestYouTubeStorage.py


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