2022-04-26 07:16:21 +01:00
|
|
|
import pytest
|
2022-06-16 16:10:06 +01:00
|
|
|
|
2023-06-25 14:23:39 +01:00
|
|
|
from tests import data, vban
|
2022-04-26 07:16:21 +01:00
|
|
|
|
|
|
|
|
2025-01-17 15:01:40 +00:00
|
|
|
@pytest.mark.parametrize('value', [False, True])
|
2022-04-26 07:16:21 +01:00
|
|
|
class TestSetAndGetBoolHigher:
|
|
|
|
__test__ = True
|
|
|
|
|
|
|
|
"""strip tests, physical and virtual"""
|
|
|
|
|
|
|
|
@pytest.mark.parametrize(
|
2025-01-17 15:01:40 +00:00
|
|
|
'index,param',
|
2022-04-26 07:16:21 +01:00
|
|
|
[
|
2025-01-17 15:01:40 +00:00
|
|
|
(data.phys_in, 'mute'),
|
|
|
|
(data.virt_in, 'solo'),
|
2022-04-26 07:16:21 +01:00
|
|
|
],
|
|
|
|
)
|
|
|
|
def test_it_sets_and_gets_strip_bool_params(self, index, param, value):
|
2023-06-25 14:23:39 +01:00
|
|
|
setattr(vban.strip[index], param, value)
|
|
|
|
assert getattr(vban.strip[index], param) == value
|
2022-04-26 07:16:21 +01:00
|
|
|
|
2022-06-16 16:10:06 +01:00
|
|
|
@pytest.mark.skipif(
|
2025-01-17 15:01:40 +00:00
|
|
|
data.name == 'banana',
|
|
|
|
reason='Only test if logged into Basic or Potato version',
|
2022-06-16 16:10:06 +01:00
|
|
|
)
|
|
|
|
@pytest.mark.parametrize(
|
2025-01-17 15:01:40 +00:00
|
|
|
'index,param',
|
2022-06-16 16:10:06 +01:00
|
|
|
[
|
2025-01-17 15:01:40 +00:00
|
|
|
(data.phys_in, 'mc'),
|
2022-06-16 16:10:06 +01:00
|
|
|
],
|
|
|
|
)
|
|
|
|
def test_it_sets_and_gets_strip_bool_params_mc(self, index, param, value):
|
2023-06-25 14:23:39 +01:00
|
|
|
setattr(vban.strip[index], param, value)
|
|
|
|
assert getattr(vban.strip[index], param) == value
|
2022-06-16 16:10:06 +01:00
|
|
|
|
2022-04-26 07:16:21 +01:00
|
|
|
""" bus tests, physical and virtual """
|
|
|
|
|
|
|
|
@pytest.mark.parametrize(
|
2025-01-17 15:01:40 +00:00
|
|
|
'index,param',
|
2022-04-26 07:16:21 +01:00
|
|
|
[
|
2025-01-17 15:01:40 +00:00
|
|
|
(data.phys_out, 'mute'),
|
2022-04-26 07:16:21 +01:00
|
|
|
],
|
|
|
|
)
|
|
|
|
def test_it_sets_and_gets_bus_bool_params(self, index, param, value):
|
2023-06-25 14:24:04 +01:00
|
|
|
assert hasattr(vban.bus[index], param)
|
2023-06-25 14:23:39 +01:00
|
|
|
setattr(vban.bus[index], param, value)
|
|
|
|
assert getattr(vban.bus[index], param) == value
|
2022-04-26 07:16:21 +01:00
|
|
|
|
|
|
|
""" bus modes tests, physical and virtual """
|
|
|
|
|
|
|
|
@pytest.mark.parametrize(
|
2025-01-17 15:01:40 +00:00
|
|
|
'index,param',
|
2022-04-26 07:16:21 +01:00
|
|
|
[
|
2025-01-17 15:01:40 +00:00
|
|
|
(data.phys_out, 'normal'),
|
|
|
|
(data.phys_out, 'amix'),
|
|
|
|
(data.phys_out, 'rearonly'),
|
|
|
|
(data.virt_out, 'normal'),
|
|
|
|
(data.virt_out, 'upmix41'),
|
|
|
|
(data.virt_out, 'composite'),
|
2022-04-26 07:16:21 +01:00
|
|
|
],
|
|
|
|
)
|
2025-01-17 15:01:40 +00:00
|
|
|
def test_it_sets_and_gets_bus_mode_bool_params(self, index, param, value):
|
2022-04-26 07:16:21 +01:00
|
|
|
# here it only makes sense to set/get bus modes as True
|
|
|
|
if not value:
|
|
|
|
value = True
|
2023-06-25 14:23:39 +01:00
|
|
|
setattr(vban.bus[index].mode, param, value)
|
|
|
|
assert getattr(vban.bus[index].mode, param) == value
|
2022-04-26 07:16:21 +01:00
|
|
|
|
|
|
|
""" command tests """
|
|
|
|
|
|
|
|
@pytest.mark.parametrize(
|
2025-01-17 15:01:40 +00:00
|
|
|
'param',
|
|
|
|
[('lock')],
|
2022-04-26 07:16:21 +01:00
|
|
|
)
|
|
|
|
def test_it_sets_command_bool_params(self, param, value):
|
2023-06-25 14:23:39 +01:00
|
|
|
setattr(vban.command, param, value)
|
2022-04-26 07:16:21 +01:00
|
|
|
|
|
|
|
|
|
|
|
class TestSetAndGetIntHigher:
|
|
|
|
# note, currently no int parameters supported by rt packet service
|
|
|
|
# ie they can be set but not get
|
|
|
|
__test__ = False
|
|
|
|
|
|
|
|
"""strip tests, physical and virtual"""
|
|
|
|
|
|
|
|
@pytest.mark.parametrize(
|
2025-01-17 15:01:40 +00:00
|
|
|
'index,param,value',
|
2022-04-26 07:16:21 +01:00
|
|
|
[
|
2025-01-17 15:01:40 +00:00
|
|
|
(data.virt_in, 'k', 0),
|
|
|
|
(data.virt_in, 'k', 4),
|
2022-04-26 07:16:21 +01:00
|
|
|
],
|
|
|
|
)
|
|
|
|
def test_it_sets_and_gets_strip_bool_params(self, index, param, value):
|
2023-06-25 14:23:39 +01:00
|
|
|
setattr(vban.strip[index], param, value)
|
|
|
|
assert getattr(vban.strip[index], param) == value
|
2022-04-26 07:16:21 +01:00
|
|
|
|
|
|
|
|
|
|
|
class TestSetAndGetFloatHigher:
|
|
|
|
__test__ = True
|
|
|
|
|
|
|
|
"""strip tests, physical and virtual"""
|
|
|
|
|
|
|
|
@pytest.mark.parametrize(
|
2025-01-17 15:01:40 +00:00
|
|
|
'index,param,value',
|
2022-04-26 07:16:21 +01:00
|
|
|
[
|
2025-01-17 15:01:40 +00:00
|
|
|
(data.phys_in, 'gain', -3.6),
|
|
|
|
(data.phys_in, 'gain', 3.6),
|
|
|
|
(data.virt_in, 'gain', -5.8),
|
|
|
|
(data.virt_in, 'gain', 5.8),
|
2022-04-26 07:16:21 +01:00
|
|
|
],
|
|
|
|
)
|
|
|
|
def test_it_sets_and_gets_strip_float_params(self, index, param, value):
|
2023-06-25 14:23:39 +01:00
|
|
|
setattr(vban.strip[index], param, value)
|
|
|
|
assert getattr(vban.strip[index], param) == value
|
2022-04-26 07:16:21 +01:00
|
|
|
|
|
|
|
@pytest.mark.parametrize(
|
2025-01-17 15:01:40 +00:00
|
|
|
'index,value',
|
2022-04-26 07:16:21 +01:00
|
|
|
[(data.phys_in, 2), (data.phys_in, 2), (data.virt_in, 8), (data.virt_in, 8)],
|
|
|
|
)
|
2025-01-17 15:01:40 +00:00
|
|
|
def test_it_gets_strip_prefader_levels_and_compares_length_of_array(
|
|
|
|
self, index, value
|
|
|
|
):
|
2023-06-25 14:23:39 +01:00
|
|
|
assert len(vban.strip[index].levels.prefader) == value
|
2022-04-26 07:16:21 +01:00
|
|
|
|
|
|
|
@pytest.mark.skipif(
|
2025-01-17 15:01:40 +00:00
|
|
|
data.name != 'potato',
|
|
|
|
reason='Only test if logged into Potato version',
|
2022-04-26 07:16:21 +01:00
|
|
|
)
|
|
|
|
@pytest.mark.parametrize(
|
2025-01-17 15:01:40 +00:00
|
|
|
'index, j, value',
|
2022-04-26 07:16:21 +01:00
|
|
|
[
|
|
|
|
(data.phys_in, 0, -20.7),
|
|
|
|
(data.virt_in, 3, -60),
|
|
|
|
(data.virt_in, 4, 3.6),
|
|
|
|
(data.phys_in, 4, -12.7),
|
|
|
|
],
|
|
|
|
)
|
|
|
|
def test_it_sets_and_gets_strip_gainlayer_values(self, index, j, value):
|
2023-06-25 14:23:39 +01:00
|
|
|
vban.strip[index].gainlayer[j].gain = value
|
|
|
|
assert vban.strip[index].gainlayer[j].gain == value
|
2022-04-26 07:16:21 +01:00
|
|
|
|
2023-06-25 14:24:04 +01:00
|
|
|
""" strip tests, physical """
|
|
|
|
|
|
|
|
@pytest.mark.skipif(
|
2025-01-17 15:01:40 +00:00
|
|
|
data.name != 'potato',
|
|
|
|
reason='Only test if logged into Potato version',
|
2023-06-25 14:24:04 +01:00
|
|
|
)
|
|
|
|
@pytest.mark.parametrize(
|
2025-01-17 15:01:40 +00:00
|
|
|
'index, param, value',
|
2023-06-25 14:24:04 +01:00
|
|
|
[
|
2025-01-17 15:01:40 +00:00
|
|
|
(data.phys_in, 'gainin', -8.6),
|
|
|
|
(data.phys_in, 'knee', 0.24),
|
2023-06-25 14:24:04 +01:00
|
|
|
],
|
|
|
|
)
|
|
|
|
def test_it_sets_strip_comp_params(self, index, param, value):
|
|
|
|
assert hasattr(vban.strip[index].comp, param)
|
|
|
|
setattr(vban.strip[index].comp, param, value)
|
|
|
|
# we can set but not get this value. Not in RT Packet.
|
|
|
|
|
|
|
|
@pytest.mark.skipif(
|
2025-01-17 15:01:40 +00:00
|
|
|
data.name != 'potato',
|
|
|
|
reason='Only test if logged into Potato version',
|
2023-06-25 14:24:04 +01:00
|
|
|
)
|
|
|
|
@pytest.mark.parametrize(
|
2025-01-17 15:01:40 +00:00
|
|
|
'index, param, value',
|
2023-06-25 14:24:04 +01:00
|
|
|
[
|
2025-01-17 15:01:40 +00:00
|
|
|
(data.phys_in, 'bpsidechain', 120),
|
|
|
|
(data.phys_in, 'hold', 3000),
|
2023-06-25 14:24:04 +01:00
|
|
|
],
|
|
|
|
)
|
|
|
|
def test_it_sets_and_gets_strip_gate_params(self, index, param, value):
|
|
|
|
assert hasattr(vban.strip[index].gate, param)
|
|
|
|
setattr(vban.strip[index].gate, param, value)
|
|
|
|
# we can set but not get this value. Not in RT Packet.
|
|
|
|
|
2022-04-26 07:16:21 +01:00
|
|
|
""" strip tests, virtual """
|
|
|
|
|
|
|
|
@pytest.mark.parametrize(
|
2025-01-17 15:01:40 +00:00
|
|
|
'index, param, value',
|
2022-04-26 07:16:21 +01:00
|
|
|
[
|
2025-01-17 15:01:40 +00:00
|
|
|
(data.virt_in, 'treble', -1.6),
|
|
|
|
(data.virt_in, 'mid', 5.8),
|
|
|
|
(data.virt_in, 'bass', -8.1),
|
2022-04-26 07:16:21 +01:00
|
|
|
],
|
|
|
|
)
|
|
|
|
def test_it_sets_and_gets_strip_eq_params(self, index, param, value):
|
2023-06-25 14:23:39 +01:00
|
|
|
setattr(vban.strip[index], param, value)
|
|
|
|
assert getattr(vban.strip[index], param) == value
|
2022-04-26 07:16:21 +01:00
|
|
|
|
|
|
|
""" bus tests, physical and virtual """
|
|
|
|
|
|
|
|
@pytest.mark.parametrize(
|
2025-01-17 15:01:40 +00:00
|
|
|
'index, param, value',
|
|
|
|
[(data.phys_out, 'gain', -3.6), (data.virt_out, 'gain', 5.8)],
|
2022-04-26 07:16:21 +01:00
|
|
|
)
|
|
|
|
def test_it_sets_and_gets_bus_float_params(self, index, param, value):
|
2023-06-25 14:23:39 +01:00
|
|
|
setattr(vban.bus[index], param, value)
|
|
|
|
assert getattr(vban.bus[index], param) == value
|
2022-04-26 07:16:21 +01:00
|
|
|
|
|
|
|
@pytest.mark.parametrize(
|
2025-01-17 15:01:40 +00:00
|
|
|
'index,value',
|
2022-04-26 07:16:21 +01:00
|
|
|
[(data.phys_out, 8), (data.virt_out, 8)],
|
|
|
|
)
|
2025-01-17 15:01:40 +00:00
|
|
|
def test_it_gets_bus_levels_and_compares_length_of_array(self, index, value):
|
2023-06-25 14:23:39 +01:00
|
|
|
assert len(vban.bus[index].levels.all) == value
|
2022-04-26 07:16:21 +01:00
|
|
|
|
|
|
|
|
2025-01-17 15:01:40 +00:00
|
|
|
@pytest.mark.parametrize('value', ['test0', 'test1'])
|
2022-04-26 07:16:21 +01:00
|
|
|
class TestSetAndGetStringHigher:
|
|
|
|
__test__ = True
|
|
|
|
|
|
|
|
"""strip tests, physical and virtual"""
|
|
|
|
|
|
|
|
@pytest.mark.parametrize(
|
2025-01-17 15:01:40 +00:00
|
|
|
'index, param',
|
|
|
|
[(data.phys_in, 'label'), (data.virt_in, 'label')],
|
2022-04-26 07:16:21 +01:00
|
|
|
)
|
|
|
|
def test_it_sets_and_gets_strip_string_params(self, index, param, value):
|
2023-06-25 14:23:39 +01:00
|
|
|
setattr(vban.strip[index], param, value)
|
|
|
|
assert getattr(vban.strip[index], param) == value
|
2022-04-26 07:16:21 +01:00
|
|
|
|
|
|
|
""" bus tests, physical and virtual """
|
|
|
|
|
|
|
|
@pytest.mark.parametrize(
|
2025-01-17 15:01:40 +00:00
|
|
|
'index, param',
|
|
|
|
[(data.phys_out, 'label'), (data.virt_out, 'label')],
|
2022-04-26 07:16:21 +01:00
|
|
|
)
|
|
|
|
def test_it_sets_and_gets_bus_string_params(self, index, param, value):
|
2023-06-25 14:23:39 +01:00
|
|
|
setattr(vban.bus[index], param, value)
|
|
|
|
assert getattr(vban.bus[index], param) == value
|