31 lines
1.0 KiB
Go
31 lines
1.0 KiB
Go
|
package chart
|
||
|
|
||
|
// https://pkg.go.dev/github.com/stretchr/testify/assert
|
||
|
|
||
|
import (
|
||
|
"testing"
|
||
|
"path/filepath"
|
||
|
"github.com/stretchr/testify/assert"
|
||
|
)
|
||
|
|
||
|
|
||
|
func TestReadConfChart(t *testing.T){
|
||
|
src := filepath.Join(TEST_SRC_DIR, "oc.yml")
|
||
|
|
||
|
assert.FileExists(t, src, "FromConfigFile error")
|
||
|
|
||
|
data := FromConfigFile(src)
|
||
|
assert.Equal(t, data[0].Name, "bitnami", "FromConfigFile error")
|
||
|
assert.Equal(t, data[0].Repository, "https://charts.bitnami.com/bitnami", "FromConfigFile error")
|
||
|
|
||
|
wordpress := data[0].Charts[0]
|
||
|
assert.Equal(t, wordpress.Name, "wordpress", "FromConfigFile error")
|
||
|
assert.Equal(t, wordpress.Chart, "bitnami/wordpress", "FromConfigFile error")
|
||
|
assert.Equal(t, wordpress.Version, "23.1.0", "FromConfigFile error")
|
||
|
|
||
|
phpmyadmin := data[0].Charts[1]
|
||
|
assert.Equal(t, phpmyadmin.Name, "phpmyadmin", "FromConfigFile error")
|
||
|
assert.Equal(t, phpmyadmin.Chart, "bitnami/phpmyadmin", "FromConfigFile error")
|
||
|
assert.Equal(t, phpmyadmin.Version, "17.0.4", "FromConfigFile error")
|
||
|
}
|