chore(updater): move updater packages to pkg/updaters/<name>

This commit is contained in:
Quentin McGaw
2026-04-23 03:47:57 +00:00
parent 5b01324d5f
commit 13503b0ae0
268 changed files with 1602 additions and 1026 deletions
@@ -3,7 +3,9 @@ package providers
import (
"testing"
"github.com/qdm12/gluetun/pkg/updaters"
"github.com/stretchr/testify/assert"
"github.com/stretchr/testify/require"
)
func Test_All(t *testing.T) {
@@ -21,3 +23,27 @@ func Test_AllWithCustom(t *testing.T) {
assert.Contains(t, all, Custom)
assert.Len(t, all, len(All())+1)
}
func Test_MatchUpdaters(t *testing.T) {
t.Parallel()
fetcherNames := updaters.ListAllNames()
allProviders := All()
require.Equal(t, len(allProviders), len(fetcherNames), "number of providers in All() should match number of fetchers")
nameToFound := make(map[string]bool, len(allProviders))
for _, provider := range allProviders {
nameToFound[provider] = false
}
for _, fetcherName := range fetcherNames {
found, ok := nameToFound[fetcherName]
require.True(t, ok, "fetcher name %q not found in %v", fetcherName, allProviders)
require.False(t, found, "fetcher name %q is duplicated in %v", fetcherName, allProviders)
nameToFound[fetcherName] = true
}
for provider, found := range nameToFound {
assert.True(t, found, "provider %q from All() does not have a matching fetcher", provider)
}
}