本文整理汇总了Python中YouTubeFeeds.YouTubeFeeds.listFolder方法的典型用法代码示例。如果您正苦于以下问题:Python YouTubeFeeds.listFolder方法的具体用法?Python YouTubeFeeds.listFolder怎么用?Python YouTubeFeeds.listFolder使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类YouTubeFeeds.YouTubeFeeds
的用法示例。
在下文中一共展示了YouTubeFeeds.listFolder方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: test_listFolder_should_call_getSetting_to_get_perpage
# 需要导入模块: from YouTubeFeeds import YouTubeFeeds [as 别名]
# 或者: from YouTubeFeeds.YouTubeFeeds import listFolder [as 别名]
def test_listFolder_should_call_getSetting_to_get_perpage(self):
feeds = YouTubeFeeds()
feeds.listAll = Mock()
feeds.listAll.return_value = []
feeds.createUrl = Mock()
feeds.createUrl.return_value = "some_url"
feeds.listFolder()
sys.modules["__main__"].pluginsettings.itemsPerPage.assert_any_call()
示例2: test_listFolder_should_call_storage_retrieve_to_fetch_cached_video_listing_if_page_is_in_params
# 需要导入模块: from YouTubeFeeds import YouTubeFeeds [as 别名]
# 或者: from YouTubeFeeds.YouTubeFeeds import listFolder [as 别名]
def test_listFolder_should_call_storage_retrieve_to_fetch_cached_video_listing_if_page_is_in_params(self):
sys.modules["__main__"].pluginsettings.itemsPerPage.return_value = 15
sys.modules["__main__"].storage.retrieve.return_value = []
feeds = YouTubeFeeds()
feeds.listAll = Mock()
feeds.listAll.return_value = []
feeds.createUrl = Mock()
feeds.createUrl.return_value = "some_url"
feeds.listFolder({"page": "1"})
sys.modules["__main__"].storage.retrieve.assert_called_with({"page": "1"})
示例3: test_listFolder_should_call_listAll_page_is_not_in_params
# 需要导入模块: from YouTubeFeeds import YouTubeFeeds [as 别名]
# 或者: from YouTubeFeeds.YouTubeFeeds import listFolder [as 别名]
def test_listFolder_should_call_listAll_page_is_not_in_params(self):
sys.modules["__main__"].pluginsettings.itemsPerPage.return_value = 15
sys.modules["__main__"].storage.retrieve.return_value = []
feeds = YouTubeFeeds()
feeds.listAll = Mock()
feeds.listAll.return_value = []
feeds.createUrl = Mock()
feeds.createUrl.return_value = "some_url"
feeds.listFolder()
feeds.listAll.assert_called_with({})
示例4: test_listFolder_should_call_storage_store_to_save_new_list
# 需要导入模块: from YouTubeFeeds import YouTubeFeeds [as 别名]
# 或者: from YouTubeFeeds.YouTubeFeeds import listFolder [as 别名]
def test_listFolder_should_call_storage_store_to_save_new_list(self):
sys.modules["__main__"].pluginsettings.itemsPerPage.return_value = 15
sys.modules["__main__"].storage.retrieve.return_value = []
feeds = YouTubeFeeds()
feeds.listAll = Mock()
feeds.listAll.return_value = ["some"]
feeds.createUrl = Mock()
feeds.createUrl.return_value = "some_url"
feeds.listFolder()
sys.modules["__main__"].storage.store.assert_called_with({}, ["some"])
示例5: test_listFolder_should_call_addNextFolder_for_lists_longer_than_perpage
# 需要导入模块: from YouTubeFeeds import YouTubeFeeds [as 别名]
# 或者: from YouTubeFeeds.YouTubeFeeds import listFolder [as 别名]
def test_listFolder_should_call_addNextFolder_for_lists_longer_than_perpage(self):
sys.modules["__main__"].pluginsettings.itemsPerPage.return_value = 15
sys.modules["__main__"].storage.retrieve.return_value = []
ids = []
i= 1
while i < 52:
ids.append({"Title": "title_" + str(i), "thumbnail": "some_thumb_" + str(i), "id": "some_id_" + str(i)})
i += 1
feeds = YouTubeFeeds()
feeds.listAll = Mock()
feeds.listAll.return_value = ids
feeds.createUrl = Mock()
feeds.createUrl.return_value = "some_url"
feeds.listFolder()
sys.modules["__main__"].utils.addNextFolder.assert_called_with(ids[:15], {})
示例6: test_list_should_call_listFolder_if_folder_is_in_params
# 需要导入模块: from YouTubeFeeds import YouTubeFeeds [as 别名]
# 或者: from YouTubeFeeds.YouTubeFeeds import listFolder [as 别名]
def test_list_should_call_listFolder_if_folder_is_in_params(self):
sys.modules["__main__"].pluginsettings.itemsPerPage.return_value = 15
feeds = YouTubeFeeds()
feeds.listFolder = Mock()
result = feeds.list({"folder": "true"})
print repr(result)
feeds.listFolder.assert_called_with({"folder": "true"})
示例7: test_listFolder_should_set_correct_view_mode_if_feed_is_subscriptions
# 需要导入模块: from YouTubeFeeds import YouTubeFeeds [as 别名]
# 或者: from YouTubeFeeds.YouTubeFeeds import listFolder [as 别名]
def test_listFolder_should_set_correct_view_mode_if_feed_is_subscriptions(self):
sys.modules["__main__"].pluginsettings.itemsPerPage.return_value = 15
sys.modules["__main__"].storage.retrieve.return_value = "favorites"
feeds = YouTubeFeeds()
feeds.listAll = Mock()
feeds.listAll.return_value = [{"id": "some_item"}]
feeds.createUrl = Mock()
feeds.createUrl.return_value = "some_url"
(videos, status) = feeds.listFolder({"user_feed": "subscriptions"})
assert(videos[0]["user_feed"] == "favorites")
示例8: test_listFolder_should_call_retrieve_to_get_view_mode_if_feed_is_subscriptions
# 需要导入模块: from YouTubeFeeds import YouTubeFeeds [as 别名]
# 或者: from YouTubeFeeds.YouTubeFeeds import listFolder [as 别名]
def test_listFolder_should_call_retrieve_to_get_view_mode_if_feed_is_subscriptions(self):
sys.modules["__main__"].pluginsettings.itemsPerPage.return_value = 15
sys.modules["__main__"].storage.retrieve.return_value = [{"id": "some_item"}]
feeds = YouTubeFeeds()
feeds.listAll = Mock()
feeds.listAll.return_value = [{"id": "some_item"}]
feeds.createUrl = Mock()
feeds.createUrl.return_value = "some_url"
(videos, status) = feeds.listFolder({"user_feed": "subscriptions"})
sys.modules["__main__"].storage.retrieve.assert_called_with({"user_feed": "subscriptions"}, "viewmode", {'user_feed': 'uploads', 'view_mode': 'subscriptions_favorites', 'id': 'some_item'})
示例9: test_list_should_call_core_getAuth_to_test_if_login_is_set_if_login_is_in_params
# 需要导入模块: from YouTubeFeeds import YouTubeFeeds [as 别名]
# 或者: from YouTubeFeeds.YouTubeFeeds import listFolder [as 别名]
def test_list_should_call_core_getAuth_to_test_if_login_is_set_if_login_is_in_params(self):
sys.modules["__main__"].settings.getSetting.return_value = "1"
feeds = YouTubeFeeds()
feeds.listPlaylist = Mock()
feeds.listFolder = Mock()
feeds.createUrl = Mock()
sys.modules["__main__"].core._fetchPage.return_value = {"content": "some_content", "status": 200}
sys.modules["__main__"].core.getVideoInfo.return_value = []
result = feeds.list({"login": "true"})
print repr(result)
sys.modules["__main__"].core._getAuth.assert_called_with()
示例10: test_list_should_call_createUrl_to_fetch_url
# 需要导入模块: from YouTubeFeeds import YouTubeFeeds [as 别名]
# 或者: from YouTubeFeeds.YouTubeFeeds import listFolder [as 别名]
def test_list_should_call_createUrl_to_fetch_url(self):
sys.modules["__main__"].settings.getSetting.return_value = "1"
sys.modules["__main__"].core._fetchPage.return_value = {"content": "some_content", "status": 200}
sys.modules["__main__"].core.getVideoInfo.return_value = []
sys.modules["__main__"].language.return_value = "some_string"
feeds = YouTubeFeeds()
feeds.listPlaylist = Mock()
feeds.listFolder = Mock()
feeds.createUrl = Mock()
result = feeds.list()
print repr(result)
feeds.createUrl.assert_called_with({})
示例11: test_list_should_return_error_message_if_login_is_not_set_and_login_is_in_params
# 需要导入模块: from YouTubeFeeds import YouTubeFeeds [as 别名]
# 或者: from YouTubeFeeds.YouTubeFeeds import listFolder [as 别名]
def test_list_should_return_error_message_if_login_is_not_set_and_login_is_in_params(self):
sys.modules["__main__"].settings.getSetting.return_value = "1"
sys.modules["__main__"].core._fetchPage.return_value = {"content": "some_content", "status": 200}
sys.modules["__main__"].core.getVideoInfo.return_value = []
sys.modules["__main__"].core._getAuth.return_value = False
sys.modules["__main__"].language.return_value = "some_string"
feeds = YouTubeFeeds()
feeds.listPlaylist = Mock()
feeds.listFolder = Mock()
feeds.createUrl = Mock()
result = feeds.list({"login": "true"})
assert(result == ("some_string", 303))
sys.modules["__main__"].language.assert_called_with(30609)
示例12: test_list_should_return_error_status_if_video_list_is_empty
# 需要导入模块: from YouTubeFeeds import YouTubeFeeds [as 别名]
# 或者: from YouTubeFeeds.YouTubeFeeds import listFolder [as 别名]
def test_list_should_return_error_status_if_video_list_is_empty(self):
sys.modules["__main__"].settings.getSetting.return_value = "1"
sys.modules["__main__"].core._fetchPage.return_value = {"content": "some_fail", "status": 200}
sys.modules["__main__"].core.getVideoInfo.return_value = []
sys.modules["__main__"].language.return_value = "some_string"
feeds = YouTubeFeeds()
feeds.listPlaylist = Mock()
feeds.listFolder = Mock()
feeds.createUrl = Mock()
feeds.createUrl.return_value = "some_url"
result = feeds.list()
assert(result == ([], 303))
示例13: test_listPlaylist_should_return_error_status_if_listAll_returns_empty_list
# 需要导入模块: from YouTubeFeeds import YouTubeFeeds [as 别名]
# 或者: from YouTubeFeeds.YouTubeFeeds import listFolder [as 别名]
def test_listPlaylist_should_return_error_status_if_listAll_returns_empty_list(self):
sys.modules["__main__"].pluginsettings.itemsPerPage.return_value = 15
sys.modules["__main__"].core._fetchPage.return_value = {"content": "some_fail", "status": 200}
sys.modules["__main__"].core.getVideoInfo.return_value = [{"videoid": "some_id", "thumbnail": "some_thumb"}]
sys.modules["__main__"].language.return_value = "some_string"
feeds = YouTubeFeeds()
feeds.listFolder = Mock()
feeds.listAll = Mock()
feeds.listAll.return_value = []
feeds.createUrl = Mock()
feeds.createUrl.return_value = "some_url"
result = feeds.listPlaylist()
assert(result == ([], 303))
示例14: test_list_should_call_storage_store_to_save_first_thumbnail_in_list
# 需要导入模块: from YouTubeFeeds import YouTubeFeeds [as 别名]
# 或者: from YouTubeFeeds.YouTubeFeeds import listFolder [as 别名]
def test_list_should_call_storage_store_to_save_first_thumbnail_in_list(self):
sys.modules["__main__"].settings.getSetting.return_value = "1"
sys.modules["__main__"].core._fetchPage.return_value = {"content": "some_fail", "status": 200}
sys.modules["__main__"].core.getVideoInfo.return_value = [{"videoid": "some_id", "thumbnail": "some_thumb"}]
sys.modules["__main__"].language.return_value = "some_string"
feeds = YouTubeFeeds()
feeds.listPlaylist = Mock()
feeds.listFolder = Mock()
feeds.createUrl = Mock()
feeds.createUrl.return_value = "some_url"
result = feeds.list()
print repr(result)
sys.modules["__main__"].storage.store.assert_called_with({}, "some_thumb", "thumbnail")
示例15: test_listPlaylist_should_call_pluginSettings_to_get_perpage
# 需要导入模块: from YouTubeFeeds import YouTubeFeeds [as 别名]
# 或者: from YouTubeFeeds.YouTubeFeeds import listFolder [as 别名]
def test_listPlaylist_should_call_pluginSettings_to_get_perpage(self):
sys.modules["__main__"].core._fetchPage.return_value = {"content": "some_fail", "status": 200}
sys.modules["__main__"].core.getVideoInfo.return_value = [{"videoid": "some_id", "thumbnail": "some_thumb"}]
sys.modules["__main__"].language.return_value = "some_string"
feeds = YouTubeFeeds()
feeds.listFolder = Mock()
feeds.listAll = Mock()
feeds.listAll.return_value = []
feeds.createUrl = Mock()
feeds.createUrl.return_value = "some_url"
result = feeds.listPlaylist()
print repr(result)
sys.modules["__main__"].pluginsettings.itemsPerPage.assert_any_call()