Example #1
0
async def test_async_browse_media_async_get_events_error(
        caplog: Any, frigate_client: AsyncMock, hass: HomeAssistant) -> None:
    """Test API error behavior."""
    frigate_client.async_get_events = AsyncMock(
        side_effect=FrigateApiClientError)

    await setup_mock_frigate_config_entry(hass, client=frigate_client)

    with pytest.raises(MediaSourceError):
        await media_source.async_browse_media(
            hass,
            f"{const.URI_SCHEME}{DOMAIN}/{TEST_FRIGATE_INSTANCE_ID}"
            "/event-search/clips",
        )