當前位置: 首頁>>代碼示例>>Python>>正文


Python YouTubeFeeds.listAll方法代碼示例

本文整理匯總了Python中YouTubeFeeds.YouTubeFeeds.listAll方法的典型用法代碼示例。如果您正苦於以下問題:Python YouTubeFeeds.listAll方法的具體用法?Python YouTubeFeeds.listAll怎麽用?Python YouTubeFeeds.listAll使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在YouTubeFeeds.YouTubeFeeds的用法示例。


在下文中一共展示了YouTubeFeeds.listAll方法的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Python代碼示例。

示例1: test_listAll_should_call_createUrl_to_get_url

# 需要導入模塊: from YouTubeFeeds import YouTubeFeeds [as 別名]
# 或者: from YouTubeFeeds.YouTubeFeeds import listAll [as 別名]
 def test_listAll_should_call_createUrl_to_get_url(self):
     sys.modules["__main__"].pluginsettings.itemsPerPage.return_value = 15
     sys.modules["__main__"].storage.retrieve.return_value = "favorites"
     sys.modules["__main__"].core._fetchPage.return_value = {"content": "some_fail", "status": 200}
     sys.modules["__main__"].core.getVideoInfo.return_value = []
     feeds = YouTubeFeeds()
     feeds.createUrl = Mock()
     feeds.createUrl.return_value = "some_url"
     
     feeds.listAll({"login": "true"})
     
     feeds.createUrl.assert_called_with({"login": "true"})
開發者ID:1c0n,項目名稱:youtube-xbmc-plugin,代碼行數:14,代碼來源:TestYouTubeFeeds.py

示例2: test_listAll_should_call_fetchPage_correctly

# 需要導入模塊: from YouTubeFeeds import YouTubeFeeds [as 別名]
# 或者: from YouTubeFeeds.YouTubeFeeds import listAll [as 別名]
 def test_listAll_should_call_fetchPage_correctly(self):
     sys.modules["__main__"].pluginsettings.itemsPerPage.return_value = 15
     sys.modules["__main__"].storage.retrieve.return_value = "favorites"
     sys.modules["__main__"].core._fetchPage.return_value = {"content": "some_fail", "status": 200}
     sys.modules["__main__"].core.getVideoInfo.return_value = []
     feeds = YouTubeFeeds()
     feeds.createUrl = Mock()
     feeds.createUrl.return_value = "some_url"
     
     feeds.listAll({"login": "true"})
     
     sys.modules["__main__"].core._fetchPage.assert_called_with({"link": "some_urlv=2.1&start-index=1&max-results=50", "auth": "true"})
開發者ID:1c0n,項目名稱:youtube-xbmc-plugin,代碼行數:14,代碼來源:TestYouTubeFeeds.py

示例3: test_listAll_should_call_core_getVideoInfo_if_folder_is_not_in_params

# 需要導入模塊: from YouTubeFeeds import YouTubeFeeds [as 別名]
# 或者: from YouTubeFeeds.YouTubeFeeds import listAll [as 別名]
 def test_listAll_should_call_core_getVideoInfo_if_folder_is_not_in_params(self):
     sys.modules["__main__"].settings.getSetting.return_value = "1"
     sys.modules["__main__"].storage.retrieve.return_value = "favorites"
     sys.modules["__main__"].core._fetchPage.return_value = {"content": "some_fail", "status": 200}
     sys.modules["__main__"].core.getVideoInfo.return_value = []
     feeds = YouTubeFeeds()
     feeds.createUrl = Mock()
     feeds.createUrl.return_value = "some_url"
     
     feeds.listAll({"login": "true"})
     
     sys.modules["__main__"].core.getVideoInfo.assert_called_with("some_fail", {"login": "true"})
開發者ID:1c0n,項目名稱:youtube-xbmc-plugin,代碼行數:14,代碼來源:TestYouTubeFeeds.py

示例4: test_listAll_should_call_core_getFolderInfo_multiple_times_if_feed_requires_it

# 需要導入模塊: from YouTubeFeeds import YouTubeFeeds [as 別名]
# 或者: from YouTubeFeeds.YouTubeFeeds import listAll [as 別名]
 def test_listAll_should_call_core_getFolderInfo_multiple_times_if_feed_requires_it(self):
     sys.modules["__main__"].settings.getSetting.return_value = "1"
     sys.modules["__main__"].storage.retrieve.return_value = "favorites"
     sys.modules["__main__"].core._fetchPage.return_value = {"content": "some_fail", "status": 200}
     list = [[{"next": "false"}], [{"next": "true"}]]
     sys.modules["__main__"].core.getFolderInfo.side_effect = lambda x, y: list.pop()
     feeds = YouTubeFeeds()
     feeds.createUrl = Mock()
     feeds.createUrl.return_value = "some_url"
     
     feeds.listAll({"folder": "true"})
     
     assert(sys.modules["__main__"].core.getFolderInfo.call_count == 2)
開發者ID:1c0n,項目名稱:youtube-xbmc-plugin,代碼行數:15,代碼來源:TestYouTubeFeeds.py

示例5: test_listAll_should_call_storage_getReversePlaylistOrder_to_reverse_list_if_not_play_all

