1
0
mirror of https://github.com/home-assistant/core.git synced 2025-12-25 05:26:47 +00:00

Add an available property on Stream (#60429)

This commit is contained in:
Allen Porter
2021-11-29 21:23:58 -08:00
committed by GitHub
parent f0f88d56bd
commit df90fdf641
4 changed files with 106 additions and 41 deletions

View File

@@ -135,6 +135,7 @@ async def test_hls_stream(hass, hls_stream, stream_worker_sync):
# Request stream
stream.add_provider(HLS_PROVIDER)
assert stream.available
stream.start()
hls_client = await hls_stream(stream)
@@ -161,6 +162,9 @@ async def test_hls_stream(hass, hls_stream, stream_worker_sync):
stream_worker_sync.resume()
# The stream worker reported end of stream and exited
assert not stream.available
# Stop stream, if it hasn't quit already
stream.stop()
@@ -181,6 +185,7 @@ async def test_stream_timeout(hass, hass_client, stream_worker_sync):
# Request stream
stream.add_provider(HLS_PROVIDER)
assert stream.available
stream.start()
url = stream.endpoint_url(HLS_PROVIDER)
@@ -267,6 +272,7 @@ async def test_stream_keepalive(hass):
stream._thread.join()
stream._thread = None
assert av_open.call_count == 2
assert not stream.available
# Stop stream, if it hasn't quit already
stream.stop()