本文整理汇总了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", {})