fix(server/m7-cover-sources): forward-fix CI — more unused r params
Sweep round 4: 5 more httptest handlers in provider_theaudiodb_test.go where r is unused. Lint flagged 3 (lines 89/103/118); also fixing 2 more (TestConnection_SuccessOnEmptyAlbum, FailureOn401) that lint would catch on the next run. The 4 handlers that DO use r.URL.Path or r.Host are left as-is.
This commit is contained in:
@@ -86,7 +86,7 @@ func TestTheAudioDB_FetchAlbumCover_Success(t *testing.T) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
func TestTheAudioDB_FetchAlbumCover_NotFound(t *testing.T) {
|
func TestTheAudioDB_FetchAlbumCover_NotFound(t *testing.T) {
|
||||||
srv := httptest.NewServer(http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) {
|
srv := httptest.NewServer(http.HandlerFunc(func(w http.ResponseWriter, _ *http.Request) {
|
||||||
w.Header().Set("Content-Type", "application/json")
|
w.Header().Set("Content-Type", "application/json")
|
||||||
_, _ = w.Write([]byte(`{"album":null}`))
|
_, _ = w.Write([]byte(`{"album":null}`))
|
||||||
}))
|
}))
|
||||||
@@ -100,7 +100,7 @@ func TestTheAudioDB_FetchAlbumCover_NotFound(t *testing.T) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
func TestTheAudioDB_FetchAlbumCover_NullThumbURL(t *testing.T) {
|
func TestTheAudioDB_FetchAlbumCover_NullThumbURL(t *testing.T) {
|
||||||
srv := httptest.NewServer(http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) {
|
srv := httptest.NewServer(http.HandlerFunc(func(w http.ResponseWriter, _ *http.Request) {
|
||||||
w.Header().Set("Content-Type", "application/json")
|
w.Header().Set("Content-Type", "application/json")
|
||||||
_, _ = w.Write([]byte(`{"album":[{"strAlbumThumb":null}]}`))
|
_, _ = w.Write([]byte(`{"album":[{"strAlbumThumb":null}]}`))
|
||||||
}))
|
}))
|
||||||
@@ -115,7 +115,7 @@ func TestTheAudioDB_FetchAlbumCover_NullThumbURL(t *testing.T) {
|
|||||||
|
|
||||||
func TestTheAudioDB_FetchAlbumCover_429TriggersRetry(t *testing.T) {
|
func TestTheAudioDB_FetchAlbumCover_429TriggersRetry(t *testing.T) {
|
||||||
var attempts atomic.Int32
|
var attempts atomic.Int32
|
||||||
srv := httptest.NewServer(http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) {
|
srv := httptest.NewServer(http.HandlerFunc(func(w http.ResponseWriter, _ *http.Request) {
|
||||||
n := attempts.Add(1)
|
n := attempts.Add(1)
|
||||||
if n == 1 {
|
if n == 1 {
|
||||||
http.Error(w, "rate limit", http.StatusTooManyRequests)
|
http.Error(w, "rate limit", http.StatusTooManyRequests)
|
||||||
@@ -265,7 +265,7 @@ func TestTheAudioDB_DisabledReturnsNotFound(t *testing.T) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
func TestTheAudioDB_TestConnection_SuccessOnEmptyAlbum(t *testing.T) {
|
func TestTheAudioDB_TestConnection_SuccessOnEmptyAlbum(t *testing.T) {
|
||||||
srv := httptest.NewServer(http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) {
|
srv := httptest.NewServer(http.HandlerFunc(func(w http.ResponseWriter, _ *http.Request) {
|
||||||
w.Header().Set("Content-Type", "application/json")
|
w.Header().Set("Content-Type", "application/json")
|
||||||
_, _ = w.Write([]byte(`{"album":null}`))
|
_, _ = w.Write([]byte(`{"album":null}`))
|
||||||
}))
|
}))
|
||||||
@@ -278,7 +278,7 @@ func TestTheAudioDB_TestConnection_SuccessOnEmptyAlbum(t *testing.T) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
func TestTheAudioDB_TestConnection_FailureOn401(t *testing.T) {
|
func TestTheAudioDB_TestConnection_FailureOn401(t *testing.T) {
|
||||||
srv := httptest.NewServer(http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) {
|
srv := httptest.NewServer(http.HandlerFunc(func(w http.ResponseWriter, _ *http.Request) {
|
||||||
http.Error(w, "unauthorized", http.StatusUnauthorized)
|
http.Error(w, "unauthorized", http.StatusUnauthorized)
|
||||||
}))
|
}))
|
||||||
defer srv.Close()
|
defer srv.Close()
|
||||||
|
|||||||
Reference in New Issue
Block a user