Merge pull request #22913 from liggitt/unit-test-package

Auto commit by PR queue bot
pull/6/head
k8s-merge-robot 2016-03-23 21:46:34 -07:00
commit dae5ac4828
1 changed files with 8 additions and 0 deletions

View File

@ -36,6 +36,14 @@ type ExtensionAPIObject struct {
func (obj *ExtensionAPIObject) GetObjectKind() unversioned.ObjectKind { return &obj.TypeMeta }
func TestGetReference(t *testing.T) {
// when vendoring kube, if you don't force the set of registered versions (like this hack/test-go.sh does)
// then you run into trouble because the types aren't registered in the scheme by anything. This does the
// register manually to allow unit test execution
if _, err := Scheme.ObjectKind(&Pod{}); err != nil {
AddToScheme(Scheme)
}
table := map[string]struct {
obj runtime.Object
ref *ObjectReference