oc-deploy/src/helm/repo_test.go

39 lines
831 B
Go
Raw Normal View History

2024-09-02 13:44:44 +02:00
package helm
import (
2024-09-05 09:26:32 +02:00
"fmt"
// "os"
// "path/filepath"
2024-09-02 13:44:44 +02:00
2024-09-05 09:26:32 +02:00
"testing"
2024-09-02 13:44:44 +02:00
2024-09-05 09:26:32 +02:00
"github.com/stretchr/testify/assert"
2024-09-02 13:44:44 +02:00
)
2024-09-05 09:26:32 +02:00
func TestHelmRepoAdd(t *testing.T) {
repo := HelmRepo{
Bin: "./helm",
Name: "repooc",
Repository: "https://url",
ForceUpdate: true,
Opts: ""}
fmt.Println(" TestHelmRepoAdd ", repo)
res, err := repo.AddRepository()
fmt.Println("TestHelmRepoAdd.24", res, err)
}
// helm : not found
func TestHelmRepoAddErr(t *testing.T) {
repo := HelmRepo{
Bin: "./helm",
Name: "repooc",
Repository: "https://url",
ForceUpdate: true,
Opts: ""}
2024-09-02 13:44:44 +02:00
2024-09-05 09:26:32 +02:00
_, err := repo.AddRepository()
assert.NotNilf(t, err, "error message %s", "./helm")
2024-09-02 09:09:46 +02:00
}