Update pkg/api/testapi because namespace is always in the path since we remove v1beta1/2

This commit is contained in:
Chao Xu
2015-06-15 17:06:34 -07:00
parent b65c321a87
commit a309d3e652
8 changed files with 28 additions and 84 deletions

View File

@@ -78,10 +78,6 @@ func path(resource, namespace, name string) string {
return testapi.ResourcePath(resource, namespace, name)
}
func pathWithNamespaceQuery(resource, namespace, name string) string {
return testapi.ResourcePathWithNamespaceQuery(resource, namespace, name)
}
func pathWithPrefix(prefix, resource, namespace, name string) string {
return testapi.ResourcePathWithPrefix(prefix, resource, namespace, name)
}
@@ -90,10 +86,6 @@ func timeoutPath(resource, namespace, name string) string {
return addTimeoutFlag(testapi.ResourcePath(resource, namespace, name))
}
func timeoutPathWithNamespaceQuery(resource, namespace, name string) string {
return addTimeoutFlag(testapi.ResourcePathWithNamespaceQuery(resource, namespace, name))
}
// Bodies for requests used in subsequent tests.
var aPod string = `
{
@@ -846,15 +838,15 @@ func TestNamespaceAuthorization(t *testing.T) {
statusCodes map[int]bool // allowed status codes.
}{
{"POST", timeoutPathWithNamespaceQuery("pods", "foo", ""), "foo", aPod, code201},
{"GET", pathWithNamespaceQuery("pods", "foo", ""), "foo", "", code200},
{"GET", pathWithNamespaceQuery("pods", "foo", "a"), "foo", "", code200},
{"DELETE", timeoutPathWithNamespaceQuery("pods", "foo", "a"), "foo", "", code200},
{"POST", timeoutPath("pods", "foo", ""), "foo", aPod, code201},
{"GET", path("pods", "foo", ""), "foo", "", code200},
{"GET", path("pods", "foo", "a"), "foo", "", code200},
{"DELETE", timeoutPath("pods", "foo", "a"), "foo", "", code200},
{"POST", timeoutPath("pods", "bar", ""), "bar", aPod, code403},
{"GET", pathWithNamespaceQuery("pods", "bar", ""), "bar", "", code403},
{"GET", pathWithNamespaceQuery("pods", "bar", "a"), "bar", "", code403},
{"DELETE", timeoutPathWithNamespaceQuery("pods", "bar", "a"), "bar", "", code403},
{"GET", path("pods", "bar", ""), "bar", "", code403},
{"GET", path("pods", "bar", "a"), "bar", "", code403},
{"DELETE", timeoutPath("pods", "bar", "a"), "bar", "", code403},
{"POST", timeoutPath("pods", api.NamespaceDefault, ""), "", aPod, code403},
{"GET", path("pods", "", ""), "", "", code403},