本文整理汇总了Python中VimeoStorage.VimeoStorage.getStoredSearches方法的典型用法代码示例。如果您正苦于以下问题:Python VimeoStorage.getStoredSearches方法的具体用法?Python VimeoStorage.getStoredSearches怎么用?Python VimeoStorage.getStoredSearches使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类VimeoStorage.VimeoStorage
的用法示例。
在下文中一共展示了VimeoStorage.getStoredSearches方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: test_getStoredSearches_should_call_retrieve_to_get_searches
# 需要导入模块: from VimeoStorage import VimeoStorage [as 别名]
# 或者: from VimeoStorage.VimeoStorage import getStoredSearches [as 别名]
def test_getStoredSearches_should_call_retrieve_to_get_searches(self):
storage = VimeoStorage()
storage.retrieveSettings = Mock()
storage.retrieveSettings.return_value = ["some_search"]
storage.storeSettings = Mock()
storage.getStoredSearches({"path": "some_path"})
assert storage.retrieveSettings.call_count > 0
示例2: test_getStoredSearches_should_call_quote_plus_on_search_items
# 需要导入模块: from VimeoStorage import VimeoStorage [as 别名]
# 或者: from VimeoStorage.VimeoStorage 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 = VimeoStorage()
storage.retrieve = Mock()
storage.retrieve.return_value = ["some_search"]
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()
print repr(result)
assert args[0][0] == "some_search"
assert result == [
{
"path": "some_path",
"search": "some_quoted_search",
"api": "search",
"icon": "search",
"thumbnail": ["some_search"],
"Title": "some_search",
}
]
示例3: VimeoStorage
# 需要导入模块: from VimeoStorage import VimeoStorage [as 别名]
# 或者: from VimeoStorage.VimeoStorage import getStoredSearches [as 别名]
def test_list_should_call_getStoredSearches_if_store_is_defined_in_params_but_not_artist_or_contact_option(self):
storage = VimeoStorage()
storage.getStoredSearches = Mock()
storage.getStoredSearches.return_value = ("", 200)
storage.retrieveSettings = Mock()
storage.retrieveSettings.return_value = ["some_search"]
storage.list({"store": "somestore"})
storage.getStoredSearches.assert_called_with({"store": "somestore"})
示例4: test_getStoredSearches_should_call_retrieve_to_get_thumbnail
# 需要导入模块: from VimeoStorage import VimeoStorage [as 别名]
# 或者: from VimeoStorage.VimeoStorage import getStoredSearches [as 别名]
def test_getStoredSearches_should_call_retrieve_to_get_thumbnail(self):
storage = VimeoStorage()
storage.retrieveSettings = Mock()
storage.retrieve = Mock()
storage.retrieve.return_value = "thumbnail"
storage.retrieveSettings.return_value = ["some_search"]
storage.storeSettings = Mock()
storage.getStoredSearches({"path": "some_path"})
assert storage.retrieveSettings.call_args[0][0] == {"path": "some_path"}
storage.retrieve.assert_any_call(
{"path": "some_path"},
"thumbnail",
{
"path": "some_path",
"api": "search",
"icon": "search",
"search": "some_search",
"thumbnail": "thumbnail",
"Title": "some_search",
},
)
示例5: test_getStoredSearches_should_return_proper_list_structure
# 需要导入模块: from VimeoStorage import VimeoStorage [as 别名]
# 或者: from VimeoStorage.VimeoStorage import getStoredSearches [as 别名]
def test_getStoredSearches_should_return_proper_list_structure(self):
storage = VimeoStorage()
storage.retrieve = Mock()
storage.retrieve.return_value = "some_thumbnail"
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",
"api": "search",
"icon": "search",
"search": "some_search",
"thumbnail": "some_thumbnail",
"Title": "some_search",
}
]