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


Python Connection.connection方法代码示例

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


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

示例1: test_click_video

# 需要导入模块: from gstswitch.connection import Connection [as 别名]
# 或者: from gstswitch.connection.Connection import connection [as 别名]
def test_click_video():
    """Test the click_video method"""
    default_interface = "us.timvideos.gstswitch"
    conn = Connection(default_interface=default_interface)
    conn.connection = MockConnection('click_video')
    with pytest.raises(ConnectionError):
        conn.click_video(1, 2, 3, 4)

    default_interface = "us.timvideos.gstswitch.SwitchControllerInterface"
    conn = Connection(default_interface=default_interface)
    conn.connection = MockConnection('click_video')
    assert conn.click_video(1, 2, 3, 4) == (True,)
开发者ID:techman83,项目名称:gst-switch,代码行数:14,代码来源:test_connection_unit.py

示例2: test_adjust_pip

# 需要导入模块: from gstswitch.connection import Connection [as 别名]
# 或者: from gstswitch.connection.Connection import connection [as 别名]
def test_adjust_pip():
    """Test the adjust_pip method"""
    default_interface = "us.timvideos.gstswitch"
    conn = Connection(default_interface=default_interface)
    conn.connection = MockConnection('adjust_pip')
    with pytest.raises(ConnectionError):
        conn.adjust_pip(1, 2, 3, 4)

    default_interface = "us.timvideos.gstswitch.SwitchControllerInterface"
    conn = Connection(default_interface=default_interface)
    conn.connection = MockConnection('adjust_pip')
    assert conn.adjust_pip(1, 2, 3, 4) == (1,)
开发者ID:techman83,项目名称:gst-switch,代码行数:14,代码来源:test_connection_unit.py

示例3: test_switch

# 需要导入模块: from gstswitch.connection import Connection [as 别名]
# 或者: from gstswitch.connection.Connection import connection [as 别名]
def test_switch():
    """Test the switch method"""
    default_interface = "us.timvideos.gstswitch"
    conn = Connection(default_interface=default_interface)
    conn.connection = MockConnection('switch')
    with pytest.raises(ConnectionError):
        conn.switch(1, 2)

    default_interface = "us.timvideos.gstswitch.SwitchControllerInterface"
    conn = Connection(default_interface=default_interface)
    conn.connection = MockConnection('switch')
    assert conn.switch(1, 2) == (True,)
开发者ID:techman83,项目名称:gst-switch,代码行数:14,代码来源:test_connection_unit.py

示例4: test_set_encode_mode

# 需要导入模块: from gstswitch.connection import Connection [as 别名]
# 或者: from gstswitch.connection.Connection import connection [as 别名]
def test_set_encode_mode():
    """Test the set_encode_mode method"""
    default_interface = "us.timvideos.gstswitch"
    conn = Connection(default_interface=default_interface)
    conn.connection = MockConnection('set_encode_mode')
    with pytest.raises(ConnectionError):
        conn.set_encode_mode(2)

    default_interface = "us.timvideos.gstswitch.SwitchControllerInterface"
    conn = Connection(default_interface=default_interface)
    conn.connection = MockConnection('set_encode_mode')
    assert conn.set_encode_mode(2) == (False,)
开发者ID:techman83,项目名称:gst-switch,代码行数:14,代码来源:test_connection_unit.py

示例5: test_new_record

# 需要导入模块: from gstswitch.connection import Connection [as 别名]
# 或者: from gstswitch.connection.Connection import connection [as 别名]
def test_new_record():
    """Test the new_record method"""
    default_interface = "us.timvideos.gstswitch"
    conn = Connection(default_interface=default_interface)
    conn.connection = MockConnection('new_record')
    with pytest.raises(ConnectionError):
        conn.new_record()

    default_interface = "us.timvideos.gstswitch.SwitchControllerInterface"
    conn = Connection(default_interface=default_interface)
    conn.connection = MockConnection('new_record')
    assert conn.new_record() == (False,)
开发者ID:techman83,项目名称:gst-switch,代码行数:14,代码来源:test_connection_unit.py

示例6: test_get_preview_ports

# 需要导入模块: from gstswitch.connection import Connection [as 别名]
# 或者: from gstswitch.connection.Connection import connection [as 别名]
def test_get_preview_ports():
    """Test the get_preview_ports method"""
    default_interface = "us.timvideos.gstswitch"
    conn = Connection(default_interface=default_interface)
    conn.connection = MockConnection('get_preview_ports')
    with pytest.raises(ConnectionError):
        conn.get_preview_ports()

    default_interface = "us.timvideos.gstswitch.SwitchControllerInterface"
    conn = Connection(default_interface=default_interface)
    conn.connection = MockConnection('get_preview_ports')
    assert conn.get_preview_ports() == ('[(3002, 1, 7), (3003, 1, 8)]',)
开发者ID:techman83,项目名称:gst-switch,代码行数:14,代码来源:test_connection_unit.py

示例7: test_get_composite_mode

# 需要导入模块: from gstswitch.connection import Connection [as 别名]
# 或者: from gstswitch.connection.Connection import connection [as 别名]
def test_get_composite_mode():
    """Test the set_composite_mode method"""
    default_interface = "us.timvideos.gstswitch"
    conn = Connection(default_interface=default_interface)
    conn.connection = MockConnection('get_composite_mode')
    with pytest.raises(ConnectionError):
        conn.get_composite_mode()

    default_interface = "us.timvideos.gstswitch.SwitchControllerInterface"
    conn = Connection(default_interface=default_interface)
    conn.connection = MockConnection('get_composite_mode')
    assert conn.get_composite_mode() == (0,)
