Skip to content

Commit

Permalink
Testing
Browse files Browse the repository at this point in the history
  • Loading branch information
josephine-wolf-oberholtzer committed Dec 21, 2024
1 parent 096683e commit fd21503
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 17 deletions.
4 changes: 4 additions & 0 deletions supriya/mixers/tracks.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
35 changes: 18 additions & 17 deletions tests/mixers/test_Track.py
Original file line number Diff line number Diff line change
Expand Up @@ -1332,34 +1332,34 @@ 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),
],
),
(
"mixers[0].tracks[0].tracks[0]",
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),
],
),
],
Expand All @@ -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:
Expand Down Expand Up @@ -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])
Expand Down

0 comments on commit fd21503

Please sign in to comment.