Add diagnostics platform for AccuWeather integration (#68752)
This commit is contained in:
parent
066128a53c
commit
24212ab598
2 changed files with 54 additions and 0 deletions
26
tests/components/accuweather/test_diagnostics.py
Normal file
26
tests/components/accuweather/test_diagnostics.py
Normal file
|
@ -0,0 +1,26 @@
|
|||
"""Test AccuWeather diagnostics."""
|
||||
import json
|
||||
|
||||
from tests.common import load_fixture
|
||||
from tests.components.accuweather import init_integration
|
||||
from tests.components.diagnostics import get_diagnostics_for_config_entry
|
||||
|
||||
|
||||
async def test_entry_diagnostics(hass, hass_client):
|
||||
"""Test config entry diagnostics."""
|
||||
entry = await init_integration(hass)
|
||||
|
||||
coordinator_data = json.loads(
|
||||
load_fixture("current_conditions_data.json", "accuweather")
|
||||
)
|
||||
coordinator_data["forecast"] = {}
|
||||
|
||||
result = await get_diagnostics_for_config_entry(hass, hass_client, entry)
|
||||
|
||||
assert result["config_entry_data"] == {
|
||||
"api_key": "**REDACTED**",
|
||||
"latitude": "**REDACTED**",
|
||||
"longitude": "**REDACTED**",
|
||||
"name": "Home",
|
||||
}
|
||||
assert result["coordinator_data"] == coordinator_data
|
Loading…
Add table
Add a link
Reference in a new issue