Enable Ruff rule PT007 (#113764)

Co-authored-by: Franck Nijhof <frenck@frenck.nl>
This commit is contained in:
Sid
2024-03-19 09:01:07 +01:00
committed by GitHub
parent 089a3ab6d7
commit 00ec7f11f0
204 changed files with 908 additions and 921 deletions

View File

@@ -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