2019-05-08 00:55:39 +08:00
|
|
|
package pluginproxy
|
|
|
|
|
|
|
|
import (
|
|
|
|
"testing"
|
|
|
|
|
|
|
|
. "github.com/smartystreets/goconvey/convey"
|
|
|
|
)
|
|
|
|
|
|
|
|
func TestInterpolateString(t *testing.T) {
|
|
|
|
Convey("When interpolating string", t, func() {
|
|
|
|
data := templateData{
|
|
|
|
SecureJsonData: map[string]string{
|
|
|
|
"Test": "0asd+asd",
|
|
|
|
},
|
|
|
|
}
|
|
|
|
|
2020-11-17 17:56:42 +08:00
|
|
|
interpolated, err := interpolateString("{{.SecureJsonData.Test}}", data)
|
2019-05-08 00:55:39 +08:00
|
|
|
So(err, ShouldBeNil)
|
|
|
|
So(interpolated, ShouldEqual, "0asd+asd")
|
|
|
|
})
|
|
|
|
}
|