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


Python YouTubeStorage.deleteStoredSearch方法代码示例

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


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

示例1: test_deleteStoredSearch_should_call_executebuiltin

# 需要导入模块: from YouTubeStorage import YouTubeStorage [as 别名]
# 或者: from YouTubeStorage.YouTubeStorage import deleteStoredSearch [as 别名]
    def test_deleteStoredSearch_should_call_executebuiltin(self):
        storage = YouTubeStorage()
        storage.retrieve = Mock()
        storage.retrieve.return_value = ["some_search2"]
        storage.storeSettings = Mock()

        storage.deleteStoredSearch({"delete": "some_search2"})

        sys.modules["__main__"].xbmc.executebuiltin.assert_called_with("Container.Refresh")
开发者ID:aerickson,项目名称:youtube-xbmc-plugin,代码行数:11,代码来源:TestYouTubeStorage.py

示例2: test_deleteStoredSearch_should_remove_search_from_list_before_calling_store

# 需要导入模块: from YouTubeStorage import YouTubeStorage [as 别名]
# 或者: from YouTubeStorage.YouTubeStorage import deleteStoredSearch [as 别名]
    def test_deleteStoredSearch_should_remove_search_from_list_before_calling_store(self):
        storage = YouTubeStorage()
        storage.retrieve = Mock()
        storage.retrieve.return_value = ["some_search2"]
        storage.storeSettings = Mock()

        storage.deleteStoredSearch({"delete": "some_search2"})

        storage.storeSettings.assert_called_with({"delete": "some_search2"}, [])
开发者ID:aerickson,项目名称:youtube-xbmc-plugin,代码行数:11,代码来源:TestYouTubeStorage.py

示例3: test_deleteStoredSearch_should_call_retrieve_to_get_searches

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

        storage.deleteStoredSearch({"delete": "some_search2"})

        storage.retrieveSettings.assert_called_with({"delete": "some_search2"})
        assert storage.retrieveSettings.call_count == 1
开发者ID:aerickson,项目名称:youtube-xbmc-plugin,代码行数:12,代码来源:TestYouTubeStorage.py

示例4: test_deleteStoredSearch_should_call_unquote_on_delete_param

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

        urllib.unquote_plus.return_value = "some_unquoted_search"
        storage = YouTubeStorage()
        storage.retrieve = Mock()
        storage.retrieve.return_value = ["some_search1"]
        storage.storeSettings = Mock()

        storage.deleteStoredSearch({"delete": "some_search2"})
        args = urllib.unquote_plus.call_args
        patcher.stop()

        assert args[0][0] == "some_search2"
开发者ID:aerickson,项目名称:youtube-xbmc-plugin,代码行数:18,代码来源:TestYouTubeStorage.py


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