github.com/argoproj/argo-cd@v1.8.7/util/helm/helmver_test.go (about)

     1  package helm
     2  
     3  import (
     4  	"testing"
     5  
     6  	"github.com/stretchr/testify/assert"
     7  )
     8  
     9  func TestGetHelmVersion_Helm3(t *testing.T) {
    10  	ver, err := getHelmVersion("./testdata/minio")
    11  	assert.NoError(t, err)
    12  	assert.Equal(t, ver.binaryName, HelmV3.binaryName)
    13  }
    14  
    15  func TestGetHelmVersion_Helm2(t *testing.T) {
    16  	ver, err := getHelmVersion("./testdata/helm2-dependency")
    17  	assert.NoError(t, err)
    18  	assert.Equal(t, ver.binaryName, HelmV2.binaryName)
    19  }
    20  
    21  func TestGetHelmVersion_InvalidVersion(t *testing.T) {
    22  	_, err := getHelmVersion("./testdata/invalid-version")
    23  	assert.Error(t, err)
    24  }