本文整理汇总了Python中YouTubePlaylistControl.YouTubePlaylistControl.playAll方法的典型用法代码示例。如果您正苦于以下问题:Python YouTubePlaylistControl.playAll方法的具体用法?Python YouTubePlaylistControl.playAll怎么用?Python YouTubePlaylistControl.playAll使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类YouTubePlaylistControl.YouTubePlaylistControl
的用法示例。
在下文中一共展示了YouTubePlaylistControl.playAll方法的9个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: test_playAll_should_not_call_xbmc_player_if_params_is_empty
# 需要导入模块: from YouTubePlaylistControl import YouTubePlaylistControl [as 别名]
# 或者: from YouTubePlaylistControl.YouTubePlaylistControl import playAll [as 别名]
def test_playAll_should_not_call_xbmc_player_if_params_is_empty(self):
control = YouTubePlaylistControl()
control.playAll({})
assert(sys.modules["__main__"].xbmc.Player.call_count == 0)
assert(sys.modules["__main__"].xbmc.Player().call_count == 0)
示例2: test_playAll_should_call_getDiscoSearch_if_scraper_is_disco_search_in_params
# 需要导入模块: from YouTubePlaylistControl import YouTubePlaylistControl [as 别名]
# 或者: from YouTubePlaylistControl.YouTubePlaylistControl import playAll [as 别名]
def test_playAll_should_call_getDiscoSearch_if_scraper_is_disco_search_in_params(self):
control = YouTubePlaylistControl()
sys.modules["__main__"].scraper.searchDisco.return_value = ("", 200)
control.playAll({"scraper":"search_disco", "search":"some_search"})
sys.modules["__main__"].scraper.searchDisco.assert_called_with({"scraper":"search_disco", "search":"some_search", "fetch_all" : "true"})
示例3: test_playAll_should_call_getUserFeed_if_user_feed_is_playlist_in_params
# 需要导入模块: from YouTubePlaylistControl import YouTubePlaylistControl [as 别名]
# 或者: from YouTubePlaylistControl.YouTubePlaylistControl import playAll [as 别名]
def test_playAll_should_call_getUserFeed_if_user_feed_is_playlist_in_params(self):
control = YouTubePlaylistControl()
control.getUserFeed = Mock()
control.getUserFeed.return_value = ""
control.playAll({"user_feed":"playlist", "playlist":"someid"})
control.getUserFeed.assert_called_with({"playlist":"someid", "user_feed":"playlist",'fetch_all': 'true'})
示例4: test_playAll_should_call_getUserFeed_if_user_feed_is_subscriptions_in_params
# 需要导入模块: from YouTubePlaylistControl import YouTubePlaylistControl [as 别名]
# 或者: from YouTubePlaylistControl.YouTubePlaylistControl import playAll [as 别名]
def test_playAll_should_call_getUserFeed_if_user_feed_is_subscriptions_in_params(self):
control = YouTubePlaylistControl()
control.getUserFeed = Mock()
control.getUserFeed.return_value = ""
control.playAll({"user_feed":"newsubscriptions"})
control.getUserFeed.assert_called_with({"user_feed":"newsubscriptions", 'login':"true", 'fetch_all': 'true'})
示例5: test_playAll_should_call_getLikedVideos_if_scraper_is_liked_videos_in_params
# 需要导入模块: from YouTubePlaylistControl import YouTubePlaylistControl [as 别名]
# 或者: from YouTubePlaylistControl.YouTubePlaylistControl import playAll [as 别名]
def test_playAll_should_call_getLikedVideos_if_scraper_is_liked_videos_in_params(self):
control = YouTubePlaylistControl()
control.getLikedVideos = Mock()
control.getLikedVideos.return_value = ("",200)
control.playAll({"scraper":"liked_videos"})
control.getLikedVideos.assert_called_with({"scraper":"liked_videos", 'fetch_all': 'true'})
示例6: test_playAll_should_queue_all_items_in_result_list
# 需要导入模块: from YouTubePlaylistControl import YouTubePlaylistControl [as 别名]
# 或者: from YouTubePlaylistControl.YouTubePlaylistControl import playAll [as 别名]
def test_playAll_should_queue_all_items_in_result_list(self):
playlist_value = Mock()
sys.modules["__main__"].xbmc.PlayList.return_value = playlist_value
control = YouTubePlaylistControl()
control.getUserFeed = Mock()
control.getUserFeed.return_value = [{"Title":"someTitle1", "videoid":"some_id1","thumbnail":"some_thumbnail1"},{"Title":"someTitle2", "videoid":"some_id2","thumbnail":"some_thumbnail2"}]
control.playAll({"user_feed":"playlist","playlist":"someid","shuffle":"true"})
assert(playlist_value.add.call_count == 2)
示例7: test_playAll_should_call_xbmc_PlayList_clear_if_results_is_not_empty
# 需要导入模块: from YouTubePlaylistControl import YouTubePlaylistControl [as 别名]
# 或者: from YouTubePlaylistControl.YouTubePlaylistControl import playAll [as 别名]
def test_playAll_should_call_xbmc_PlayList_clear_if_results_is_not_empty(self):
playlist_value = Mock()
sys.modules["__main__"].xbmc.PlayList.return_value = playlist_value
control = YouTubePlaylistControl()
control.getUserFeed = Mock()
control.getUserFeed.return_value = [{"Title":"someTitle", "videoid":"some_id","thumbnail":"some_thumbnail"}]
control.playAll({"user_feed":"playlist", "playlist":"someid"})
playlist_value.clear.assert_called_with()
示例8: test_playAll_should_call_xbmc_player_stop_if_player_is_playing
# 需要导入模块: from YouTubePlaylistControl import YouTubePlaylistControl [as 别名]
# 或者: from YouTubePlaylistControl.YouTubePlaylistControl import playAll [as 别名]
def test_playAll_should_call_xbmc_player_stop_if_player_is_playing(self):
control = YouTubePlaylistControl()
control.getUserFeed = Mock()
control.getUserFeed.return_value = [{"Title":"someTitle", "videoid":"some_id","thumbnail":"some_thumbnail"}]
control.playAll({"user_feed":"playlist", "playlist":"someid"})
sys.modules["__main__"].xbmc.Player.assert_called_with()
sys.modules["__main__"].xbmc.Player().isPlaying.assert_called_with()
sys.modules["__main__"].xbmc.Player().stop.assert_called_with()
示例9: test_playAll_should_start_playback_of_playlist_if_result_list_is_not_empty
# 需要导入模块: from YouTubePlaylistControl import YouTubePlaylistControl [as 别名]
# 或者: from YouTubePlaylistControl.YouTubePlaylistControl import playAll [as 别名]
def test_playAll_should_start_playback_of_playlist_if_result_list_is_not_empty(self):
playlist_value = Mock()
sys.modules["__main__"].xbmc.PlayList.return_value = playlist_value
control = YouTubePlaylistControl()
control.getUserFeed = Mock()
control.getUserFeed.return_value = [{"Title":"someTitle1", "videoid":"some_id1","thumbnail":"some_thumbnail1"},{"Title":"someTitle2", "videoid":"some_id2","thumbnail":"some_thumbnail2"}]
control.playAll({"user_feed":"playlist", "playlist":"someid"})
sys.modules["__main__"].xbmc.executebuiltin.assert_called_with('playlist.playoffset(video , 0)')