Skip to content

Commit

Permalink
update test to pass properly and reflect actual behavior
Browse files Browse the repository at this point in the history
  • Loading branch information
deads2k committed Dec 9, 2015
1 parent 78c31b6 commit 7118f90
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions pkg/api/meta/restmapper_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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)
}
Expand Down

1 comment on commit 7118f90

@k8s-teamcity-mesosphere

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

TeamCity OSS :: Kubernetes Mesos :: 4 - Smoke Tests Build 8790 outcome was FAILURE
Summary: Tests failed: 1 (1 new), passed: 0, ignored: 205 Build time: 00:03:39

Failed tests

null: Kubernetes e2e suite.Kubectl client Guestbook application should create and stop a working application [Conformance]: <no details avaliable>

Please sign in to comment.