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


Python YouTubeStorage.getStoredSearches方法代码示例

本文整理汇总了Python中YouTubeStorage.YouTubeStorage.getStoredSearches方法的典型用法代码示例。如果您正苦于以下问题:Python YouTubeStorage.getStoredSearches方法的具体用法?Python YouTubeStorage.getStoredSearches怎么用?Python YouTubeStorage.getStoredSearches使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在YouTubeStorage.YouTubeStorage的用法示例。


在下文中一共展示了YouTubeStorage.getStoredSearches方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。

示例1: test_getStoredSearches_should_call_retrieve_to_get_searches

# 需要导入模块: from YouTubeStorage import YouTubeStorage [as 别名]
# 或者: from YouTubeStorage.YouTubeStorage import getStoredSearches [as 别名]
    def test_getStoredSearches_should_call_retrieve_to_get_searches(self):
        storage = YouTubeStorage()
        storage.retrieveSettings = Mock()
        storage.retrieveSettings.return_value = ["some_search"]
        storage.storeSettings = Mock()

        storage.getStoredSearches({"path": "some_path"})

        assert storage.retrieveSettings.call_count > 0
开发者ID:aerickson,项目名称:youtube-xbmc-plugin,代码行数:11,代码来源:TestYouTubeStorage.py

示例2: test_getStoredSearches_should_call_retrieve_to_get_thumbnail_collection

# 需要导入模块: from YouTubeStorage import YouTubeStorage [as 别名]
# 或者: from YouTubeStorage.YouTubeStorage import getStoredSearches [as 别名]
    def test_getStoredSearches_should_call_retrieve_to_get_thumbnail_collection(self):
        storage = YouTubeStorage()
        storage.retrieveSettings = Mock()
        storage.retrieveSettings.return_value = ["some_search"]
        storage.storeSettings = Mock()

        storage.getStoredSearches({"path": "some_path"})

        assert storage.retrieveSettings.call_args[0][0] == {"path": "some_path"}
        assert storage.retrieveSettings.call_args[0][1] == "thumbnail"
        assert storage.retrieveSettings.call_args[0][2] == {
            "path": "some_path",
            "search": "some_search",
            "thumbnail": ["some_search"],
            "Title": "some_search",
        }
        assert storage.retrieveSettings.call_count == 2
开发者ID:aerickson,项目名称:youtube-xbmc-plugin,代码行数:19,代码来源:TestYouTubeStorage.py

示例3: YouTubeStorage

# 需要导入模块: from YouTubeStorage import YouTubeStorage [as 别名]
# 或者: from YouTubeStorage.YouTubeStorage import getStoredSearches [as 别名]
    def test_list_should_call_getStoredSearches_if_store_is_defined_in_params_but_not_artist_or_contact_option(self):
        storage = YouTubeStorage()
        storage.getStoredSearches = Mock()
        storage.getStoredSearches.return_value = ("", 200)

        storage.list({"store": "somestore"})

        storage.getStoredSearches.assert_called_with({"store": "somestore"})
开发者ID:aerickson,项目名称:youtube-xbmc-plugin,代码行数:10,代码来源:TestYouTubeStorage.py

示例4: test_getStoredSearches_should_return_proper_list_structure

# 需要导入模块: from YouTubeStorage import YouTubeStorage [as 别名]
# 或者: from YouTubeStorage.YouTubeStorage import getStoredSearches [as 别名]
    def test_getStoredSearches_should_return_proper_list_structure(self):
        storage = YouTubeStorage()
        storage.retrieveSettings = Mock()
        storage.retrieveSettings.return_value = ["some_search"]
        storage.storeSettings = Mock()

        (result, status) = storage.getStoredSearches({"path": "some_path"})

        print repr(result)
        assert result == [
            {"path": "some_path", "search": "some_search", "thumbnail": ["some_search"], "Title": "some_search"}
        ]
开发者ID:aerickson,项目名称:youtube-xbmc-plugin,代码行数:14,代码来源:TestYouTubeStorage.py

示例5: test_getStoredSearches_should_call_quote_plus_on_search_items

# 需要导入模块: from YouTubeStorage import YouTubeStorage [as 别名]
# 或者: from YouTubeStorage.YouTubeStorage import getStoredSearches [as 别名]
    def test_getStoredSearches_should_call_quote_plus_on_search_items(self):
        patcher = patch("urllib.quote_plus")
        patcher.start()
        import urllib

        urllib.quote_plus.return_value = "some_quoted_search"
        storage = YouTubeStorage()
        storage.retrieveSettings = Mock()
        storage.retrieveSettings.return_value = ["some_search"]
        storage.storeSettings = Mock()

        (result, status) = storage.getStoredSearches({"path": "some_path"})
        args = urllib.quote_plus.call_args
        patcher.stop()

        assert args[0][0] == "some_search"
        assert result == [
            {"path": "some_path", "search": "some_quoted_search", "thumbnail": ["some_search"], "Title": "some_search"}
        ]
开发者ID:aerickson,项目名称:youtube-xbmc-plugin,代码行数:21,代码来源:TestYouTubeStorage.py


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