本文整理汇总了Python中YouTubePlaylistControl.YouTubePlaylistControl.getUserFeed方法的典型用法代码示例。如果您正苦于以下问题:Python YouTubePlaylistControl.getUserFeed方法的具体用法?Python YouTubePlaylistControl.getUserFeed怎么用?Python YouTubePlaylistControl.getUserFeed使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类YouTubePlaylistControl.YouTubePlaylistControl
的用法示例。
在下文中一共展示了YouTubePlaylistControl.getUserFeed方法的10个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: test_getUserFeed_should_exit_cleanly_if_contact_is_missing
# 需要导入模块: from YouTubePlaylistControl import YouTubePlaylistControl [as 别名]
# 或者: from YouTubePlaylistControl.YouTubePlaylistControl import getUserFeed [as 别名]
def test_getUserFeed_should_exit_cleanly_if_contact_is_missing(self):
sys.modules["__main__"].feeds.listAll.return_value = ("",200)
control = YouTubePlaylistControl()
control.getUserFeed({"user_feed":"favorites"})
assert(sys.modules["__main__"].feeds.listAll.call_count == 0)
示例2: test_getUserFeed_should_call_core_list_all_with_correct_params
# 需要导入模块: from YouTubePlaylistControl import YouTubePlaylistControl [as 别名]
# 或者: from YouTubePlaylistControl.YouTubePlaylistControl import getUserFeed [as 别名]
def test_getUserFeed_should_call_core_list_all_with_correct_params(self):
sys.modules["__main__"].feeds.listAll.return_value = ("",200)
control = YouTubePlaylistControl()
control.getUserFeed({"contact":"some_contact", "user_feed":"favorites"})
assert(sys.modules["__main__"].feeds.listAll.call_count == 1)
sys.modules["__main__"].feeds.listAll.assert_called_with({"user_feed":"favorites","contact":"some_contact"})
示例3: test_playAll_should_call_getUserFeed_if_user_feed_is_playlist_in_params
# 需要导入模块: from YouTubePlaylistControl import YouTubePlaylistControl [as 别名]
# 或者: from YouTubePlaylistControl.YouTubePlaylistControl import getUserFeed [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 getUserFeed [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_queue_all_items_in_result_list
# 需要导入模块: from YouTubePlaylistControl import YouTubePlaylistControl [as 别名]
# 或者: from YouTubePlaylistControl.YouTubePlaylistControl import getUserFeed [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)
示例6: test_playAll_should_call_xbmc_PlayList_clear_if_results_is_not_empty
# 需要导入模块: from YouTubePlaylistControl import YouTubePlaylistControl [as 别名]
# 或者: from YouTubePlaylistControl.YouTubePlaylistControl import getUserFeed [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()
示例7: test_playAll_should_call_xbmc_player_stop_if_player_is_playing
# 需要导入模块: from YouTubePlaylistControl import YouTubePlaylistControl [as 别名]
# 或者: from YouTubePlaylistControl.YouTubePlaylistControl import getUserFeed [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()
示例8: test_playAll_should_start_playback_of_playlist_if_result_list_is_not_empty
# 需要导入模块: from YouTubePlaylistControl import YouTubePlaylistControl [as 别名]
# 或者: from YouTubePlaylistControl.YouTubePlaylistControl import getUserFeed [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)')
示例9: test_getUserFeed_should_exit_cleanly_if_user_feed_is_playlist_and_playlist_id_is_missing_from_params
# 需要导入模块: from YouTubePlaylistControl import YouTubePlaylistControl [as 别名]
# 或者: from YouTubePlaylistControl.YouTubePlaylistControl import getUserFeed [as 别名]
def test_getUserFeed_should_exit_cleanly_if_user_feed_is_playlist_and_playlist_id_is_missing_from_params(self):
control = YouTubePlaylistControl()
control.getUserFeed({"user_feed":"playlist"})
assert(sys.modules["__main__"].feeds.listAll.call_count == 0)
示例10: test_getUserFeed_should_call_feeds_list_all
# 需要导入模块: from YouTubePlaylistControl import YouTubePlaylistControl [as 别名]
# 或者: from YouTubePlaylistControl.YouTubePlaylistControl import getUserFeed [as 别名]
def test_getUserFeed_should_call_feeds_list_all(self):
control = YouTubePlaylistControl()
control.getUserFeed({"user_feed":"playlist","playlist":"some_playlist"})
assert(sys.modules["__main__"].feeds.listAll.call_count > 0)