move test case

This commit is contained in:
nimohunter
2019-09-19 15:45:31 +08:00
parent b5d5e70bdc
commit d8250c9ee2
2 changed files with 16 additions and 22 deletions

View File

@@ -138,6 +138,22 @@ kind: Namespace
metadata:
annotations:
foo: bar
`),
expectedOut: nil,
expectedErr: true,
},
{
name: "nil value in list",
input: []byte(`
apiVersion: builtin
kind: ConfigMapGenerator
metadata:
name: kube100-site
labels:
app: web
testList:
- testA
-
`),
expectedOut: nil,
expectedErr: true,

View File

@@ -98,21 +98,6 @@ items:
patch7 := `
apiVersion: v1
kind: List
`
patchList5 := types.PatchStrategicMerge("patch8.yaml")
patch8 := `
apiVersion: builtin
kind: ConfigMapGenerator
metadata:
name: kube100-site
labels:
app: web
testList:
- testA
-
literals:
- FRUIT=apple
- VEGETABLE=carrot
`
testDeploymentSpec := map[string]interface{}{
"template": map[string]interface{}{
@@ -154,7 +139,6 @@ literals:
l.AddFile("/"+string(patchList2), []byte(patch5))
l.AddFile("/"+string(patchList3), []byte(patch6))
l.AddFile("/"+string(patchList4), []byte(patch7))
l.AddFile("/"+string(patchList5), []byte(patch8))
tests := []struct {
name string
@@ -204,12 +188,6 @@ literals:
expectedOut: []*Resource{},
expectedErr: false,
},
{
name: "listWithEmptyList",
input: []types.PatchStrategicMerge{patchList5},
expectedOut: []*Resource{},
expectedErr: true,
},
}
for _, test := range tests {
rs, err := factory.SliceFromPatches(l, test.input)