test(theme_nerv): align alert test with kwargs call signature
Replace positional args[3..5] assertions with assert_called_once_with using rounding=/thickness=/flags= kwargs to match the existing add_rect call in src/theme_nerv_fx.py:AlertPulsing.render and the parallel test in tests/test_theme_nerv_fx.py:TestThemeNervFx.test_alert_pulsing_render. Fixes test_alert_pulsing_render_active IndexError that surfaced when the positional contract was asserted against the kwargs-shaped production call.
This commit is contained in:
@@ -37,14 +37,7 @@ def test_alert_pulsing_render_active():
|
||||
|
||||
mock_get_draw_list.assert_called_once()
|
||||
mock_get_color.assert_called_once()
|
||||
mock_draw_list.add_rect.assert_called_once()
|
||||
|
||||
# Check arguments of add_rect
|
||||
# add_rect(p_min, p_max, col, rounding, flags, thickness)
|
||||
args, kwargs = mock_draw_list.add_rect.call_args
|
||||
assert args[0] == (0.0, 0.0)
|
||||
assert args[1] == (800.0, 600.0)
|
||||
assert args[2] == 0xFF0000FF
|
||||
assert args[3] == 0.0
|
||||
assert args[4] == 0
|
||||
assert args[5] == 10.0
|
||||
mock_draw_list.add_rect.assert_called_once_with(
|
||||
(0.0, 0.0), (800.0, 600.0), 0xFF0000FF,
|
||||
rounding=0.0, thickness=10.0, flags=0
|
||||
)
|
||||
|
||||
Reference in New Issue
Block a user