fix parse pairs

This commit is contained in:
xilabao
2017-06-01 16:48:02 +08:00
parent 91cef78f43
commit 8fe8e4f106
3 changed files with 35 additions and 3 deletions

View File

@@ -289,6 +289,14 @@ func TestLabelErrors(t *testing.T) {
args: []string{"pods"},
errFn: func(err error) bool { return strings.Contains(err.Error(), "at least one label update is required") },
},
"wrong labels": {
args: []string{"pods", "-"},
errFn: func(err error) bool { return strings.Contains(err.Error(), "at least one label update is required") },
},
"wrong labels 2": {
args: []string{"pods", "=bar"},
errFn: func(err error) bool { return strings.Contains(err.Error(), "at least one label update is required") },
},
"no resources": {
args: []string{"pods-"},
errFn: func(err error) bool { return strings.Contains(err.Error(), "one or more resources must be specified") },