本文整理汇总了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")
示例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"}, [])
示例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
示例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"