This commit is contained in:
Paulus Schoutsen committed 2019-07-31 12:25:30 -07:00
1 parent da05dfe708
commit 4de97abc3a
2676 files changed
+163166 -140084

No files matched your search

+8 -15
View File
@@ -9,8 +9,7 @@ from homeassistant.components.stream import request_stream
import homeassistant.util.dt as dt_util
from tests.common import async_fire_time_changed
from tests.components.stream.common import (
generate_h264_video, preload_stream)
from tests.components.stream.common import generate_h264_video, preload_stream
@pytest.mark.skip("Flaky in CI")
@@ -21,14 +20,12 @@ async def test_hls_stream(hass, hass_client):
Purposefully not mocking anything here to test full
integration with the stream component.
"""
await async_setup_component(hass, 'stream', {
'stream': {}
})
await async_setup_component(hass, "stream", {"stream": {}})
# Setup demo HLS track
source = generate_h264_video()
stream = preload_stream(hass, source)
stream.add_provider('hls')
stream.add_provider("hls")
# Request stream
url = request_stream(hass, source)
@@ -42,7 +39,7 @@ async def test_hls_stream(hass, hass_client):
# Fetch segment
playlist = await playlist_response.text()
playlist_url = '/'.join(parsed_url.path.split('/')[:-1])
playlist_url = "/".join(parsed_url.path.split("/")[:-1])
segment_url = playlist_url + playlist.splitlines()[-1][1:]
segment_response = await http_client.get(segment_url)
assert segment_response.status == 200
@@ -58,14 +55,12 @@ async def test_hls_stream(hass, hass_client):
@pytest.mark.skip("Flaky in CI")
async def test_stream_timeout(hass, hass_client):
"""Test hls stream timeout."""
await async_setup_component(hass, 'stream', {
'stream': {}
})
await async_setup_component(hass, "stream", {"stream": {}})
# Setup demo HLS track
source = generate_h264_video()
stream = preload_stream(hass, source)
stream.add_provider('hls')
stream.add_provider("hls")
# Request stream
url = request_stream(hass, source)
@@ -97,14 +92,12 @@ async def test_stream_timeout(hass, hass_client):
@pytest.mark.skip("Flaky in CI")
async def test_stream_ended(hass):
"""Test hls stream packets ended."""
await async_setup_component(hass, 'stream', {
'stream': {}
})
await async_setup_component(hass, "stream", {"stream": {}})
# Setup demo HLS track
source = generate_h264_video()
stream = preload_stream(hass, source)
track = stream.add_provider('hls')
track = stream.add_provider("hls")
track.num_segments = 2
# Request stream