Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

simplified TestNewKubeletClient in kubelet_test #2822

Merged
merged 1 commit into from
Dec 10, 2014
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
16 changes: 8 additions & 8 deletions pkg/client/kubelet_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@ package client

import (
"encoding/json"
"fmt"
"net/http"
"net/http/httptest"
"net/url"
Expand All @@ -27,6 +26,7 @@ import (
"testing"

"github.com/GoogleCloudPlatform/kubernetes/pkg/api"
"github.com/GoogleCloudPlatform/kubernetes/pkg/health"
"github.com/GoogleCloudPlatform/kubernetes/pkg/util"
)

Expand Down Expand Up @@ -116,21 +116,21 @@ func TestNewKubeletClient(t *testing.T) {
Port: 9000,
EnableHttps: false,
}

client, err := NewKubeletClient(config)
if err != nil {
t.Errorf("Error %#v while trying to create a client.", err)
t.Errorf("Error while trying to create a client: %v", err)
}

if client == nil {
t.Errorf("%#v client is nil.", client)
t.Error("client is nil.")
}

host := "127.0.0.1"
healthStatus, err := client.HealthCheck(host)
if !(fmt.Sprintf("%v", healthStatus) == "unknown") {
t.Errorf("Expected %v and got %v.", "unknown", healthStatus)
if healthStatus != health.Unknown {
t.Errorf("Expected %v and got %v.", health.Unknown, healthStatus)
}
if err == nil {
t.Errorf("%#v", "Expected a non nil error")
t.Error("Expected a non nil error")
}

}