本文整理汇总了Python中gstswitch.controller.Controller.connection方法的典型用法代码示例。如果您正苦于以下问题:Python Controller.connection方法的具体用法?Python Controller.connection怎么用?Python Controller.connection使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类gstswitch.controller.Controller
的用法示例。
在下文中一共展示了Controller.connection方法的8个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: test_unpack
# 需要导入模块: from gstswitch.controller import Controller [as 别名]
# 或者: from gstswitch.controller.Controller import connection [as 别名]
def test_unpack(self):
"""Test if unpack fails"""
controller = Controller(address='unix:abstract=abcde')
controller.establish_connection = Mock(return_value=None)
controller.connection = MockConnection(True)
with pytest.raises(ConnectionReturnError):
controller.click_video(1, 2, 3, 4)
示例2: test_normal
# 需要导入模块: from gstswitch.controller import Controller [as 别名]
# 或者: from gstswitch.controller.Controller import connection [as 别名]
def test_normal(self):
"""Test if valid"""
controller = Controller(address='unix:abstract=abcde')
controller.establish_connection = Mock(return_value=None)
controller.connection = MockConnection(True)
face = [(1, 2, 3, 4), (1, 1, 1, 1)]
controller.mark_tracking(face)
示例3: test_unpack
# 需要导入模块: from gstswitch.controller import Controller [as 别名]
# 或者: from gstswitch.controller.Controller import connection [as 别名]
def test_unpack(self):
"""Test if unpack fails"""
controller = Controller(address='unix:abstract=abcde')
controller.establish_connection = Mock(return_value=None)
controller.connection = MockConnection(True)
with pytest.raises(ConnectionReturnError):
controller.switch(Controller.VIDEO_CHANNEL_A, 2)
示例4: test_action_fails
# 需要导入模块: from gstswitch.controller import Controller [as 别名]
# 或者: from gstswitch.controller.Controller import connection [as 别名]
def test_action_fails(self):
"""Test what happens if the requested action fails"""
controller = Controller(address='unix:abstract=abcde')
controller.establish_connection = Mock(return_value=None)
controller.connection = MockConnection(
return_variant=True, should_fail=True)
assert controller.click_video(1, 2, 3, 4) is False
示例5: test_unpack
# 需要导入模块: from gstswitch.controller import Controller [as 别名]
# 或者: from gstswitch.controller.Controller import connection [as 别名]
def test_unpack(self):
"""Test if unpack fails"""
controller = Controller(address='unix:abstract=abcde')
controller.establish_connection = Mock(return_value=None)
controller.connection = MockConnection(return_variant=False)
with pytest.raises(ConnectionReturnError):
controller.new_record()
示例6: test_normal_unpack
# 需要导入模块: from gstswitch.controller import Controller [as 别名]
# 或者: from gstswitch.controller.Controller import connection [as 别名]
def test_normal_unpack(self):
"""Test if valid"""
controller = Controller(address='unix:abstract=abcdef')
controller.establish_connection = Mock(return_value=None)
controller.connection = MockConnection(False)
assert controller.switch(Controller.VIDEO_CHANNEL_A, 2) is True
示例7: test_normal_unpack
# 需要导入模块: from gstswitch.controller import Controller [as 别名]
# 或者: from gstswitch.controller.Controller import connection [as 别名]
def test_normal_unpack(self):
"""Test if valid"""
controller = Controller(address='unix:abstract=abcdef')
controller.establish_connection = Mock(return_value=None)
controller.connection = MockConnection(False)
assert controller.set_composite_mode(1) is True
示例8: test_normal_unpack
# 需要导入模块: from gstswitch.controller import Controller [as 别名]
# 或者: from gstswitch.controller.Controller import connection [as 别名]
def test_normal_unpack(self):
"""Test if valid"""
controller = Controller(address='unix:abstract=abcdef')
controller.establish_connection = Mock(return_value=None)
controller.connection = MockConnection(return_variant=True)
assert controller.adjust_pip(1, 2, 3, 4) == 1