test(coverart, subsonic, server): merge repeated cases into tables (#8298)
release / web (push) Successful in 1m35s
release / go (push) Successful in 1m58s
release / govulncheck (push) Successful in 19s
release / integration (push) Successful in 3m0s
release / android (push) Successful in 4m26s
release / Attach APK to the Release (tag releases only) (push) Canceled after 0s
release / Build + push container image (push) Canceled after 0s
release / Publish the release image to GHCR (dispatch only) (push) Canceled after 0s
release / Verify release artifacts (tag releases only) (push) Canceled after 0s
release / Build signed APK (push) Canceled after 5m8s
release / web (push) Successful in 1m35s
release / go (push) Successful in 1m58s
release / govulncheck (push) Successful in 19s
release / integration (push) Successful in 3m0s
release / android (push) Successful in 4m26s
release / Attach APK to the Release (tag releases only) (push) Canceled after 0s
release / Build + push container image (push) Canceled after 0s
release / Publish the release image to GHCR (dispatch only) (push) Canceled after 0s
release / Verify release artifacts (tag releases only) (push) Canceled after 0s
release / Build signed APK (push) Canceled after 5m8s
- coverart: the four providers' identity and default tests, Last.fm's five not-found-without-asking tests, the four "which artists are asked again" database tests (now one reset over four artists), and the thumbnail-only and fanart-only tests. - subsonic: getUser's six tests and decodePassword's three, one table each. Dropped TestTokenMD5Derivation: it checked crypto/md5 against a constant and called no Minstrel code. - server: the four web-app-versus-API path tests start one server, not four. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
@@ -114,3 +114,26 @@ func TestCapabilityFiltering(t *testing.T) {
|
||||
t.Errorf("AlbumCoverProvider[0].ID = %q, want %q", albumProviders[0].ID(), "alb")
|
||||
}
|
||||
}
|
||||
|
||||
// Each provider's identity and out-of-the-box state. Settings boot reads
|
||||
// DefaultEnabled to decide which providers a new server asks, and the admin
|
||||
// screen reads RequiresAPIKey to decide which ask for a key.
|
||||
func TestProviders_IdentityAndDefaults(t *testing.T) {
|
||||
resetRegistryForTests()
|
||||
defer resetRegistryForTests()
|
||||
for _, tc := range []struct {
|
||||
p Provider
|
||||
id string
|
||||
needsKey, enabledNew bool
|
||||
}{
|
||||
{newMBCAAProvider(FetcherConfig{}), "mbcaa", false, true},
|
||||
{&theAudioDBProvider{}, "theaudiodb", true, true},
|
||||
{&deezerProvider{}, "deezer", false, true},
|
||||
{&lastfmProvider{}, "lastfm", true, false},
|
||||
} {
|
||||
if tc.p.ID() != tc.id || tc.p.RequiresAPIKey() != tc.needsKey || tc.p.DefaultEnabled() != tc.enabledNew {
|
||||
t.Errorf("%s: id %q, needs a key %v, on by default %v; want %q, %v, %v", tc.id,
|
||||
tc.p.ID(), tc.p.RequiresAPIKey(), tc.p.DefaultEnabled(), tc.id, tc.needsKey, tc.enabledNew)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user