From fd21503437a3d6a24aa2f2ca029684b76b9b71f6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jos=C3=A9phine=20Wolf=20Oberholtzer?= Date: Sat, 21 Dec 2024 12:26:17 -0500 Subject: [PATCH] Testing --- supriya/mixers/tracks.py | 4 ++++ tests/mixers/test_Track.py | 35 ++++++++++++++++++----------------- 2 files changed, 22 insertions(+), 17 deletions(-) diff --git a/supriya/mixers/tracks.py b/supriya/mixers/tracks.py index 86549689b..df83eafd1 100644 --- a/supriya/mixers/tracks.py +++ b/supriya/mixers/tracks.py @@ -468,6 +468,10 @@ def input_levels(self) -> Tuple[float, ...]: return context._shm[bus.id_ : bus.id_ + len(bus)] return (0.0,) * 2 + @property + def is_active(self) -> bool: + return self._is_active + @property def output(self) -> Optional[Union[BusGroup, Default, TrackContainer]]: return self._output._target diff --git a/tests/mixers/test_Track.py b/tests/mixers/test_Track.py index 3e0458af0..ff7ca9446 100644 --- a/tests/mixers/test_Track.py +++ b/tests/mixers/test_Track.py @@ -1332,20 +1332,20 @@ async def test_Track_set_input( @pytest.mark.parametrize("online", [False, True]) @pytest.mark.parametrize( - "target, muted, expected_commands, expected_levels", + "target, muted, expected_commands, expected_state", [ ( "mixers[0].tracks[0]", True, [OscMessage("/c_set", 5, 0.0)], [ - ("m[0].t[0]", (0.0, 0.0)), - ("m[0].t[0].t[0]", (1.0, 1.0)), - ("m[0].t[0].t[0].t[0]", (1.0, 1.0)), - ("m[0].t[0].t[1]", (0.0, 0.0)), - ("m[0].t[1]", (0.0, 0.0)), - ("m[0].t[2]", (0.0, 0.0)), - ("m[1].t[0]", (0.0, 0.0)), + ("m[0].t[0]", (0.0, 0.0), False), + ("m[0].t[0].t[0]", (1.0, 1.0), True), + ("m[0].t[0].t[0].t[0]", (1.0, 1.0), True), + ("m[0].t[0].t[1]", (0.0, 0.0), True), + ("m[0].t[1]", (0.0, 0.0), True), + ("m[0].t[2]", (0.0, 0.0), True), + ("m[1].t[0]", (0.0, 0.0), True), ], ), ( @@ -1353,13 +1353,13 @@ async def test_Track_set_input( True, [OscMessage("/c_set", 11, 0.0)], [ - ("m[0].t[0]", (0.0, 0.0)), - ("m[0].t[0].t[0]", (0.0, 0.0)), - ("m[0].t[0].t[0].t[0]", (1.0, 1.0)), - ("m[0].t[0].t[1]", (0.0, 0.0)), - ("m[0].t[1]", (0.0, 0.0)), - ("m[0].t[2]", (0.0, 0.0)), - ("m[1].t[0]", (0.0, 0.0)), + ("m[0].t[0]", (0.0, 0.0), True), + ("m[0].t[0].t[0]", (0.0, 0.0), False), + ("m[0].t[0].t[0].t[0]", (1.0, 1.0), True), + ("m[0].t[0].t[1]", (0.0, 0.0), True), + ("m[0].t[1]", (0.0, 0.0), True), + ("m[0].t[2]", (0.0, 0.0), True), + ("m[1].t[0]", (0.0, 0.0), True), ], ), ], @@ -1369,7 +1369,7 @@ async def test_Track_set_muted( muted: bool, complex_session: Tuple[Session, str], expected_commands: List[Union[OscBundle, OscMessage]], - expected_levels: List[Tuple[float, ...]], + expected_state: List[Tuple[str, Tuple[float, ...], bool]], online: bool, target: str, ) -> None: @@ -1399,9 +1399,10 @@ async def test_Track_set_muted( ( track.short_address, tuple(round(x, 6) for x in cast(Track, track).output_levels), + track.is_active, ) for track in session._walk(Track) - ] == expected_levels + ] == expected_state @pytest.mark.parametrize("online", [False, True])