Skip to content

Commit

Permalink
Merge pull request #8947 from hs0210/work
Browse files Browse the repository at this point in the history
Add unit test for func rewriteAPIGroup
  • Loading branch information
k8s-ci-robot committed Apr 21, 2020
2 parents df264a2 + 4203d9b commit fccc043
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions pkg/kopscodecs/codecs_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ limitations under the License.
package kopscodecs

import (
"reflect"
"strings"
"testing"
"time"
Expand Down Expand Up @@ -74,3 +75,13 @@ func TestToVersionedYaml(t *testing.T) {
}

}

func TestRewriteAPIGroup(t *testing.T) {
input := []byte("apiVersion: kops/v1alpha2\nkind: Cluster")
expected := []byte("apiVersion: kops.k8s.io/v1alpha2\nkind: Cluster")
actual := rewriteAPIGroup(input)

if !reflect.DeepEqual(actual, expected) {
t.Errorf("unexpected return value, expected=%v, actual=%v", expected, actual)
}
}

0 comments on commit fccc043

Please sign in to comment.