MCPcopy
hub / github.com/hacs/integration / test_diagnostics_with_exception

Function test_diagnostics_with_exception

tests/test_diagnostics.py:33–51  ·  view source on GitHub ↗

Test the result with issues getting the ratelimit.

(
    hacs: HacsBase,
    snapshots: SnapshotFixture,
    response_mocker: ResponseMocker,
)

Source from the content-addressed store, hash-verified

31
32
33async def test_diagnostics_with_exception(
34 hacs: HacsBase,
35 snapshots: SnapshotFixture,
36 response_mocker: ResponseMocker,
37):
38 """Test the result with issues getting the ratelimit."""
39 response_mocker.add(
40 "https://api.github.com/rate_limit",
41 MockedResponse(status=400, content="Something went wrong"),
42 )
43 diagnostics = await async_get_config_entry_diagnostics(
44 hacs.hass,
45 hacs.configuration.config_entry,
46 )
47
48 snapshots.assert_match(
49 safe_json_dumps(recursive_remove_key(diagnostics, REMOVE_KEYS)),
50 "diagnostics/exception.json",
51 )

Callers

nothing calls this directly

Calls 5

MockedResponseClass · 0.90
safe_json_dumpsFunction · 0.90
recursive_remove_keyFunction · 0.90
addMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…