@@ -260,6 +260,55 @@ async def test_removing_too_many_saved_albums(
260260 responses .assert_not_called () # type: ignore[no-untyped-call]
261261
262262
263+ async def test_checking_saved_albums (
264+ responses : aioresponses ,
265+ snapshot : SnapshotAssertion ,
266+ authenticated_client : SpotifyClient ,
267+ ) -> None :
268+ """Test checking saved albums."""
269+ responses .get (
270+ f"{ SPOTIFY_URL } /v1/me/albums/contains?ids=3IqzqH6ShrRtie9Yd2ODyG%252C1A2GTWGtFfWp7KSQTwWOyo%252C2noRn2Aes5aoNVsU6iWTh" ,
271+ status = 200 ,
272+ body = load_fixture ("album_saved.json" ),
273+ )
274+ response = await authenticated_client .are_albums_saved (
275+ [
276+ "spotify:album:3IqzqH6ShrRtie9Yd2ODyG" ,
277+ "1A2GTWGtFfWp7KSQTwWOyo" ,
278+ "2noRn2Aes5aoNVsU6iWTh" ,
279+ ]
280+ )
281+ assert response == snapshot
282+ responses .assert_called_once_with (
283+ f"{ SPOTIFY_URL } /v1/me/albums/contains" ,
284+ METH_GET ,
285+ headers = HEADERS ,
286+ params = {
287+ "ids" : "3IqzqH6ShrRtie9Yd2ODyG,1A2GTWGtFfWp7KSQTwWOyo,2noRn2Aes5aoNVsU6iWTh"
288+ },
289+ json = None ,
290+ )
291+
292+
293+ async def test_checking_no_saved_albums (
294+ responses : aioresponses ,
295+ authenticated_client : SpotifyClient ,
296+ ) -> None :
297+ """Test checking no saved albums."""
298+ await authenticated_client .are_albums_saved ([])
299+ responses .assert_not_called () # type: ignore[no-untyped-call]
300+
301+
302+ async def test_checking_too_many_saved_albums (
303+ responses : aioresponses ,
304+ authenticated_client : SpotifyClient ,
305+ ) -> None :
306+ """Test checking too many saved albums."""
307+ with pytest .raises (ValueError , match = "Maximum of 20 albums can be checked at once" ):
308+ await authenticated_client .are_albums_saved (["abc" ] * 21 )
309+ responses .assert_not_called () # type: ignore[no-untyped-call]
310+
311+
263312@pytest .mark .parametrize (
264313 "playback_fixture" ,
265314 [
0 commit comments