mirror of
https://github.com/helm/helm.git
synced 2026-02-27 03:51:27 -05:00
ref(helm): simplify tunnel tests
This commit is contained in:
parent
4691251ff4
commit
123fb9e2fe
2 changed files with 2 additions and 7 deletions
|
|
@ -68,5 +68,5 @@ func getFirstRunningPod(client unversioned.PodsNamespacer, namespace string, sel
|
|||
return &p, nil
|
||||
}
|
||||
}
|
||||
return nil, fmt.Errorf("could not find a ready pod")
|
||||
return nil, fmt.Errorf("could not find a ready tiller pod")
|
||||
}
|
||||
|
|
|
|||
|
|
@ -21,7 +21,6 @@ import (
|
|||
|
||||
"k8s.io/kubernetes/pkg/api"
|
||||
"k8s.io/kubernetes/pkg/client/unversioned/testclient"
|
||||
"k8s.io/kubernetes/pkg/runtime"
|
||||
)
|
||||
|
||||
func mockTillerPod() api.Pod {
|
||||
|
|
@ -75,11 +74,7 @@ func TestGetFirstPod(t *testing.T) {
|
|||
}
|
||||
|
||||
for _, tt := range tests {
|
||||
client := &testclient.Fake{}
|
||||
client.PrependReactor("list", "pods", func(action testclient.Action) (handled bool, ret runtime.Object, err error) {
|
||||
return true, &api.PodList{Items: tt.pods}, nil
|
||||
})
|
||||
|
||||
client := testclient.NewSimpleFake(&api.PodList{Items: tt.pods})
|
||||
name, err := getTillerPodName(client, api.NamespaceDefault)
|
||||
if (err != nil) != tt.err {
|
||||
t.Errorf("%q. expected error: %v, got %v", tt.name, tt.err, err)
|
||||
|
|
|
|||
Loading…
Reference in a new issue