SWS-12500-custom-component/tests
SchiZzA 418d0c7546
fix(security): harden forwarders, cap native ecowitt entities, reject empty creds
- S8: received_data now rejects empty configured credentials (IncorrectDataError)
  and present-but-empty incoming credentials (HTTPUnauthorized) instead of relying
  solely on the config flow. Credential validation extracted into
  _validate_credentials() (also resolves the C901 complexity warning and unifies
  the WU/WSLink branches).
- S6: cap auto-created native Ecowitt entities (MAX_NATIVE_ECOWITT_SENSORS) to bound
  entity-registry growth from a fabricated multi-key payload.
- S5: store only the exception class name in Windy/Pocasi last_error (surfaced via
  entity attributes; str(ex) could embed the request URL).
- S7: verified safe - the native-sensor INFO log is parametrized (%s), so no
  format-string injection; left as-is.

308 passing, 100% coverage; ruff + basedpyright clean.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-06-21 18:48:50 +02:00
..
conftest.py Add health diagnostic sensor and extensive tests for sws12500 2026-02-21 11:29:40 +01:00
test_binary_battery.py fix(correctness): reload-window guards, rate-limit races, ecowitt flush, dt_util 2026-06-21 18:32:00 +02:00
test_config_flow.py test: reach 100% coverage of custom_components/sws12500 2026-06-21 13:23:34 +02:00
test_const.py Add health diagnostic sensor and extensive tests for sws12500 2026-02-21 11:29:40 +01:00
test_data.py test: align suite with v2.0 runtime_data architecture 2026-06-21 12:51:52 +02:00
test_diagnostics.py test: reach 100% coverage of custom_components/sws12500 2026-06-21 13:23:34 +02:00
test_ecowitt_bridge.py fix(security): harden forwarders, cap native ecowitt entities, reject empty creds 2026-06-21 18:48:50 +02:00
test_health.py fix(security)+i18n: stop health-attribute leak, mask secrets in logs, sync translations 2026-06-21 18:08:34 +02:00
test_init.py test: reach 100% coverage of custom_components/sws12500 2026-06-21 13:23:34 +02:00
test_integration_lifecycle.py fix(correctness): reload-window guards, rate-limit races, ecowitt flush, dt_util 2026-06-21 18:32:00 +02:00
test_pocasi_push.py fix(correctness): reload-window guards, rate-limit races, ecowitt flush, dt_util 2026-06-21 18:32:00 +02:00
test_received_data.py fix(security): harden forwarders, cap native ecowitt entities, reject empty creds 2026-06-21 18:48:50 +02:00
test_received_ecowitt.py fix(correctness): reload-window guards, rate-limit races, ecowitt flush, dt_util 2026-06-21 18:32:00 +02:00
test_routes.py Make routes method-aware and update related tests 2026-03-04 07:53:26 +01:00
test_routes_more.py test: reach 100% coverage of custom_components/sws12500 2026-06-21 13:23:34 +02:00
test_sensor_platform.py fix(correctness): reload-window guards, rate-limit races, ecowitt flush, dt_util 2026-06-21 18:32:00 +02:00
test_sensors_common.py Add health diagnostic sensor and extensive tests for sws12500 2026-02-21 11:29:40 +01:00
test_sensors_weather.py Add health diagnostic sensor and extensive tests for sws12500 2026-02-21 11:29:40 +01:00
test_sensors_wslink.py fix(correctness): reload-window guards, rate-limit races, ecowitt flush, dt_util 2026-06-21 18:32:00 +02:00
test_staleness_legacy.py test: reach 100% coverage of custom_components/sws12500 2026-06-21 13:23:34 +02:00
test_strings.py Add health diagnostic sensor and extensive tests for sws12500 2026-02-21 11:29:40 +01:00
test_t9_air_quality.py test: align suite with v2.0 runtime_data architecture 2026-06-21 12:51:52 +02:00
test_translations_cs.py Add health diagnostic sensor and extensive tests for sws12500 2026-02-21 11:29:40 +01:00
test_translations_en.py Add health diagnostic sensor and extensive tests for sws12500 2026-02-21 11:29:40 +01:00
test_utils.py Add health diagnostic sensor and extensive tests for sws12500 2026-02-21 11:29:40 +01:00
test_utils_conv.py fix(security)+i18n: stop health-attribute leak, mask secrets in logs, sync translations 2026-06-21 18:08:34 +02:00
test_utils_more.py Add health diagnostic sensor and extensive tests for sws12500 2026-02-21 11:29:40 +01:00
test_weather_sensor_entity.py test: align suite with v2.0 runtime_data architecture 2026-06-21 12:51:52 +02:00
test_windy_func.py Add health diagnostic sensor and extensive tests for sws12500 2026-02-21 11:29:40 +01:00
test_windy_more.py fix(correctness): reload-window guards, rate-limit races, ecowitt flush, dt_util 2026-06-21 18:32:00 +02:00
test_windy_push.py fix(correctness): reload-window guards, rate-limit races, ecowitt flush, dt_util 2026-06-21 18:32:00 +02:00