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


Python YouTubePlaylistControl.queueVideo方法代码示例

本文整理汇总了Python中YouTubePlaylistControl.YouTubePlaylistControl.queueVideo方法的典型用法代码示例。如果您正苦于以下问题:Python YouTubePlaylistControl.queueVideo方法的具体用法?Python YouTubePlaylistControl.queueVideo怎么用?Python YouTubePlaylistControl.queueVideo使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在YouTubePlaylistControl.YouTubePlaylistControl的用法示例。


在下文中一共展示了YouTubePlaylistControl.queueVideo方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。

示例1: test_queueVideo_should_call_get_batch_details_for_the_video_list

# 需要导入模块: from YouTubePlaylistControl import YouTubePlaylistControl [as 别名]
# 或者: from YouTubePlaylistControl.YouTubePlaylistControl import queueVideo [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'})        
开发者ID:BlackSmith,项目名称:youtube-xbmc-plugin,代码行数:13,代码来源:TestYouTubePlaylistControl.py

示例2: test_queueVideo_should_show_error_message_if_get_batch_details_fails

# 需要导入模块: from YouTubePlaylistControl import YouTubePlaylistControl [as 别名]
# 或者: from YouTubePlaylistControl.YouTubePlaylistControl import queueVideo [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)
开发者ID:BlackSmith,项目名称:youtube-xbmc-plugin,代码行数:14,代码来源:TestYouTubePlaylistControl.py

示例3: test_queueVideo_should_correctly_queue_all_items_in_result_list

# 需要导入模块: from YouTubePlaylistControl import YouTubePlaylistControl [as 别名]
# 或者: from YouTubePlaylistControl.YouTubePlaylistControl import queueVideo [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)
开发者ID:BlackSmith,项目名称:youtube-xbmc-plugin,代码行数:15,代码来源:TestYouTubePlaylistControl.py


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