Delete some kunstruct code in favor of apimachinery code.

This commit is contained in:
jregan
2018-10-15 10:10:12 -07:00
parent 5253747c00
commit f20528be35
2 changed files with 13 additions and 36 deletions

View File

@@ -76,49 +76,49 @@ func TestGetFieldValue(t *testing.T) {
name: "empty",
pathToField: "",
errorExpected: true,
errorMsg: "at path '': no field named ''",
errorMsg: "no field named ''",
},
{
name: "emptyDotEmpty",
pathToField: ".",
errorExpected: true,
errorMsg: "at path '.': no field named ''",
errorMsg: "no field named '.'",
},
{
name: "twoFieldsOneMissing",
pathToField: "metadata.banana",
errorExpected: true,
errorMsg: "at path 'metadata.banana': no field named 'banana'",
errorMsg: "no field named 'metadata.banana'",
},
{
name: "deeperMissingField",
pathToField: "this.is.aDeep.field.that.does.not.exist",
errorExpected: true,
errorMsg: "at path 'this.is.aDeep.field.that.does.not.exist': no field named 'aDeep'",
errorMsg: "no field named 'this.is.aDeep.field.that.does.not.exist'",
},
{
name: "emptyMap",
pathToField: "this.is.anEmptyMap",
errorExpected: true,
errorMsg: "at path 'this.is.anEmptyMap': value at 'anEmptyMap' not a string",
errorMsg: ".this.is.anEmptyMap accessor error: map[] is of the type map[string]interface {}, expected string",
},
{
name: "numberAsValue",
pathToField: "this.is.aNumber",
errorExpected: true,
errorMsg: "at path 'this.is.aNumber': value at 'aNumber' not a string",
errorMsg: ".this.is.aNumber accessor error: 1000 is of the type int, expected string",
},
{
name: "nilAsValue",
pathToField: "this.is.aNilValue",
errorExpected: true,
errorMsg: "at path 'this.is.aNilValue': value at 'aNilValue' not a string",
errorMsg: ".this.is.aNilValue accessor error: <nil> is of the type <nil>, expected string",
},
{
name: "unrecognizable",
pathToField: "this.is.unrecognizable.Name",
errorExpected: true,
errorMsg: "at path 'this.is.unrecognizable.Name': Expected map at unrecognizable, but got testing.InternalExample={fooBar <nil> false}",
errorMsg: ".this.is.unrecognizable.Name accessor error: {fooBar <nil> false} is of the type testing.InternalExample, expected map[string]interface{}",
},
}