From 7118f90eff022f1ab7a3f887c0a2c9b57d589468 Mon Sep 17 00:00:00 2001 From: deads2k Date: Tue, 8 Dec 2015 10:34:22 -0500 Subject: [PATCH] update test to pass properly and reflect actual behavior --- pkg/api/meta/restmapper_test.go | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/pkg/api/meta/restmapper_test.go b/pkg/api/meta/restmapper_test.go index b1eab1b3a3e6f..be8f7eaf2f770 100644 --- a/pkg/api/meta/restmapper_test.go +++ b/pkg/api/meta/restmapper_test.go @@ -210,15 +210,19 @@ func TestRESTMapperResourceSingularizer(t *testing.T) { {Kind: "Status", MixedCase: false, Plural: "statuses", Singular: "status"}, {Kind: "lowercase", MixedCase: false, Plural: "lowercases", Singular: "lowercase"}, - // Don't add extra s if the original object is already plural - {Kind: "lowercases", MixedCase: false, Plural: "lowercases", Singular: "lowercases"}, + // TODO this test is broken. This updates to reflect actual behavior. Kinds are expected to be singular + // old (incorrect), coment: Don't add extra s if the original object is already plural + {Kind: "lowercases", MixedCase: false, Plural: "lowercaseses", Singular: "lowercases"}, } for i, testCase := range testCases { mapper := NewDefaultRESTMapper([]unversioned.GroupVersion{testGroupVersion}, fakeInterfaces) // create singular/plural mapping mapper.Add(testGroupVersion.WithKind(testCase.Kind), RESTScopeNamespace, testCase.MixedCase) - singular, _ := mapper.ResourceSingularizer(testCase.Plural) + singular, err := mapper.ResourceSingularizer(testCase.Plural) + if err != nil { + t.Errorf("%d: unexpected error: %v", i, err) + } if singular != testCase.Singular { t.Errorf("%d: mismatched singular: %s, should be %s", i, singular, testCase.Singular) }