本文整理匯總了Python中YouTubeFeeds.YouTubeFeeds.list方法的典型用法代碼示例。如果您正苦於以下問題:Python YouTubeFeeds.list方法的具體用法?Python YouTubeFeeds.list怎麽用?Python YouTubeFeeds.list使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類YouTubeFeeds.YouTubeFeeds
的用法示例。
在下文中一共展示了YouTubeFeeds.list方法的8個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Python代碼示例。
示例1: test_list_should_call_listPlaylist_if_playlist_is_in_params
# 需要導入模塊: from YouTubeFeeds import YouTubeFeeds [as 別名]
# 或者: from YouTubeFeeds.YouTubeFeeds import list [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_listFolder_if_folder_is_in_params
# 需要導入模塊: from YouTubeFeeds import YouTubeFeeds [as 別名]
# 或者: from YouTubeFeeds.YouTubeFeeds import list [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"})
示例3: 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 list [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()
示例4: test_list_should_return_error_status_if_video_list_is_empty
# 需要導入模塊: from YouTubeFeeds import YouTubeFeeds [as 別名]
# 或者: from YouTubeFeeds.YouTubeFeeds import list [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))
示例5: test_list_should_call_createUrl_to_fetch_url
# 需要導入模塊: from YouTubeFeeds import YouTubeFeeds [as 別名]
# 或者: from YouTubeFeeds.YouTubeFeeds import list [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({})
示例6: 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 list [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)
示例7: test_list_should_call_storage_store_to_save_first_thumbnail_in_list
# 需要導入模塊: from YouTubeFeeds import YouTubeFeeds [as 別名]
# 或者: from YouTubeFeeds.YouTubeFeeds import list [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")
示例8: test_list_should_call_core_getVideoInfo_if_fetchPage_succeded_and_folder_is_not_in_params
# 需要導入模塊: from YouTubeFeeds import YouTubeFeeds [as 別名]
# 或者: from YouTubeFeeds.YouTubeFeeds import list [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", {})