diff --git a/tests/__init__.py b/tests/__init__.py index 5b6369b..3e5793f 100644 --- a/tests/__init__.py +++ b/tests/__init__.py @@ -20,13 +20,21 @@ class Data: name: str = kind.name phys_in: int = kind.ins[0] - 1 - virt_in: int = kind.ins[0] + kind.ins[1] - 1 + virt_in: int = kind.ins[0] + kind.ins[-1] - 1 phys_out: int = kind.outs[0] - 1 - virt_out: int = kind.outs[0] + kind.outs[1] - 1 + virt_out: int = kind.outs[0] + kind.outs[-1] - 1 vban_in: int = kind.vban[0] - 1 - vban_out: int = kind.vban[1] - 1 + vban_out: int = kind.vban[-1] - 1 button_lower: int = 0 button_upper: int = 79 + asio_in: int = kind.asio[0] - 1 + asio_out: int = kind.asio[-1] - 1 + insert_lower: int = 0 + insert_higher: int = kind.insert - 1 + + @property + def channels(self): + return (2 * self.phys_in) + (8 * self.virt_in) data = Data() diff --git a/tests/banana.svg b/tests/banana.svg index e1eecc5..dce994b 100644 --- a/tests/banana.svg +++ b/tests/banana.svg @@ -1 +1 @@ -tests: 122tests122 \ No newline at end of file +tests: 140tests140 \ No newline at end of file diff --git a/tests/basic.svg b/tests/basic.svg index b3c4dcb..c43c07a 100644 --- a/tests/basic.svg +++ b/tests/basic.svg @@ -1 +1 @@ -tests: 112tests112 \ No newline at end of file +tests: 114tests114 \ No newline at end of file diff --git a/tests/potato.svg b/tests/potato.svg index 07b8ac0..6cff4cf 100644 --- a/tests/potato.svg +++ b/tests/potato.svg @@ -1 +1 @@ -tests: 138tests138 \ No newline at end of file +tests: 156tests156 \ No newline at end of file diff --git a/tests/test_configs.py b/tests/test_configs.py index e652d6d..6b4ce6b 100644 --- a/tests/test_configs.py +++ b/tests/test_configs.py @@ -17,6 +17,8 @@ class TestUserConfigs: def test_it_tests_config_string(self): assert "PhysStrip" in tests.strip[data.phys_in].label assert "VirtStrip" in tests.strip[data.virt_in].label + assert "PhysBus" in tests.bus[data.phys_out].label + assert "VirtBus" in tests.bus[data.virt_out].label def test_it_tests_config_bool(self): assert tests.strip[0].A1 == True diff --git a/tests/test_factory.py b/tests/test_factory.py index a12a257..b961ac5 100644 --- a/tests/test_factory.py +++ b/tests/test_factory.py @@ -17,6 +17,7 @@ class TestRemoteFactories: assert hasattr(tests, "button") assert hasattr(tests, "vban") assert hasattr(tests, "device") + assert hasattr(tests, "option") assert len(tests.strip) == 3 assert len(tests.bus) == 2 @@ -34,7 +35,9 @@ class TestRemoteFactories: assert hasattr(tests, "button") assert hasattr(tests, "vban") assert hasattr(tests, "device") + assert hasattr(tests, "option") assert hasattr(tests, "recorder") + assert hasattr(tests, "patch") assert len(tests.strip) == 5 assert len(tests.bus) == 5 @@ -52,7 +55,9 @@ class TestRemoteFactories: assert hasattr(tests, "button") assert hasattr(tests, "vban") assert hasattr(tests, "device") + assert hasattr(tests, "option") assert hasattr(tests, "recorder") + assert hasattr(tests, "patch") assert hasattr(tests, "fx") assert len(tests.strip) == 8 diff --git a/tests/test_higher.py b/tests/test_higher.py index 8bcd783..9e3c9e2 100644 --- a/tests/test_higher.py +++ b/tests/test_higher.py @@ -143,17 +143,54 @@ class TestSetAndGetBoolHigher: @pytest.mark.skipif( data.name != "potato", - reason="Skip test if kind is basic", + reason="Skip test if kind is not potato", ) @pytest.mark.parametrize( "param", [("reverb"), ("reverb_ab"), ("delay"), ("delay_ab")], ) def test_it_sets_and_gets_fx_bool_params(self, param, value): - assert hasattr(tests, "fx") setattr(tests.fx, param, value) assert getattr(tests.fx, param) == value + """ patch tests """ + + @pytest.mark.skipif( + data.name == "basic", + reason="Skip test if kind is basic", + ) + @pytest.mark.parametrize( + "param", + [("postfadercomposite")], + ) + def test_it_sets_and_gets_patch_bool_params(self, param, value): + setattr(tests.patch, param, value) + assert getattr(tests.patch, param) == value + + """ patch.insert tests """ + + @pytest.mark.skipif( + data.name == "basic", + reason="Skip test if kind is basic", + ) + @pytest.mark.parametrize( + "index, param", + [(data.insert_lower, "on"), (data.insert_higher, "on")], + ) + def test_it_sets_and_gets_patch_insert_bool_params(self, index, param, value): + setattr(tests.patch.insert[index], param, value) + assert getattr(tests.patch.insert[index], param) == value + + """ option tests """ + + @pytest.mark.parametrize( + "param", + [("monitoronsel")], + ) + def test_it_sets_and_gets_option_bool_params(self, param, value): + setattr(tests.option, param, value) + assert getattr(tests.option, param) == value + class TestSetAndGetIntHigher: __test__ = True @@ -183,6 +220,78 @@ class TestSetAndGetIntHigher: setattr(tests.vban.outstream[index], param, value) assert getattr(tests.vban.outstream[index], param) == value + """ patch.asio tests """ + + @pytest.mark.skipif( + data.name == "basic", + reason="Skip test if kind is basic", + ) + @pytest.mark.parametrize( + "index,value", + [ + (0, 1), + (data.asio_in, 4), + ], + ) + def test_it_sets_and_gets_patch_asio_in_int_params(self, index, value): + tests.patch.asio[index].set(value) + assert tests.patch.asio[index].get() == value + + """ patch.A2[i]-A5[i] tests """ + + @pytest.mark.skipif( + data.name == "basic", + reason="Skip test if kind is basic", + ) + @pytest.mark.parametrize( + "index,value", + [ + (0, 1), + (data.asio_out, 4), + ], + ) + def test_it_sets_and_gets_patch_asio_out_int_params(self, index, value): + tests.patch.A2[index].set(value) + assert tests.patch.A2[index].get() == value + tests.patch.A5[index].set(value) + assert tests.patch.A5[index].get() == value + + """ patch.composite tests """ + + @pytest.mark.skipif( + data.name == "basic", + reason="Skip test if kind is basic", + ) + @pytest.mark.parametrize( + "index,value", + [ + (0, 3), + (0, data.channels), + (7, 8), + (7, data.channels), + ], + ) + def test_it_sets_and_gets_patch_composite_int_params(self, index, value): + tests.patch.composite[index].set(value) + assert tests.patch.composite[index].get() == value + + """ option tests """ + + @pytest.mark.skipif( + data.name == "basic", + reason="Skip test if kind is basic", + ) + @pytest.mark.parametrize( + "index,value", + [ + (data.phys_out, 30), + (data.phys_out, 500), + ], + ) + def test_it_sets_and_gets_patch_delay_int_params(self, index, value): + tests.option.delay[index].set(value) + assert tests.option.delay[index].get() == value + class TestSetAndGetFloatHigher: __test__ = True