Use built-in Req stub for LastFm tests

This commit is contained in:
Claudio Ortolina
2025-02-27 13:38:06 +00:00
parent 522b3034aa
commit 3d11cd585d
9 changed files with 58 additions and 53 deletions
+4 -4
View File
@@ -2,7 +2,7 @@ defmodule LastFm do
def get_artist_info(musicbrainz_id, name) do
last_fm_config = last_fm_config()
case last_fm_config.api.get_artist_info(
case LastFm.APIImpl.get_artist_info(
{:musicbrainz_id, musicbrainz_id},
last_fm_config
) do
@@ -12,7 +12,7 @@ defmodule LastFm do
{:error, :invalid_parameters} ->
# Sometimes the artist info cannot be identified with the MusicBrainz ID,
# because Last.fm doesn't have that information. In that case, we try again with the artist name.
last_fm_config.api.get_artist_info({:name, name}, last_fm_config)
LastFm.APIImpl.get_artist_info({:name, name}, last_fm_config)
error ->
error
@@ -22,7 +22,7 @@ defmodule LastFm do
def get_similar_artists(musicbrainz_id, name) do
last_fm_config = last_fm_config()
case last_fm_config.api.get_similar_artists(
case LastFm.APIImpl.get_similar_artists(
{:musicbrainz_id, musicbrainz_id},
last_fm_config
) do
@@ -32,7 +32,7 @@ defmodule LastFm do
{:error, :invalid_parameters} ->
# Sometimes the artist info cannot be identified with the MusicBrainz ID,
# because Last.fm doesn't have that information. In that case, we try again with the artist name.
last_fm_config.api.get_similar_artists({:name, name}, last_fm_config)
LastFm.APIImpl.get_similar_artists({:name, name}, last_fm_config)
error ->
error