本文整理汇总了Python中YouTubeFeeds.YouTubeFeeds.listPlaylist方法的典型用法代码示例。如果您正苦于以下问题:Python YouTubeFeeds.listPlaylist方法的具体用法?Python YouTubeFeeds.listPlaylist怎么用?Python YouTubeFeeds.listPlaylist使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类YouTubeFeeds.YouTubeFeeds
的用法示例。
在下文中一共展示了YouTubeFeeds.listPlaylist方法的14个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: test_list_should_call_listPlaylist_if_playlist_is_in_params
# 需要导入模块: from YouTubeFeeds import YouTubeFeeds [as 别名]
# 或者: from YouTubeFeeds.YouTubeFeeds import listPlaylist [as 别名]
def test_list_should_call_listPlaylist_if_playlist_is_in_params(self):
sys.modules["__main__"].settings.getSetting.return_value = "1"
feeds = YouTubeFeeds()
feeds.listPlaylist = Mock()
result = feeds.list({"playlist": "some_playlist"})
print repr(result)
feeds.listPlaylist.assert_called_with({"playlist": "some_playlist"})
示例2: 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 listPlaylist [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()
示例3: test_list_should_return_error_status_if_video_list_is_empty
# 需要导入模块: from YouTubeFeeds import YouTubeFeeds [as 别名]
# 或者: from YouTubeFeeds.YouTubeFeeds import listPlaylist [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))
示例4: test_list_should_call_createUrl_to_fetch_url
# 需要导入模块: from YouTubeFeeds import YouTubeFeeds [as 别名]
# 或者: from YouTubeFeeds.YouTubeFeeds import listPlaylist [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({})
示例5: 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 listPlaylist [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)
示例6: test_listPlaylist_should_return_error_status_if_listAll_returns_empty_list
# 需要导入模块: from YouTubeFeeds import YouTubeFeeds [as 别名]
# 或者: from YouTubeFeeds.YouTubeFeeds import listPlaylist [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))
示例7: test_listPlaylist_should_call_pluginSettings_to_get_perpage
# 需要导入模块: from YouTubeFeeds import YouTubeFeeds [as 别名]
# 或者: from YouTubeFeeds.YouTubeFeeds import listPlaylist [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()
示例8: test_list_should_call_storage_store_to_save_first_thumbnail_in_list
# 需要导入模块: from YouTubeFeeds import YouTubeFeeds [as 别名]
# 或者: from YouTubeFeeds.YouTubeFeeds import listPlaylist [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")
示例9: test_list_should_call_core_getVideoInfo_if_fetchPage_succeded_and_folder_is_not_in_params
# 需要导入模块: from YouTubeFeeds import YouTubeFeeds [as 别名]
# 或者: from YouTubeFeeds.YouTubeFeeds import listPlaylist [as 别名]
def test_list_should_call_core_getVideoInfo_if_fetchPage_succeded_and_folder_is_not_in_params(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()
print repr(result)
sys.modules["__main__"].core.getVideoInfo.assert_called_with("some_fail", {})
示例10: test_listPlaylist_should_call_storage_store_with_first_thumbnail_of_list
# 需要导入模块: from YouTubeFeeds import YouTubeFeeds [as 别名]
# 或者: from YouTubeFeeds.YouTubeFeeds import listPlaylist [as 别名]
def test_listPlaylist_should_call_storage_store_with_first_thumbnail_of_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__"].language.return_value = "some_string"
list = [{"videoid": "some_id", "thumbnail": "some_thumb", "playlist_entry_id": "some_id"}]
feeds = YouTubeFeeds()
feeds.listFolder = Mock()
feeds.listAll = Mock()
feeds.listAll.return_value = list
feeds.createUrl = Mock()
feeds.createUrl.return_value = "some_url"
result = feeds.listPlaylist()
print repr(result)
sys.modules["__main__"].storage.store.assert_called_with({}, "some_thumb", "thumbnail")
示例11: test_listPlaylist_should_limit_list_lengt_to_perpage_count
# 需要导入模块: from YouTubeFeeds import YouTubeFeeds [as 别名]
# 或者: from YouTubeFeeds.YouTubeFeeds import listPlaylist [as 别名]
def test_listPlaylist_should_limit_list_lengt_to_perpage_count(self):
sys.modules["__main__"].pluginsettings.itemsPerPage.return_value = 15
sys.modules["__main__"].core._fetchPage.return_value = {"content": "some_fail", "status": 200}
sys.modules["__main__"].language.return_value = "some_string"
ids = []
i= 1
while i < 52:
ids.append({"videoid": "some_id_" + str(i), "thumbnail": "some_thumb_" + str(i), "playlist_entry_id": "some_id_" + str(i)})
i += 1
feeds = YouTubeFeeds()
feeds.listFolder = Mock()
feeds.listAll = Mock()
feeds.listAll.return_value = ids
feeds.createUrl = Mock()
feeds.createUrl.return_value = "some_url"
videos, status = feeds.listPlaylist()
assert(len(videos) == 15)
示例12: test_listPlaylist_should_call_getBatchDetailsOverride_to_fetch_video_info_for_stored_video_list
# 需要导入模块: from YouTubeFeeds import YouTubeFeeds [as 别名]
# 或者: from YouTubeFeeds.YouTubeFeeds import listPlaylist [as 别名]
def test_listPlaylist_should_call_getBatchDetailsOverride_to_fetch_video_info_for_stored_video_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"
sys.modules["__main__"].storage.retrieve.return_value = [{}, {}]
sys.modules["__main__"].core.getBatchDetailsOverride.return_value = ([], 200)
feeds = YouTubeFeeds()
feeds.listFolder = Mock()
feeds.listAll = Mock()
feeds.listAll.return_value = []
feeds.createUrl = Mock()
feeds.createUrl.return_value = "some_url"
result = feeds.listPlaylist({"page": "1"})
print repr(result)
sys.modules["__main__"].core.getBatchDetailsOverride.assert_called_with([], {"page": "1"})
示例13: test_listPlaylist_should_call_addNextFolder_for_lists_longer_than_perpage
# 需要导入模块: from YouTubeFeeds import YouTubeFeeds [as 别名]
# 或者: from YouTubeFeeds.YouTubeFeeds import listPlaylist [as 别名]
def test_listPlaylist_should_call_addNextFolder_for_lists_longer_than_perpage(self):
sys.modules["__main__"].pluginsettings.itemsPerPage.return_value = 15
sys.modules["__main__"].core._fetchPage.return_value = {"content": "some_fail", "status": 200}
sys.modules["__main__"].language.return_value = "some_string"
ids = []
i= 1
while i < 52:
ids.append({"videoid": "some_id_" + str(i), "thumbnail": "some_thumb_" + str(i), "playlist_entry_id": "some_id_" + str(i)})
i += 1
feeds = YouTubeFeeds()
feeds.listFolder = Mock()
feeds.listAll = Mock()
feeds.listAll.return_value = ids
feeds.createUrl = Mock()
feeds.createUrl.return_value = "some_url"
result = feeds.listPlaylist()
print repr(result)
sys.modules["__main__"].utils.addNextFolder.assert_called_with(ids[:15], {})
示例14: test_listPlaylist_should_starts_list_position_from_page_count_and_perpage_count
# 需要导入模块: from YouTubeFeeds import YouTubeFeeds [as 别名]
# 或者: from YouTubeFeeds.YouTubeFeeds import listPlaylist [as 别名]
def test_listPlaylist_should_starts_list_position_from_page_count_and_perpage_count(self):
sys.modules["__main__"].pluginsettings.itemsPerPage.return_value = 15
sys.modules["__main__"].core._fetchPage.return_value = {"content": "some_fail", "status": 200}
sys.modules["__main__"].language.return_value = "some_string"
ids = []
i= 1
while i < 52:
ids.append({"videoid": "some_id_" + str(i), "thumbnail": "some_thumb_" + str(i), "playlist_entry_id": "some_id_" + str(i)})
i += 1
sys.modules["__main__"].core.getBatchDetailsOverride.side_effect = lambda x, y: (x, 200)
sys.modules["__main__"].storage.retrieve.return_value = ids
feeds = YouTubeFeeds()
feeds.listFolder = Mock()
feeds.listAll = Mock()
feeds.createUrl = Mock()
feeds.createUrl.return_value = "some_url"
videos, status = feeds.listPlaylist({"page": "1"})
print repr(videos)
print repr(status)
assert(len(videos) == 15)
assert(videos[0]["videoid"] == "some_id_16")
assert(videos[14]["videoid"] == "some_id_30")