本文整理汇总了Python中YouTubePlaylistControl.YouTubePlaylistControl.getPlayList方法的典型用法代码示例。如果您正苦于以下问题:Python YouTubePlaylistControl.getPlayList方法的具体用法?Python YouTubePlaylistControl.getPlayList怎么用?Python YouTubePlaylistControl.getPlayList使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类YouTubePlaylistControl.YouTubePlaylistControl
的用法示例。
在下文中一共展示了YouTubePlaylistControl.getPlayList方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: test_queueVideo_should_call_get_batch_details_for_the_video_list
# 需要导入模块: from YouTubePlaylistControl import YouTubePlaylistControl [as 别名]
# 或者: from YouTubePlaylistControl.YouTubePlaylistControl import getPlayList [as 别名]
def test_queueVideo_should_call_get_batch_details_for_the_video_list(self):
playlist_value = Mock()
sys.modules["__main__"].xbmc.PlayList.return_value = playlist_value
sys.modules["__main__"].core.getBatchDetails.return_value = ({"apierror":""},303)
control = YouTubePlaylistControl()
control.getPlayList = Mock()
control.getPlayList.return_value = [{"Title":"someTitle1", "videoid":"some_id1","thumbnail":"some_thumbnail1"},{"Title":"someTitle2", "videoid":"some_id2","thumbnail":"some_thumbnail2"}]
control.queueVideo({"videoid":"someid1,someid2,someid3"})
sys.modules["__main__"].core.getBatchDetails.assert_called_with(['someid1', 'someid2', 'someid3'], {'videoid': 'someid1,someid2,someid3'})
示例2: test_queueVideo_should_show_error_message_if_get_batch_details_fails
# 需要导入模块: from YouTubePlaylistControl import YouTubePlaylistControl [as 别名]
# 或者: from YouTubePlaylistControl.YouTubePlaylistControl import getPlayList [as 别名]
def test_queueVideo_should_show_error_message_if_get_batch_details_fails(self):
playlist_value = Mock()
sys.modules["__main__"].xbmc.PlayList.return_value = playlist_value
sys.modules["__main__"].language.return_value = ""
sys.modules["__main__"].core.getBatchDetails.return_value = ([],303)
control = YouTubePlaylistControl()
control.getPlayList = Mock()
control.getPlayList.return_value = [{"Title":"someTitle1", "videoid":"some_id1","thumbnail":"some_thumbnail1"},{"Title":"someTitle2", "videoid":"some_id2","thumbnail":"some_thumbnail2"}]
control.queueVideo({"videoid":"someid1,someid2,someid3"})
sys.modules["__main__"].utils.showErrorMessage.assert_called_with("","apierror",303)
示例3: test_queueVideo_should_correctly_queue_all_items_in_result_list
# 需要导入模块: from YouTubePlaylistControl import YouTubePlaylistControl [as 别名]
# 或者: from YouTubePlaylistControl.YouTubePlaylistControl import getPlayList [as 别名]
def test_queueVideo_should_correctly_queue_all_items_in_result_list(self):
playlist_value = Mock()
sys.modules["__main__"].xbmc.PlayList.return_value = playlist_value
sys.modules["__main__"].language.return_value = ""
sys.modules["__main__"].core.getBatchDetails.return_value = ([{"Title":"someTitle1","videoid":"some_id1", "thumbnail":"thumbnail1","video_url":"some_url1"}, {"Title":"someTitle1","videoid":"some_id1", "thumbnail":"thumbnail1","video_url":"some_url1"}, {"Title":"someTitle1","videoid":"some_id1", "thumbnail":"thumbnail1","video_url":"some_url1"}], 200)
sys.modules["__main__"].common.makeAscii.return_value = ""
control = YouTubePlaylistControl()
control.getPlayList = Mock()
control.getPlayList.return_value = [{"Title":"someTitle1", "videoid":"some_id1","thumbnail":"some_thumbnail1"},{"Title":"someTitle2", "videoid":"some_id2","thumbnail":"some_thumbnail2"}]
control.queueVideo({"videoid":"someid1,someid2,someid3"})
assert(playlist_value.add.call_count == 3)