Increase helpers.frame test coverage (#65137)
Co-authored-by: Erik Montnemery <erik@montnemery.com>
This commit is contained in:
parent
e26488b1ca
commit
7e3d87a146
1 changed files with 13 additions and 0 deletions
|
@ -92,3 +92,16 @@ async def test_prevent_flooding(caplog):
|
|||
assert what not in caplog.text
|
||||
assert key in frame._REPORTED_INTEGRATIONS
|
||||
assert len(frame._REPORTED_INTEGRATIONS) == 1
|
||||
|
||||
|
||||
async def test_report_missing_integration_frame(caplog):
|
||||
"""Test reporting when no integration is detected."""
|
||||
|
||||
what = "teststring"
|
||||
with patch(
|
||||
"homeassistant.helpers.frame.get_integration_frame",
|
||||
side_effect=frame.MissingIntegrationFrame,
|
||||
):
|
||||
frame.report(what, error_if_core=False)
|
||||
assert what in caplog.text
|
||||
assert caplog.text.count(what) == 1
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue