30 lines
741 B
Go
30 lines
741 B
Go
|
package helm
|
||
|
|
||
|
import (
|
||
|
"testing"
|
||
|
|
||
|
"github.com/stretchr/testify/assert"
|
||
|
)
|
||
|
|
||
|
func TestHelmChartExists(t *testing.T){
|
||
|
|
||
|
cmd := getCmdHelm(true, `oc-catalog default 1 2024-09-06 16:01:49.17368605 +0200 CEST deployed oc-catalog-0.1.0 1.0`)
|
||
|
|
||
|
data := HelmChart{Name: "oc-catalog"}
|
||
|
res, err := cmd.chartExists(data)
|
||
|
|
||
|
assert.Nilf(t, err, "error message %s", err)
|
||
|
assert.Truef(t, res, "TestHelmVersion error")
|
||
|
}
|
||
|
|
||
|
|
||
|
func TestHelmChartNotExists(t *testing.T){
|
||
|
|
||
|
cmd := getCmdHelm(true, "\n")
|
||
|
|
||
|
data := HelmChart{Name: "phpmyadmin"}
|
||
|
res, err := cmd.chartExists(data)
|
||
|
|
||
|
assert.Nilf(t, err, "error message %s", err)
|
||
|
assert.Falsef(t, res, "TestHelmVersion error")
|
||
|
}
|