# 需要導入模塊: from YouTubeFeeds import YouTubeFeeds [as 別名]
# 或者: from YouTubeFeeds.YouTubeFeeds import listAll [as 別名]
    def test_listAll_should_call_storage_getReversePlaylistOrder_to_reverse_list_if_not_play_all(self):
        sys.modules["__main__"].settings.getSetting.return_value = "1"
        sys.modules["__main__"].storage.retrieve.return_value = "favorites"
        sys.modules["__main__"].core._fetchPage.return_value = {"content": "some_fail", "status": 200}
        list = [[{"next": "false"}], [{"next": "true"}]]
        sys.modules["__main__"].core.getVideoInfo.side_effect = lambda x, y: list.pop()
        feeds = YouTubeFeeds()
        feeds.createUrl = Mock()
        feeds.createUrl.return_value = "some_url"

        feeds.listAll({"user_feed": "playlist"})

        sys.modules["__main__"].storage.getReversePlaylistOrder.assert_called_with({"user_feed": "playlist"})
開發者ID:1c0n,項目名稱:youtube-xbmc-plugin,代碼行數:15,代碼來源:TestYouTubeFeeds.py

示例6: test_listFolder_should_call_getSetting_to_get_perpage

# 需要導入模塊: from YouTubeFeeds import YouTubeFeeds [as 別名]
# 或者: from YouTubeFeeds.YouTubeFeeds import listAll [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()
開發者ID:1c0n,項目名稱:youtube-xbmc-plugin,代碼行數:12,代碼來源:TestYouTubeFeeds.py

示例7: test_listFolder_should_call_storage_store_to_save_new_list

# 需要導入模塊: from YouTubeFeeds import YouTubeFeeds [as 別名]
# 或者: from YouTubeFeeds.YouTubeFeeds import listAll [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"])
開發者ID:1c0n,項目名稱:youtube-xbmc-plugin,代碼行數:14,代碼來源:TestYouTubeFeeds.py

示例8: test_listFolder_should_set_correct_view_mode_if_feed_is_subscriptions

# 需要導入模塊: from YouTubeFeeds import YouTubeFeeds [as 別名]
# 或者: from YouTubeFeeds.YouTubeFeeds import listAll [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")
開發者ID:1c0n,項目名稱:youtube-xbmc-plugin,代碼行數:14,代碼來源:TestYouTubeFeeds.py

示例9: test_listFolder_should_call_listAll_page_is_not_in_params

# 需要導入模塊: from YouTubeFeeds import YouTubeFeeds [as 別名]
# 或者: from YouTubeFeeds.YouTubeFeeds import listAll [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({})
開發者ID:1c0n,項目名稱:youtube-xbmc-plugin,代碼行數:14,代碼來源:TestYouTubeFeeds.py

示例10: test_listFolder_should_call_retrieve_to_get_view_mode_if_feed_is_subscriptions

# 需要導入模塊: from YouTubeFeeds import YouTubeFeeds [as 別名]
# 或者: from YouTubeFeeds.YouTubeFeeds import listAll [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'})
開發者ID:1c0n,項目名稱:youtube-xbmc-plugin,代碼行數:14,代碼來源:TestYouTubeFeeds.py

示例11: 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 listAll [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"})
開發者ID:1c0n,項目名稱:youtube-xbmc-plugin,代碼行數:14,代碼來源:TestYouTubeFeeds.py

示例12: test_listAll_should_append_additional_items_to_list

# 需要導入模塊: from YouTubeFeeds import YouTubeFeeds [as 別名]
# 或者: from YouTubeFeeds.YouTubeFeeds import listAll [as 別名]
    def test_listAll_should_append_additional_items_to_list(self):
        sys.modules["__main__"].settings.getSetting.return_value = "1"
        sys.modules["__main__"].storage.retrieve.return_value = "favorites"
        sys.modules["__main__"].core._fetchPage.return_value = {"content": "some_fail", "status": 200}
        list = [[{"next": "false"}, {"next": "false"}], [{"next": "false"}, {"next": "true"}], [{"next": "false"}, {"next": "true"}], [{"next": "false"}, {"next": "true"}]]
        sys.modules["__main__"].core.getVideoInfo.side_effect = lambda x, y: list.pop()
        feeds = YouTubeFeeds()
        feeds.createUrl = Mock()
        feeds.createUrl.return_value = "some_url"

        video = feeds.listAll()

        print repr(video)

        assert(video == [{'next': 'false'}, {'next': 'false'}, {'next': 'false'}, {'next': 'false'}, {'next': 'false'}])
開發者ID:1c0n,項目名稱:youtube-xbmc-plugin,代碼行數:17,代碼來源:TestYouTubeFeeds.py

示例13: test_listPlaylist_should_return_error_status_if_listAll_returns_empty_list

# 需要導入模塊: from YouTubeFeeds import YouTubeFeeds [as 別名]
# 或者: from YouTubeFeeds.YouTubeFeeds import listAll [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

示例14: test_listPlaylist_should_call_pluginSettings_to_get_perpage

# 需要導入模塊: from YouTubeFeeds import YouTubeFeeds [as 別名]
# 或者: from YouTubeFeeds.YouTubeFeeds import listAll [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

示例15: test_listPlaylist_should_call_listAll_if_stored_list_isnt_found

# 需要導入模塊: from YouTubeFeeds import YouTubeFeeds [as 別名]
# 或者: from YouTubeFeeds.YouTubeFeeds import listAll [as 別名]
    def test_listPlaylist_should_call_listAll_if_stored_list_isnt_found(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.listFolder = Mock()
        feeds.listAll = Mock()
        feeds.listAll.return_value = []
        feeds.createUrl = Mock()
        feeds.createUrl.return_value = "some_url"
	
        result = feeds.listPlaylist()

        print repr(result)

        feeds.listAll.assert_called_with({})
開發者ID:1c0n,項目名稱:youtube-xbmc-plugin,代碼行數:19,代碼來源:TestYouTubeFeeds.py


注:本文中的YouTubeFeeds.YouTubeFeeds.listAll方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。