mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-07-23 19:56:01 +00:00
Merge pull request #82 from danielnorberg/dano/fix-cloudcfg-test-dorequest
cloudcfg: fix TestDoRequest
This commit is contained in:
commit
c0f41e2a86
@ -23,6 +23,7 @@ import (
|
|||||||
"testing"
|
"testing"
|
||||||
|
|
||||||
. "github.com/GoogleCloudPlatform/kubernetes/pkg/api"
|
. "github.com/GoogleCloudPlatform/kubernetes/pkg/api"
|
||||||
|
"github.com/GoogleCloudPlatform/kubernetes/pkg/client"
|
||||||
"github.com/GoogleCloudPlatform/kubernetes/pkg/util"
|
"github.com/GoogleCloudPlatform/kubernetes/pkg/util"
|
||||||
)
|
)
|
||||||
|
|
||||||
@ -152,7 +153,8 @@ func TestDoRequest(t *testing.T) {
|
|||||||
}
|
}
|
||||||
testServer := httptest.NewTLSServer(&fakeHandler)
|
testServer := httptest.NewTLSServer(&fakeHandler)
|
||||||
request, _ := http.NewRequest("GET", testServer.URL+"/foo/bar", nil)
|
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 {
|
if request.Header["Authorization"] == nil {
|
||||||
t.Errorf("Request is missing authorization header: %#v", *request)
|
t.Errorf("Request is missing authorization header: %#v", *request)
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user