Skip to content

Commit d820410

Browse files
committed
fix: update pulse command tests for LED parameter
Update test calls to pulse_lights() to include LED parameter and update assertions to expect LED parameter in apply_effect calls. Fixes test failures introduced by LED-aware effects implementation.
1 parent 843d403 commit d820410

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

tests/test_subcommands.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -324,15 +324,15 @@ def test_pulse_lights_success(self, mock_effects, mock_get_selection):
324324
mock_selection = Mock()
325325
mock_get_selection.return_value = mock_selection
326326

327-
pulse_lights(mock_ctx, color=(0, 255, 0), speed=Speed.Medium, count=3)
327+
pulse_lights(mock_ctx, color=(0, 255, 0), speed=Speed.Medium, count=3, led=0)
328328

329329
mock_effects.for_name.assert_called_once_with("gradient")
330330
mock_effects.for_name.return_value.assert_called_once_with(
331331
(0, 255, 0), step=8, count=3
332332
)
333333

334334
mock_selection.apply_effect.assert_called_once_with(
335-
mock_effect_instance, duration=30.0, interval=Speed.Medium.duty_cycle / 16
335+
mock_effect_instance, duration=30.0, interval=Speed.Medium.duty_cycle / 16, led=0
336336
)
337337

338338
@patch("busylight.subcommands.pulse.get_light_selection")
@@ -350,7 +350,7 @@ def test_pulse_lights_timeout_error(self, mock_effects, mock_get_selection):
350350
mock_selection.apply_effect.side_effect = TimeoutError()
351351
mock_get_selection.return_value = mock_selection
352352

353-
pulse_lights(mock_ctx, color=(0, 0, 255), speed=Speed.Fast, count=0)
353+
pulse_lights(mock_ctx, color=(0, 0, 255), speed=Speed.Fast, count=0, led=0)
354354

355355
mock_selection.turn_off.assert_called_once()
356356

@@ -366,7 +366,7 @@ def test_pulse_lights_no_lights_found(self, mock_get_selection):
366366

367367
with patch("busylight.subcommands.pulse.typer.secho") as mock_secho:
368368
with pytest.raises(typer.Exit) as exc_info:
369-
pulse_lights(mock_ctx, color=(128, 128, 128), speed=Speed.Slow, count=2)
369+
pulse_lights(mock_ctx, color=(128, 128, 128), speed=Speed.Slow, count=2, led=0)
370370

371371
assert exc_info.value.exit_code == 1
372372
mock_secho.assert_called_with("Unable to pulse lights.", fg="red")
@@ -387,7 +387,7 @@ def test_pulse_lights_generic_exception(self, mock_effects, mock_get_selection):
387387

388388
with patch("busylight.subcommands.pulse.typer.secho") as mock_secho:
389389
with pytest.raises(typer.Exit) as exc_info:
390-
pulse_lights(mock_ctx, color=(64, 64, 64), speed=Speed.Medium, count=1)
390+
pulse_lights(mock_ctx, color=(64, 64, 64), speed=Speed.Medium, count=1, led=0)
391391

392392
assert exc_info.value.exit_code == 1
393393
mock_secho.assert_called_with("Error pulse lights: Pulse test error", fg="red")

0 commit comments

Comments
 (0)