Ressources
This commit is contained in:
28
src/helm/ressources_test.go
Normal file
28
src/helm/ressources_test.go
Normal file
@@ -0,0 +1,28 @@
|
||||
package helm
|
||||
|
||||
import (
|
||||
"os"
|
||||
"path/filepath"
|
||||
|
||||
"testing"
|
||||
|
||||
"github.com/stretchr/testify/assert"
|
||||
)
|
||||
|
||||
type MockCommandStatus HelmCommandData
|
||||
|
||||
func TestHelmStatus(t *testing.T){
|
||||
|
||||
hs := HelmStatus{Name: "oc-catalog"}
|
||||
hs.NewMock(MockCommandStatus{})
|
||||
|
||||
data, _ := hs.getRessources()
|
||||
assert.Equal(t, "StatefulSet", data["oc-catalog-oc-catalog"], "TestHelmStatus error")
|
||||
}
|
||||
|
||||
// Mock
|
||||
func (this MockCommandStatus) Status(name string) (string, error) {
|
||||
fileName := filepath.Join(TEST_SRC_DIR, "helm_status.json")
|
||||
data, _ := os.ReadFile(fileName)
|
||||
return string(data), nil
|
||||
}
|
||||
Reference in New Issue
Block a user