From cb123dc957d202bc80b89e2b0bfa71feaff4528d Mon Sep 17 00:00:00 2001 From: Chao Xu Date: Wed, 3 Jun 2015 16:48:05 -0700 Subject: [PATCH] in api/testapi/testapt_test.go, remove tests for v1beta1, add tests for v1 --- pkg/api/testapi/testapi_test.go | 44 ++++++++++++++++----------------- 1 file changed, 22 insertions(+), 22 deletions(-) diff --git a/pkg/api/testapi/testapi_test.go b/pkg/api/testapi/testapi_test.go index 77182c4458b..253c3b735d2 100644 --- a/pkg/api/testapi/testapi_test.go +++ b/pkg/api/testapi/testapi_test.go @@ -46,9 +46,9 @@ func TestResourcePathWithPrefixForV1Beta3(t *testing.T) { } } -func TestResourcePathWithPrefixForV1Beta1(t *testing.T) { - if Version() != "v1beta1" { - // Skip the test if we are not testing v1beta1. +func TestResourcePathWithPrefixForV1(t *testing.T) { + if Version() != "v1" { + // Skip the test if we are not testing v1. return } @@ -59,11 +59,11 @@ func TestResourcePathWithPrefixForV1Beta1(t *testing.T) { name string expected string }{ - {"prefix", "resource", "mynamespace", "myresource", "/api/v1beta1/prefix/resource/myresource"}, - {"prefix", "resource", "", "myresource", "/api/v1beta1/prefix/resource/myresource"}, - {"prefix", "resource", "mynamespace", "", "/api/v1beta1/prefix/resource"}, - {"prefix", "resource", "", "", "/api/v1beta1/prefix/resource"}, - {"", "resource", "mynamespace", "myresource", "/api/v1beta1/resource/myresource"}, + {"prefix", "resource", "mynamespace", "myresource", "/api/v1/prefix/namespaces/mynamespace/resource/myresource"}, + {"prefix", "resource", "", "myresource", "/api/v1/prefix/resource/myresource"}, + {"prefix", "resource", "mynamespace", "", "/api/v1/prefix/namespaces/mynamespace/resource"}, + {"prefix", "resource", "", "", "/api/v1/prefix/resource"}, + {"", "resource", "mynamespace", "myresource", "/api/v1/namespaces/mynamespace/resource/myresource"}, } for _, item := range testCases { if actual := ResourcePathWithPrefix(item.prefix, item.resource, item.namespace, item.name); actual != item.expected { @@ -96,9 +96,9 @@ func TestResourcePathForV1Beta3(t *testing.T) { } } -func TestResourcePathForV1Beta1(t *testing.T) { - if Version() != "v1beta1" { - // Skip the test if we are not testing v1beta1. +func TestResourcePathForV1(t *testing.T) { + if Version() != "v1" { + // Skip the test if we are not testing v1. return } @@ -108,10 +108,10 @@ func TestResourcePathForV1Beta1(t *testing.T) { name string expected string }{ - {"resource", "mynamespace", "myresource", "/api/v1beta1/resource/myresource"}, - {"resource", "", "myresource", "/api/v1beta1/resource/myresource"}, - {"resource", "mynamespace", "", "/api/v1beta1/resource"}, - {"resource", "", "", "/api/v1beta1/resource"}, + {"resource", "mynamespace", "myresource", "/api/v1/namespaces/mynamespace/resource/myresource"}, + {"resource", "", "myresource", "/api/v1/resource/myresource"}, + {"resource", "mynamespace", "", "/api/v1/namespaces/mynamespace/resource"}, + {"resource", "", "", "/api/v1/resource"}, } for _, item := range testCases { if actual := ResourcePath(item.resource, item.namespace, item.name); actual != item.expected { @@ -144,9 +144,9 @@ func TestResourcePathWithNamespaceQueryForV1Beta3(t *testing.T) { } } -func TestResourcePathWithNamespaceQueryForV1Beta1(t *testing.T) { - if Version() != "v1beta1" { - // Skip the test if we are not testing v1beta1. +func TestResourcePathWithNamespaceQueryForV1(t *testing.T) { + if Version() != "v1" { + // Skip the test if we are not testing v1. return } @@ -156,10 +156,10 @@ func TestResourcePathWithNamespaceQueryForV1Beta1(t *testing.T) { name string expected string }{ - {"resource", "mynamespace", "myresource", "/api/v1beta1/resource/myresource?namespace=mynamespace"}, - {"resource", "", "myresource", "/api/v1beta1/resource/myresource"}, - {"resource", "mynamespace", "", "/api/v1beta1/resource?namespace=mynamespace"}, - {"resource", "", "", "/api/v1beta1/resource"}, + {"resource", "mynamespace", "myresource", "/api/v1/namespaces/mynamespace/resource/myresource"}, + {"resource", "", "myresource", "/api/v1/resource/myresource"}, + {"resource", "mynamespace", "", "/api/v1/namespaces/mynamespace/resource"}, + {"resource", "", "", "/api/v1/resource"}, } for _, item := range testCases { if actual := ResourcePathWithNamespaceQuery(item.resource, item.namespace, item.name); actual != item.expected {