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


Python YouTubePlaylistControl.createPlaylist方法代码示例

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


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

示例1: test_createPlayList_should_not_call_addPlaylist_if_user_cancels

# 需要导入模块: from YouTubePlaylistControl import YouTubePlaylistControl [as 别名]
# 或者: from YouTubePlaylistControl.YouTubePlaylistControl import createPlaylist [as 别名]
 def test_createPlayList_should_not_call_addPlaylist_if_user_cancels(self):
     sys.modules["__main__"].common.getUserInput.return_value = ""
     sys.modules["__main__"].xbmcgui.Dialog().select.return_value = 1
     sys.modules["__main__"].language.return_value = "my_string"
     control = YouTubePlaylistControl()
     
     control.createPlaylist({})
     
     assert(sys.modules["__main__"].core.add_playlist.call_count == 0)
开发者ID:BlackSmith,项目名称:youtube-xbmc-plugin,代码行数:11,代码来源:TestYouTubePlaylistControl.py

示例2: test_createPlayList_should_call_addPlaylist_if_user_provided_playlist_name

# 需要导入模块: from YouTubePlaylistControl import YouTubePlaylistControl [as 别名]
# 或者: from YouTubePlaylistControl.YouTubePlaylistControl import createPlaylist [as 别名]
 def test_createPlayList_should_call_addPlaylist_if_user_provided_playlist_name(self):
     sys.modules["__main__"].common.getUserInput.return_value = "my_playlist_name"
     sys.modules["__main__"].xbmcgui.Dialog().select.return_value = 1
     sys.modules["__main__"].language.return_value = "my_string"
     control = YouTubePlaylistControl()
     
     control.createPlaylist({})
     
     sys.modules["__main__"].core.add_playlist.assert_called_with({"title":"my_playlist_name"})
开发者ID:BlackSmith,项目名称:youtube-xbmc-plugin,代码行数:11,代码来源:TestYouTubePlaylistControl.py

示例3: test_createPlayList_should_ask_user_for_input

# 需要导入模块: from YouTubePlaylistControl import YouTubePlaylistControl [as 别名]
# 或者: from YouTubePlaylistControl.YouTubePlaylistControl import createPlaylist [as 别名]
 def test_createPlayList_should_ask_user_for_input(self):
     sys.modules["__main__"].common.getUserInput.return_value = ""
     sys.modules["__main__"].xbmcgui.Dialog().select.return_value = 1
     sys.modules["__main__"].language.return_value = "my_string"
     control = YouTubePlaylistControl()
     
     control.createPlaylist({})
     
     sys.modules["__main__"].common.getUserInput.assert_called_with("my_string")
     sys.modules["__main__"].language.assert_called_with(30529)
开发者ID:BlackSmith,项目名称:youtube-xbmc-plugin,代码行数:12,代码来源:TestYouTubePlaylistControl.py

示例4: test_addToPlaylist_should_call_createPlaylist_if_user_selects_create_option

# 需要导入模块: from YouTubePlaylistControl import YouTubePlaylistControl [as 别名]
# 或者: from YouTubePlaylistControl.YouTubePlaylistControl import createPlaylist [as 别名]
 def test_addToPlaylist_should_call_createPlaylist_if_user_selects_create_option(self):
     sys.modules["__main__"].xbmcgui.Dialog().select.return_value = 0
     sys.modules["__main__"].feeds.listAll.return_value = ([{"Title":"PlayList1"},{"Title":"PlayList2"}])
     control = YouTubePlaylistControl()
     control.createPlaylist = Mock()
     
     control.addToPlaylist({})
     
     control.createPlaylist.assert_called_with({'user_feed': 'playlists', 'login': 'true', 'folder': 'true'})
开发者ID:BlackSmith,项目名称:youtube-xbmc-plugin,代码行数:11,代码来源:TestYouTubePlaylistControl.py


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