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


Python YouTubeFeeds.listPlaylist方法代码示例

本文整理汇总了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"})
开发者ID:1c0n,项目名称:youtube-xbmc-plugin,代码行数:12,代码来源:TestYouTubeFeeds.py

示例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()
开发者ID:1c0n,项目名称:youtube-xbmc-plugin,代码行数:15,代码来源:TestYouTubeFeeds.py

示例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))
开发者ID:1c0n,项目名称:youtube-xbmc-plugin,代码行数:16,代码来源:TestYouTubeFeeds.py

示例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({})
开发者ID:1c0n,项目名称:youtube-xbmc-plugin,代码行数:16,代码来源:TestYouTubeFeeds.py

示例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)
开发者ID:1c0n,项目名称:youtube-xbmc-plugin,代码行数:16,代码来源:TestYouTubeFeeds.py

示例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))
开发者ID:1c0n,项目名称:youtube-xbmc-plugin,代码行数:17,代码来源:TestYouTubeFeeds.py

示例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()
开发者ID:1c0n,项目名称:youtube-xbmc-plugin,代码行数:18,代码来源:TestYouTubeFeeds.py

示例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")
开发者ID:1c0n,项目名称:youtube-xbmc-plugin,代码行数:18,代码来源:TestYouTubeFeeds.py

示例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", {})
开发者ID:1c0n,项目名称:youtube-xbmc-plugin,代码行数:18,代码来源:TestYouTubeFeeds.py

示例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")
开发者ID:1c0n,项目名称:youtube-xbmc-plugin,代码行数:19,代码来源:TestYouTubeFeeds.py

示例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)
开发者ID:1c0n,项目名称:youtube-xbmc-plugin,代码行数:20,代码来源:TestYouTubeFeeds.py

示例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"})
开发者ID:1c0n,项目名称:youtube-xbmc-plugin,代码行数:21,代码来源:TestYouTubeFeeds.py

示例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], {})
开发者ID:1c0n,项目名称:youtube-xbmc-plugin,代码行数:23,代码来源:TestYouTubeFeeds.py

示例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")
开发者ID:1c0n,项目名称:youtube-xbmc-plugin,代码行数:26,代码来源:TestYouTubeFeeds.py


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