fix(coverart/test): use newHTTPClient in provider test fixtures
This commit is contained in:
@@ -18,7 +18,7 @@ func newDeezerTestProvider(t *testing.T, baseURL string) *deezerProvider {
|
||||
deezerBaseURL = baseURL
|
||||
t.Cleanup(func() { deezerBaseURL = old })
|
||||
|
||||
p := &deezerProvider{client: &http.Client{Timeout: 5 * time.Second}}
|
||||
p := &deezerProvider{client: newHTTPClient(httpClientOptions{Name: "deezer", HTTPClient: &http.Client{Timeout: 5 * time.Second}, BaseBackoff: time.Millisecond})}
|
||||
p.enabled.Store(true)
|
||||
return p
|
||||
}
|
||||
@@ -93,7 +93,7 @@ func TestDeezer_FetchArtistArt_NameMismatch(t *testing.T) {
|
||||
}
|
||||
|
||||
func TestDeezer_FetchArtistArt_EmptyName(t *testing.T) {
|
||||
p := &deezerProvider{client: &http.Client{Timeout: 5 * time.Second}}
|
||||
p := &deezerProvider{client: newHTTPClient(httpClientOptions{Name: "deezer", HTTPClient: &http.Client{Timeout: 5 * time.Second}, BaseBackoff: time.Millisecond})}
|
||||
p.enabled.Store(true)
|
||||
_, _, err := p.FetchArtistArt(context.Background(), ArtistRef{})
|
||||
if !errors.Is(err, ErrNotFound) {
|
||||
@@ -102,7 +102,7 @@ func TestDeezer_FetchArtistArt_EmptyName(t *testing.T) {
|
||||
}
|
||||
|
||||
func TestDeezer_FetchArtistArt_Disabled(t *testing.T) {
|
||||
p := &deezerProvider{client: &http.Client{Timeout: 5 * time.Second}}
|
||||
p := &deezerProvider{client: newHTTPClient(httpClientOptions{Name: "deezer", HTTPClient: &http.Client{Timeout: 5 * time.Second}, BaseBackoff: time.Millisecond})}
|
||||
// enabled defaults to false
|
||||
_, _, err := p.FetchArtistArt(context.Background(), ArtistRef{Name: "X"})
|
||||
if !errors.Is(err, ErrNotFound) {
|
||||
@@ -150,7 +150,7 @@ func TestDeezer_FetchAlbumCover_TitleMismatch(t *testing.T) {
|
||||
}
|
||||
|
||||
func TestDeezer_FetchAlbumCover_MissingFields(t *testing.T) {
|
||||
p := &deezerProvider{client: &http.Client{Timeout: 5 * time.Second}}
|
||||
p := &deezerProvider{client: newHTTPClient(httpClientOptions{Name: "deezer", HTTPClient: &http.Client{Timeout: 5 * time.Second}, BaseBackoff: time.Millisecond})}
|
||||
p.enabled.Store(true)
|
||||
|
||||
cases := []AlbumRef{
|
||||
|
||||
Reference in New Issue
Block a user