1
0
mirror of https://github.com/home-assistant/core.git synced 2025-12-24 04:50:05 +00:00

Replace Camera STREAM_ constants with StreamType enum (#69871)

This commit is contained in:
Franck Nijhof
2022-04-12 01:27:27 +02:00
committed by GitHub
parent 75fce1f036
commit c93c7e8eff
8 changed files with 56 additions and 36 deletions

View File

@@ -4,7 +4,7 @@ from unittest.mock import PropertyMock, patch
import pytest
from homeassistant.components import media_source
from homeassistant.components.camera.const import STREAM_TYPE_WEB_RTC
from homeassistant.components.camera.const import StreamType
from homeassistant.components.stream.const import FORMAT_CONTENT_TYPE
from homeassistant.setup import async_setup_component
@@ -88,7 +88,7 @@ async def test_resolving_errors(hass, mock_camera_hls):
with pytest.raises(media_source.Unresolvable) as exc_info, patch(
"homeassistant.components.camera.Camera.frontend_stream_type",
new_callable=PropertyMock(return_value=STREAM_TYPE_WEB_RTC),
new_callable=PropertyMock(return_value=StreamType.WEB_RTC),
):
await media_source.async_resolve_media(
hass, "media-source://camera/camera.demo_camera"