mirror of
https://github.com/home-assistant/core.git
synced 2025-11-14 21:40:16 +00:00
Make Stream.stop() async (#73107)
* Make Stream.start() async * Stop streams concurrently on shutdown Co-authored-by: Martin Hjelmare <marhje52@gmail.com>
This commit is contained in:
@@ -3,7 +3,7 @@ import asyncio
|
||||
import base64
|
||||
from http import HTTPStatus
|
||||
import io
|
||||
from unittest.mock import Mock, PropertyMock, mock_open, patch
|
||||
from unittest.mock import AsyncMock, Mock, PropertyMock, mock_open, patch
|
||||
|
||||
import pytest
|
||||
|
||||
@@ -410,6 +410,7 @@ async def test_preload_stream(hass, mock_stream):
|
||||
"homeassistant.components.demo.camera.DemoCamera.stream_source",
|
||||
return_value="http://example.com",
|
||||
):
|
||||
mock_create_stream.return_value.start = AsyncMock()
|
||||
assert await async_setup_component(
|
||||
hass, "camera", {DOMAIN: {"platform": "demo"}}
|
||||
)
|
||||
|
||||
Reference in New Issue
Block a user