add URL path generation function

This commit is contained in:
Daniel Smith
2015-02-23 17:17:39 -08:00
parent 2d56547524
commit 78d05e5307
2 changed files with 26 additions and 3 deletions

View File

@@ -20,6 +20,7 @@ import (
"net/http"
"net/http/httptest"
"reflect"
"strings"
"testing"
"github.com/GoogleCloudPlatform/kubernetes/pkg/api"
@@ -142,6 +143,9 @@ func TestGetAPIRequestInfo(t *testing.T) {
if !reflect.DeepEqual(successCase.expectedParts, apiRequestInfo.Parts) {
t.Errorf("Unexpected parts for url: %s, expected: %v, actual: %v", successCase.url, successCase.expectedParts, apiRequestInfo.Parts)
}
if e, a := strings.Split(successCase.url, "?")[0], apiRequestInfo.URLPath(); e != a {
t.Errorf("Expected %v, got %v", e, a)
}
}
errorCases := map[string]string{