diff --git a/tests/test_web/test_app.py b/tests/test_web/test_app.py index 351f4bf..fec26b3 100644 --- a/tests/test_web/test_app.py +++ b/tests/test_web/test_app.py @@ -250,6 +250,36 @@ class TestCheckApiAccess: ) +class TestRadioConfigSettingsFallback: + """Tests that radio config falls back to settings when params are None.""" + + def test_radio_params_fall_back_to_settings( + self, mock_http_client: MockHttpClient, monkeypatch: pytest.MonkeyPatch + ) -> None: + """Radio config uses settings defaults when no CLI params are passed.""" + monkeypatch.setenv("OIDC_ENABLED", "false") + monkeypatch.setenv("NETWORK_ANNOUNCEMENT", "") + app = create_app( + api_url="http://localhost:8000", + api_key="test-api-key", + network_radio_profile=None, + network_radio_frequency=None, + network_radio_bandwidth=None, + network_radio_spreading_factor=None, + network_radio_coding_rate=None, + network_radio_tx_power=None, + features=ALL_FEATURES_ENABLED, + ) + app.state.http_client = mock_http_client + + assert app.state.network_radio_profile == "EU/UK Narrow" + assert app.state.network_radio_frequency == 869.618 + assert app.state.network_radio_bandwidth == 62.5 + assert app.state.network_radio_spreading_factor == 8 + assert app.state.network_radio_coding_rate == 8 + assert app.state.network_radio_tx_power == 22.0 + + class TestFlashBannerVisibility: """Tests for the network announcement flash banner visibility."""