|
|
@ -100,7 +100,7 @@ func TestInstall(t *testing.T) {
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
func TestValues(t *testing.T) {
|
|
|
|
func TestValues(t *testing.T) {
|
|
|
|
args := "sailor=sinbad,good,port.source=baghdad,port.destination=basrah"
|
|
|
|
args := "sailor=sinbad,good,port.source=baghdad,port.destination=basrah,success=True"
|
|
|
|
vobj := new(values)
|
|
|
|
vobj := new(values)
|
|
|
|
vobj.Set(args)
|
|
|
|
vobj.Set(args)
|
|
|
|
|
|
|
|
|
|
|
@ -113,6 +113,10 @@ func TestValues(t *testing.T) {
|
|
|
|
t.Errorf("Expected good to be true. Got %v", vals["good"])
|
|
|
|
t.Errorf("Expected good to be true. Got %v", vals["good"])
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if !vals["success"].(bool) {
|
|
|
|
|
|
|
|
t.Errorf("Expected boolean true. Got %T, %v", vals["success"], vals["success"])
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
port := vals["port"].(map[string]interface{})
|
|
|
|
port := vals["port"].(map[string]interface{})
|
|
|
|
|
|
|
|
|
|
|
|
if fmt.Sprint(port["source"]) != "baghdad" {
|
|
|
|
if fmt.Sprint(port["source"]) != "baghdad" {
|
|
|
@ -127,6 +131,7 @@ port:
|
|
|
|
destination: basrah
|
|
|
|
destination: basrah
|
|
|
|
source: baghdad
|
|
|
|
source: baghdad
|
|
|
|
sailor: sinbad
|
|
|
|
sailor: sinbad
|
|
|
|
|
|
|
|
success: true
|
|
|
|
`
|
|
|
|
`
|
|
|
|
out, err := vobj.yaml()
|
|
|
|
out, err := vobj.yaml()
|
|
|
|
if err != nil {
|
|
|
|
if err != nil {
|
|
|
@ -147,6 +152,7 @@ port:
|
|
|
|
destination: basrah
|
|
|
|
destination: basrah
|
|
|
|
source: baghdad
|
|
|
|
source: baghdad
|
|
|
|
sailor: pisti
|
|
|
|
sailor: pisti
|
|
|
|
|
|
|
|
success: true
|
|
|
|
`
|
|
|
|
`
|
|
|
|
newOut, err := vobj.yaml()
|
|
|
|
newOut, err := vobj.yaml()
|
|
|
|
if err != nil {
|
|
|
|
if err != nil {
|
|
|
|