1
0
Fork 0
mirror of https://github.com/kyverno/kyverno.git synced 2025-04-08 10:04:25 +00:00

update test

This commit is contained in:
shivkumar dudhani 2019-12-12 10:55:10 -08:00
parent 8b1e084691
commit 507c43ddca
2 changed files with 8 additions and 0 deletions

View file

@ -1,6 +1,7 @@
package context
import (
"reflect"
"testing"
)
@ -39,6 +40,8 @@ func Test_Add(t *testing.T) {
}
`)
expectedResult := "my-namespace"
var err error
ctx := NewContext()
ctx.Add("resource", rawResource)
@ -47,5 +50,9 @@ func Test_Add(t *testing.T) {
if err != nil {
t.Error(err)
}
t.Log(expectedResult)
t.Log(result)
if !reflect.DeepEqual(expectedResult, result) {
t.Error("exected result does not match")
}
}

View file

@ -68,6 +68,7 @@ func substituteValue(ctx context.EvalInterface, valuePattern string) interface{}
return emptyInterface
}
}
func getValueQuery(ctx context.EvalInterface, valuePattern string) interface{} {
var emptyInterface interface{}
// extract variable {{<variable>}}