开发者ID:techman83,项目名称:gst-switch,代码行数:14,代码来源:test_connection_unit.py

示例8: test_get_audio_port

# 需要导入模块: from gstswitch.connection import Connection [as 别名]
# 或者: from gstswitch.connection.Connection import connection [as 别名]
def test_get_audio_port():
    """Test the get_audio_port method"""
    default_interface = "us.timvideos.gstswitch"
    conn = Connection(default_interface=default_interface)
    conn.connection = MockConnection('get_audio_port')
    with pytest.raises(ConnectionError):
        conn.get_audio_port()

    default_interface = "us.timvideos.gstswitch.SwitchControllerInterface"
    conn = Connection(default_interface=default_interface)
    conn.connection = MockConnection('get_audio_port')
    assert conn.get_audio_port() == (4000,)
开发者ID:techman83,项目名称:gst-switch,代码行数:14,代码来源:test_connection_unit.py

示例9: test_get_compose_port

# 需要导入模块: from gstswitch.connection import Connection [as 别名]
# 或者: from gstswitch.connection.Connection import connection [as 别名]
def test_get_compose_port():
    """Test the get_compose_port method"""
    default_interface = "us.timvideos.gstswitch"
    conn = Connection(default_interface=default_interface)
    conn.connection = MockConnection("get_compose_port")
    with pytest.raises(ConnectionError):
        conn.get_compose_port()

    default_interface = "us.timvideos.gstswitch.SwitchControllerInterface"
    conn = Connection(default_interface=default_interface)
    conn.connection = MockConnection("get_compose_port")
    assert conn.get_compose_port() == (3001,)
开发者ID:a740122,项目名称:gst-switch,代码行数:14,代码来源:test_connection_unit.py

示例10: test_set_composite_mode

# 需要导入模块: from gstswitch.connection import Connection [as 别名]
# 或者: from gstswitch.connection.Connection import connection [as 别名]
def test_set_composite_mode():
    """Test the set_composite_mode method"""
    default_interface = "info.duzy.gst.switch"
    conn = Connection(default_interface=default_interface)
    conn.connection = MockConnection('set_composite_mode')
    with pytest.raises(ConnectionError):
        conn.set_composite_mode(2)

    default_interface = "info.duzy.gst.switch.SwitchControllerInterface"
    conn = Connection(default_interface=default_interface)
    conn.connection = MockConnection('set_composite_mode')
    assert conn.set_composite_mode(2) == (False,)
开发者ID:bossjones,项目名称:gst-switch,代码行数:14,代码来源:test_connection_unit.py

示例11: test_get_encode_port

# 需要导入模块: from gstswitch.connection import Connection [as 别名]
# 或者: from gstswitch.connection.Connection import connection [as 别名]
def test_get_encode_port():
    """Test the get_encode_port method"""
    default_interface = "info.duzy.gst.switch"
    conn = Connection(default_interface=default_interface)
    conn.connection = MockConnection('get_encode_port')
    with pytest.raises(ConnectionError):
        conn.get_encode_port()

    default_interface = "info.duzy.gst.switch.SwitchControllerInterface"
    conn = Connection(default_interface=default_interface)
    conn.connection = MockConnection('get_encode_port')
    assert conn.get_encode_port() == (3002,)
开发者ID:bossjones,项目名称:gst-switch,代码行数:14,代码来源:test_connection_unit.py

示例12: test_mark_tracking

# 需要导入模块: from gstswitch.connection import Connection [as 别名]
# 或者: from gstswitch.connection.Connection import connection [as 别名]
def test_mark_tracking():
    """Test the mark_tracking method"""
    default_interface = "us.timvideos.gstswitch"
    conn = Connection(default_interface=default_interface)
    conn.connection = MockConnection('mark_tracking')
    with pytest.raises(ConnectionError):
        face = [(1, 1, 1, 1), (2, 2, 2, 2)]
        conn.mark_tracking(face)

    default_interface = "us.timvideos.gstswitch.SwitchControllerInterface"
    conn = Connection(default_interface=default_interface)
    conn.connection = MockConnection('mark_tracking')
    face = [(1, 1, 1, 1), (2, 2, 2, 2)]
    assert conn.mark_tracking(face) is None
开发者ID:techman83,项目名称:gst-switch,代码行数:16,代码来源:test_connection_unit.py

示例13: test_mark_face

# 需要导入模块: from gstswitch.connection import Connection [as 别名]
# 或者: from gstswitch.connection.Connection import connection [as 别名]
def test_mark_face():
    """Test the mark_face method"""
    default_interface = "info.duzy.gst.switch"
    conn = Connection(default_interface=default_interface)
    conn.connection = MockConnection('mark_face')
    with pytest.raises(ConnectionError):
        face = [(1, 1, 1, 1), (2, 2, 2, 2)]
        conn.mark_face(face)

    default_interface = "info.duzy.gst.switch.SwitchControllerInterface"
    conn = Connection(default_interface=default_interface)
    conn.connection = MockConnection('mark_face')
    face = [(1, 1, 1, 1), (2, 2, 2, 2)]
    assert conn.mark_face(face) is None
开发者ID:bossjones,项目名称:gst-switch,代码行数:16,代码来源:test_connection_unit.py


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