mirror of
https://github.com/argoproj/argo-cd
synced 2026-04-21 17:07:16 +00:00
Signed-off-by: Paul Larsen <pnvlarsen@gmail.com> Signed-off-by: Blake Pettersson <blake.pettersson@gmail.com> Signed-off-by: Alexandre Gaudreault <alexandre_gaudreault@intuit.com> Co-authored-by: Blake Pettersson <blake.pettersson@gmail.com> Co-authored-by: Alexandre Gaudreault <alexandre_gaudreault@intuit.com>
36 lines
746 B
Go
36 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"]))
|
|
})
|
|
}
|