From 5c6e62ffe01dba7b9c5d65bd4197fb918f36ae09 Mon Sep 17 00:00:00 2001 From: "J. Nick Koston" Date: Wed, 12 Aug 2026 19:28:21 -0500 Subject: [PATCH] Pin the neutral cap branch a future hub platform will take --- .../bluetooth_connection/test_slot_ledger.py | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/tests/component_tests/bluetooth_connection/test_slot_ledger.py b/tests/component_tests/bluetooth_connection/test_slot_ledger.py index 847fb946ef..209c920ac7 100644 --- a/tests/component_tests/bluetooth_connection/test_slot_ledger.py +++ b/tests/component_tests/bluetooth_connection/test_slot_ledger.py @@ -63,3 +63,17 @@ def test_real_validators_charge_the_ledger_on_rp2( "ble_client", ): rp2040_ble.validate_connection_slots() + + +def test_neutral_cap_check_guards_future_hub_platforms( + set_core_config: SetCoreConfigCallable, monkeypatch: pytest.MonkeyPatch +) -> None: + # Both current platforms defer to their stack budgets; pin the message + # and boundary of the branch a future budget-less hub platform takes. + set_core_config(PlatformFramework.RP2_ARDUINO) + monkeypatch.setattr(bluetooth_connection, "_STACK_BUDGET_PLATFORMS", set()) + bluetooth_connection.consume_gatt_slot("bluetooth_proxy", 3)({}) + bluetooth_connection.FINAL_VALIDATE_SCHEMA({}) + bluetooth_connection.consume_gatt_slot("ble_client")({}) + with pytest.raises(cv.Invalid, match="supports at most 3 GATT client connection"): + bluetooth_connection.FINAL_VALIDATE_SCHEMA({})