2022-06-16 16:10:06 +01:00
|
|
|
import time
|
|
|
|
|
2022-04-26 07:16:21 +01:00
|
|
|
import pytest
|
2022-06-16 16:10:06 +01:00
|
|
|
from vban_cmd import kinds
|
|
|
|
|
|
|
|
from tests import data, tests
|
2022-04-26 07:16:21 +01:00
|
|
|
|
|
|
|
|
2022-04-29 22:01:33 +01:00
|
|
|
class TestPublicPacketLower:
|
|
|
|
__test__ = True
|
2022-04-26 07:16:21 +01:00
|
|
|
|
2022-04-29 22:01:33 +01:00
|
|
|
"""Tests for a valid rt data packet"""
|
2022-04-26 07:16:21 +01:00
|
|
|
|
2022-04-29 22:01:33 +01:00
|
|
|
def test_it_gets_an_rt_data_packet(self):
|
2022-06-16 16:10:06 +01:00
|
|
|
assert tests.public_packet.voicemeetertype in (
|
|
|
|
kind.name for kind in kinds.kinds_all
|
|
|
|
)
|
2022-04-26 07:16:21 +01:00
|
|
|
|
|
|
|
|
2022-06-16 16:10:06 +01:00
|
|
|
@pytest.mark.skipif(
|
|
|
|
"not config.getoption('--run-slow')",
|
|
|
|
reason="Only run when --run-slow is given",
|
|
|
|
)
|
2022-04-26 07:16:21 +01:00
|
|
|
@pytest.mark.parametrize("value", [0, 1])
|
2022-04-29 22:01:33 +01:00
|
|
|
class TestSetRT:
|
|
|
|
__test__ = True
|
2022-04-26 07:16:21 +01:00
|
|
|
|
2022-04-29 22:01:33 +01:00
|
|
|
"""Tests set_rt"""
|
2022-04-26 07:16:21 +01:00
|
|
|
|
|
|
|
@pytest.mark.parametrize(
|
2022-04-29 22:01:33 +01:00
|
|
|
"kls,index,param",
|
|
|
|
[
|
|
|
|
("strip", data.phys_in, "mute"),
|
|
|
|
("bus", data.virt_out, "mono"),
|
|
|
|
],
|
2022-04-26 07:16:21 +01:00
|
|
|
)
|
2022-06-16 16:10:06 +01:00
|
|
|
def test_it_sends_a_text_request(self, kls, index, param, value):
|
|
|
|
tests._set_rt(f"{kls}[{index}]", param, value)
|
2022-07-16 21:54:41 +01:00
|
|
|
time.sleep(0.02)
|
2022-04-29 22:01:33 +01:00
|
|
|
target = getattr(tests, kls)[index]
|
|
|
|
assert getattr(target, param) == bool(value)
|