本文整理汇总了Python中gstswitch.controller.Controller.parse_preview_ports方法的典型用法代码示例。如果您正苦于以下问题:Python Controller.parse_preview_ports方法的具体用法?Python Controller.parse_preview_ports怎么用?Python Controller.parse_preview_ports使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类gstswitch.controller.Controller
的用法示例。
在下文中一共展示了Controller.parse_preview_ports方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: test_normal
# 需要导入模块: from gstswitch.controller import Controller [as 别名]
# 或者: from gstswitch.controller.Controller import parse_preview_ports [as 别名]
def test_normal(self):
"""Test if valid"""
controller = Controller(address='unix:abstract=abcde')
test = '[(1, 2, 3), (2, 2, 2)]'
assert controller.parse_preview_ports(test) == [1, 2]
示例2: test_value_error
# 需要导入模块: from gstswitch.controller import Controller [as 别名]
# 或者: from gstswitch.controller.Controller import parse_preview_ports [as 别名]
def test_value_error(self):
"""Test if invalid"""
controller = Controller(address='unix:abstract=abcde')
test = 1234
with pytest.raises(ConnectionReturnError):
controller.parse_preview_ports(test)
示例3: test_syntax_error
# 需要导入模块: from gstswitch.controller import Controller [as 别名]
# 或者: from gstswitch.controller.Controller import parse_preview_ports [as 别名]
def test_syntax_error(self):
"""Test if syntax error detected"""
controller = Controller(address='unix:abstract=abcde')
test = '{}[]'
with pytest.raises(ConnectionReturnError):
controller.parse_preview_ports(test)
示例4: test_normal_unpack
# 需要导入模块: from gstswitch.controller import Controller [as 别名]
# 或者: from gstswitch.controller.Controller import parse_preview_ports [as 别名]
def test_normal_unpack(self):
"""Test if valid"""
controller = Controller(address='unix:abstract=abcdef')
controller.connection = MockConnection(False)
controller.parse_preview_ports = Mock(return_value=[3001, 3002])
assert controller.get_preview_ports() == [3001, 3002]