mirror of
https://github.com/home-assistant/core.git
synced 2025-11-13 04:50:17 +00:00
Enable Ruff rule PT007 (#113764)
Co-authored-by: Franck Nijhof <frenck@frenck.nl>
This commit is contained in:
@@ -17,7 +17,7 @@ from tests.test_util.aiohttp import AiohttpClientMocker
|
||||
|
||||
@pytest.mark.parametrize(
|
||||
("url", "fixture", "content_type"),
|
||||
(
|
||||
[
|
||||
(
|
||||
"http://a.files.bbci.co.uk/media/live/manifesto/audio/simulcast/hls/nonuk/sbr_low/ak/bbc_radio_fourfm.m3u8",
|
||||
"bbc_radio_fourfm.m3u8",
|
||||
@@ -33,7 +33,7 @@ from tests.test_util.aiohttp import AiohttpClientMocker
|
||||
"rthkaudio2.m3u8",
|
||||
None,
|
||||
),
|
||||
),
|
||||
],
|
||||
)
|
||||
async def test_hls_playlist_supported(
|
||||
hass: HomeAssistant, aioclient_mock: AiohttpClientMocker, url, fixture, content_type
|
||||
@@ -47,7 +47,7 @@ async def test_hls_playlist_supported(
|
||||
|
||||
@pytest.mark.parametrize(
|
||||
("url", "fixture", "content_type", "expected_playlist"),
|
||||
(
|
||||
[
|
||||
(
|
||||
"https://sverigesradio.se/topsy/direkt/209-hi-mp3.m3u",
|
||||
"209-hi-mp3.m3u",
|
||||
@@ -96,7 +96,7 @@ async def test_hls_playlist_supported(
|
||||
)
|
||||
],
|
||||
),
|
||||
),
|
||||
],
|
||||
)
|
||||
async def test_parse_playlist(
|
||||
hass: HomeAssistant,
|
||||
@@ -115,7 +115,7 @@ async def test_parse_playlist(
|
||||
|
||||
@pytest.mark.parametrize(
|
||||
("url", "fixture"),
|
||||
(
|
||||
[
|
||||
("http://sverigesradio.se/164-hi-aac.pls", "164-hi-aac_invalid_entries.pls"),
|
||||
("http://sverigesradio.se/164-hi-aac.pls", "164-hi-aac_invalid_file.pls"),
|
||||
("http://sverigesradio.se/164-hi-aac.pls", "164-hi-aac_invalid_version.pls"),
|
||||
@@ -126,7 +126,7 @@ async def test_parse_playlist(
|
||||
("http://sverigesradio.se/164-hi-aac.pls", "164-hi-aac_no_version.pls"),
|
||||
("https://sverigesradio.se/209-hi-mp3.m3u", "209-hi-mp3_bad_url.m3u"),
|
||||
("https://sverigesradio.se/209-hi-mp3.m3u", "empty.m3u"),
|
||||
),
|
||||
],
|
||||
)
|
||||
async def test_parse_bad_playlist(
|
||||
hass: HomeAssistant, aioclient_mock: AiohttpClientMocker, url, fixture
|
||||
@@ -139,10 +139,10 @@ async def test_parse_bad_playlist(
|
||||
|
||||
@pytest.mark.parametrize(
|
||||
("url", "exc"),
|
||||
(
|
||||
[
|
||||
("http://sverigesradio.se/164-hi-aac.pls", TimeoutError),
|
||||
("http://sverigesradio.se/164-hi-aac.pls", client_exceptions.ClientError),
|
||||
),
|
||||
],
|
||||
)
|
||||
async def test_parse_http_error(
|
||||
hass: HomeAssistant, aioclient_mock: AiohttpClientMocker, url, exc
|
||||
|
||||
Reference in New Issue
Block a user