1
0
mirror of https://github.com/home-assistant/core.git synced 2025-12-24 21:06:19 +00:00

Improve Plex media search failure feedback (#67493)

This commit is contained in:
jjlawren
2022-03-17 15:57:22 -05:00
committed by GitHub
parent f75d621888
commit b34da1294c
9 changed files with 85 additions and 64 deletions

View File

@@ -43,7 +43,6 @@ async def test_media_player_playback(
requests_mock,
playqueue_created,
player_plexweb_resources,
caplog,
):
"""Test playing media on a Plex media_player."""
requests_mock.get("http://1.2.3.5:32400/resources", text=player_plexweb_resources)
@@ -68,7 +67,7 @@ async def test_media_player_playback(
},
True,
)
assert f"Media could not be found: {payload}" in str(excinfo.value)
assert f"No {MEDIA_TYPE_MOVIE} results in 'Movies' for" in str(excinfo.value)
movie1 = MockPlexMedia("Movie", "movie")
movie2 = MockPlexMedia("Movie II", "movie")
@@ -120,8 +119,7 @@ async def test_media_player_playback(
},
True,
)
assert f"Media could not be found: {payload}" in str(excinfo.value)
assert "Multiple matches, make content_id more specific" in caplog.text
assert "Multiple matches, make content_id more specific" in str(excinfo.value)
# Test multiple choices with allow_multiple
movies = [movie1, movie2, movie3]