本文整理汇总了Python中YouTubePlayer.YouTubePlayer.userSelectsVideoQuality方法的典型用法代码示例。如果您正苦于以下问题:Python YouTubePlayer.userSelectsVideoQuality方法的具体用法?Python YouTubePlayer.userSelectsVideoQuality怎么用?Python YouTubePlayer.userSelectsVideoQuality使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类YouTubePlayer.YouTubePlayer
的用法示例。
在下文中一共展示了YouTubePlayer.userSelectsVideoQuality方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: test_selectVideoQuality_should_call_userSelectsVideoQuality_if_user_selected_that_option
# 需要导入模块: from YouTubePlayer import YouTubePlayer [as 别名]
# 或者: from YouTubePlayer.YouTubePlayer import userSelectsVideoQuality [as 别名]
def test_selectVideoQuality_should_call_userSelectsVideoQuality_if_user_selected_that_option(self):
sys.modules["__main__"].settings.getSetting.return_value = "0"
player = YouTubePlayer()
player.userSelectsVideoQuality = Mock()
player.selectVideoQuality({},{35: "SD", 22: "720p", 37: "1080p"})
player.userSelectsVideoQuality.assert_called_with({}, {35: 'SD', 37: '1080p', 22: '720p'})
示例2: test_userSelectsVideoQuality_should_prefer_h264_over_vp8_as_appletv2_cant_handle_vp8_properly
# 需要导入模块: from YouTubePlayer import YouTubePlayer [as 别名]
# 或者: from YouTubePlayer.YouTubePlayer import userSelectsVideoQuality [as 别名]
def test_userSelectsVideoQuality_should_prefer_h264_over_vp8_as_appletv2_cant_handle_vp8_properly(self):
sys.modules["__main__"].settings.getSetting.return_value = "1"
sys.modules["__main__"].xbmcgui.Dialog().select.return_value = 0
sys.modules["__main__"].language.return_value = ""
player = YouTubePlayer()
url = player.userSelectsVideoQuality({}, {22: "h264", 45: "vp8"})
assert(url == "h264")
示例3: test_userSelectsVideoQuality_should_append_list_of_known_qualities
# 需要导入模块: from YouTubePlayer import YouTubePlayer [as 别名]
# 或者: from YouTubePlayer.YouTubePlayer import userSelectsVideoQuality [as 别名]
def test_userSelectsVideoQuality_should_append_list_of_known_qualities(self):
sys.modules["__main__"].settings.getSetting.return_value = "1"
sys.modules["__main__"].xbmcgui.Dialog().select.return_value = -1
sys.modules["__main__"].language.return_value = ""
player = YouTubePlayer()
url = player.userSelectsVideoQuality({}, {35: u"SD", 22: u"720p", 37: u"1080p", 35: u"480p", 18: u"380p", 34: u"360p", 5: u"240p", 17: u"144p"})
print repr(url)
sys.modules["__main__"].xbmcgui.Dialog().select.assert_any_call("", [u"1080p", u"720p", u"480p", u"380p", u"360p", u"240p", u"144p"])
示例4: test_userSelectsVideoQuality_should_call_xbmc_dialog_select_to_ask_for_user_input
# 需要导入模块: from YouTubePlayer import YouTubePlayer [as 别名]
# 或者: from YouTubePlayer.YouTubePlayer import userSelectsVideoQuality [as 别名]
def test_userSelectsVideoQuality_should_call_xbmc_dialog_select_to_ask_for_user_input(self):
sys.modules["__main__"].settings.getSetting.return_value = "1"
sys.modules["__main__"].xbmcgui.Dialog().select.return_value = -1
sys.modules["__main__"].language.return_value = ""
player = YouTubePlayer()
url = player.userSelectsVideoQuality({}, {35: "SD", 22: "720p", 37: "1080p"})
print repr(url)
assert(sys.modules["__main__"].xbmcgui.Dialog().select.call_count > 0)
示例5: test_userSelectsVideoQuality_should_select_proper_quality_based_on_user_input
# 需要导入模块: from YouTubePlayer import YouTubePlayer [as 别名]
# 或者: from YouTubePlayer.YouTubePlayer import userSelectsVideoQuality [as 别名]
def test_userSelectsVideoQuality_should_select_proper_quality_based_on_user_input(self):
player = YouTubePlayer()
sys.modules["__main__"].settings.getSetting.return_value = "1"
sys.modules["__main__"].xbmcgui.Dialog().select.return_value = 0
sys.modules["__main__"].language.return_value = ""
sys.modules["__main__"].common.makeUTF8.return_value = "bla"
url = player.userSelectsVideoQuality({}, {35: u"SD", 22: u"720p", 37: u"1080p"})
sys.modules["__main__"].xbmcgui.Dialog().select.assert_called_with("", [u"1080p", u"720p", u"480p"])
assert(url == "1080p")