vban-cmd-python/tests/test_lower.py

35 lines
828 B
Python
Raw Normal View History

import pytest
2023-06-25 14:23:39 +01:00
from tests import data, vban
from vban_cmd import kinds
2022-04-29 22:01:33 +01:00
class TestPublicPacketLower:
__test__ = True
2022-04-29 22:01:33 +01:00
"""Tests for a valid rt data packet"""
2022-04-29 22:01:33 +01:00
def test_it_gets_an_rt_data_packet(self):
2023-06-25 14:23:39 +01:00
assert vban.public_packet.voicemeetertype in (
kind.name for kind in kinds.kinds_all
)
@pytest.mark.parametrize('value', [0, 1])
2022-04-29 22:01:33 +01:00
class TestSetRT:
__test__ = True
2022-04-29 22:01:33 +01:00
"""Tests set_rt"""
@pytest.mark.parametrize(
'kls,index,param',
2022-04-29 22:01:33 +01:00
[
('strip', data.phys_in, 'mute'),
('bus', data.virt_out, 'mono'),
2022-04-29 22:01:33 +01:00
],
)
def test_it_sends_a_text_request(self, kls, index, param, value):
vban._set_rt(f'{kls}[{index}].{param}', value)
2023-06-25 14:23:39 +01:00
target = getattr(vban, kls)[index]
2022-04-29 22:01:33 +01:00
assert getattr(target, param) == bool(value)