Merge pull request #82 from danielnorberg/dano/fix-cloudcfg-test-dorequest

cloudcfg: fix TestDoRequest
pull/6/head
brendandburns 2014-06-12 13:37:04 -07:00
commit c0f41e2a86
1 changed files with 3 additions and 1 deletions

View File

@ -23,6 +23,7 @@ import (
"testing"
. "github.com/GoogleCloudPlatform/kubernetes/pkg/api"
"github.com/GoogleCloudPlatform/kubernetes/pkg/client"
"github.com/GoogleCloudPlatform/kubernetes/pkg/util"
)
@ -152,7 +153,8 @@ func TestDoRequest(t *testing.T) {
}
testServer := httptest.NewTLSServer(&fakeHandler)
request, _ := http.NewRequest("GET", testServer.URL+"/foo/bar", nil)
body, err := DoRequest(request, "user", "pass")
auth := client.AuthInfo{User: "user", Password: "pass"}
body, err := DoRequest(request, &auth)
if request.Header["Authorization"] == nil {
t.Errorf("Request is missing authorization header: %#v", *request)
}