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, )
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,)
Esempio n. 3
0
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, )
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,)
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,)
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,)
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,)
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,)
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,)
Esempio n. 10
0
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)]',)
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, )
Esempio n. 12
0
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,)
Esempio n. 13
0
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,)
Esempio n. 14
0
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, )
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, )
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, )
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, )
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, )
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)]', )
Esempio n. 20
0
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,)
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, )
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
Esempio n. 23
0
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
Esempio n. 24
0
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
Esempio n. 25
0
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