compute query parameter names in the client.

This commit is contained in:
Daniel Smith
2015-04-06 16:54:26 -07:00
parent 0e10b2a842
commit 44bc29631e
19 changed files with 91 additions and 70 deletions

View File

@@ -22,6 +22,8 @@ import (
"strings"
"testing"
"github.com/GoogleCloudPlatform/kubernetes/pkg/api"
"github.com/GoogleCloudPlatform/kubernetes/pkg/api/testapi"
"github.com/GoogleCloudPlatform/kubernetes/pkg/client"
)
@@ -187,12 +189,12 @@ func TestDeleteMultipleSelector(t *testing.T) {
Client: client.HTTPClientFunc(func(req *http.Request) (*http.Response, error) {
switch p, m := req.URL.Path, req.Method; {
case p == "/namespaces/test/pods" && m == "GET":
if req.URL.Query().Get("labels") != "a=b" {
if req.URL.Query().Get(api.LabelSelectorQueryParam(testapi.Version())) != "a=b" {
t.Fatalf("unexpected request: %#v\n%#v", req.URL, req)
}
return &http.Response{StatusCode: 200, Body: objBody(codec, pods)}, nil
case p == "/namespaces/test/services" && m == "GET":
if req.URL.Query().Get("labels") != "a=b" {
if req.URL.Query().Get(api.LabelSelectorQueryParam(testapi.Version())) != "a=b" {
t.Fatalf("unexpected request: %#v\n%#v", req.URL, req)
}
return &http.Response{StatusCode: 200, Body: objBody(codec, svc)}, nil