Files
deploy/util/helm/index_test.go
f970663e89 chore(repo-server): unify semver resolution in new versions subpackage (#20216)
Signed-off-by: Paul Larsen <[email protected]>
Signed-off-by: Blake Pettersson <[email protected]>
Signed-off-by: Alexandre Gaudreault <[email protected]>
Co-authored-by: Blake Pettersson <[email protected]>
Co-authored-by: Alexandre Gaudreault <[email protected]>
2025-05-08 07:10:28 +00:00

37 lines
746 B
Go

package helm
import (
"testing"
"github.com/stretchr/testify/assert"
"github.com/stretchr/testify/require"
)
var index = Index{
Entries: map[string]Entries{
"argo-cd": {
{Version: "~0.7.3"},
{Version: "0.7.1"},
{Version: "0.5.4"},
{Version: "0.5.3"},
{Version: "0.7.2"},
{Version: "0.5.2"},
{Version: "~0.5.2"},
{Version: "0.5.1"},
{Version: "0.5.0"},
},
},
}
func TestIndex_GetEntries(t *testing.T) {
t.Run("NotFound", func(t *testing.T) {
_, err := index.GetEntries("foo")
require.EqualError(t, err, "chart 'foo' not found in index")
})
t.Run("Found", func(t *testing.T) {
ts, err := index.GetEntries("argo-cd")
require.NoError(t, err)
assert.Len(t, ts, len(index.Entries["argo-cd"]))
})
}