Fix typo in kubectl/.../attach_test.go
exepctedErr -> expectedErr Kubernetes-commit: b34d00aa09084d5786d4ca5cf11b173be9f791eb
This commit is contained in:
parent
952f50e545
commit
3bac60a8ed
|
@ -200,7 +200,7 @@ func TestAttach(t *testing.T) {
|
||||||
name, version, podPath, fetchPodPath, attachPath, container string
|
name, version, podPath, fetchPodPath, attachPath, container string
|
||||||
pod *corev1.Pod
|
pod *corev1.Pod
|
||||||
remoteAttachErr bool
|
remoteAttachErr bool
|
||||||
exepctedErr string
|
expectedErr string
|
||||||
}{
|
}{
|
||||||
{
|
{
|
||||||
name: "pod attach",
|
name: "pod attach",
|
||||||
|
@ -220,7 +220,7 @@ func TestAttach(t *testing.T) {
|
||||||
pod: attachPod(),
|
pod: attachPod(),
|
||||||
remoteAttachErr: true,
|
remoteAttachErr: true,
|
||||||
container: "bar",
|
container: "bar",
|
||||||
exepctedErr: "attach error",
|
expectedErr: "attach error",
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
name: "container not found error",
|
name: "container not found error",
|
||||||
|
@ -230,7 +230,7 @@ func TestAttach(t *testing.T) {
|
||||||
attachPath: "/api/" + version + "/namespaces/test/pods/foo/attach",
|
attachPath: "/api/" + version + "/namespaces/test/pods/foo/attach",
|
||||||
pod: attachPod(),
|
pod: attachPod(),
|
||||||
container: "foo",
|
container: "foo",
|
||||||
exepctedErr: "cannot attach to the container: container not found (foo)",
|
expectedErr: "cannot attach to the container: container not found (foo)",
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
for _, test := range tests {
|
for _, test := range tests {
|
||||||
|
@ -290,15 +290,15 @@ func TestAttach(t *testing.T) {
|
||||||
}
|
}
|
||||||
|
|
||||||
err := options.Run()
|
err := options.Run()
|
||||||
if test.exepctedErr != "" && err.Error() != test.exepctedErr {
|
if test.expectedErr != "" && err.Error() != test.expectedErr {
|
||||||
t.Errorf("%s: Unexpected exec error: %v", test.name, err)
|
t.Errorf("%s: Unexpected exec error: %v", test.name, err)
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
if test.exepctedErr == "" && err != nil {
|
if test.expectedErr == "" && err != nil {
|
||||||
t.Errorf("%s: Unexpected error: %v", test.name, err)
|
t.Errorf("%s: Unexpected error: %v", test.name, err)
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
if test.exepctedErr != "" {
|
if test.expectedErr != "" {
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
if remoteAttach.url.Path != test.attachPath {
|
if remoteAttach.url.Path != test.attachPath {
|
||||||
|
|
Loading…
Reference in New Issue