From f8d700e5d94a50eb0c6cbb5356a7c0388ad65901 Mon Sep 17 00:00:00 2001 From: ChuckBuilds Date: Fri, 7 Aug 2026 16:12:07 -0400 Subject: [PATCH] test(vegas): cover the width cap still working when asked for Defaulting the cap off must not quietly remove it. Asserts that an explicit ratio is honoured and validates, alongside the existing check that omitting it means uncapped. Co-Authored-By: Claude Opus 5 (1M context) Claude-Session: https://claude.ai/code/session_01Udr6MfaFLUPhX5Fgo67Jf5 --- test/test_vegas_density.py | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/test/test_vegas_density.py b/test/test_vegas_density.py index a5cde000..4fc2db12 100644 --- a/test/test_vegas_density.py +++ b/test/test_vegas_density.py @@ -787,6 +787,14 @@ class TestNewConfigKeys: assert VegasModeConfig().max_plugin_width_ratio == 0.0 assert VegasModeConfig.from_config({}).max_plugin_width_ratio == 0.0 + def test_width_cap_is_still_available_when_asked_for(self): + # Defaulting the cap off must not remove it: a user who sets a ratio + # still gets one, and 0 still means uncapped. + cfg = VegasModeConfig.from_config( + {'display': {'vegas_scroll': {'max_plugin_width_ratio': 3.0}}}) + assert cfg.max_plugin_width_ratio == 3.0 + assert cfg.validate() == [] + @pytest.mark.parametrize('overrides,bad_key', [ ({'render_width_pct': 5}, 'render_width_pct'), ({'render_width_pct': 101}, 'render_width_pct'),