Increase helpers.frame test coverage (#65137)

Co-authored-by: Erik Montnemery <erik@montnemery.com>
This commit is contained in:
Dave T 2022-02-18 08:05:38 +00:00 committed by GitHub
parent e26488b1ca
commit 7e3d87a146
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -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