Skip to content

Commit

Permalink
WIP - add events test
Browse files Browse the repository at this point in the history
  • Loading branch information
ObiWahn committed Mar 6, 2018
1 parent de75f79 commit 11eda98
Showing 1 changed file with 44 additions and 0 deletions.
44 changes: 44 additions & 0 deletions pkg/util/k8sutil/events_test.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
package k8sutil

import (
"testing"

"github.com/stretchr/testify/assert"

"k8s.io/api/core/v1"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
)

type fakeAPIObject struct {
metav1.Object //getName dies
ownerRef metav1.OwnerReference
}

func (o fakeAPIObject) AsOwner() metav1.OwnerReference {
return o.ownerRef
}

func TestMemberAddEvent(t *testing.T) {
event := NewMemberAddEvent("member name", "role", fakeAPIObject{})
assert.Equal(t, event.Type, v1.EventTypeNormal)
}

//func TestMemberRemoveEvent(t *testing.T) {
// assert.True(t, false)
//}
//
//func TestPodGoneEvent(t *testing.T) {
// assert.True(t, false)
//}
//
//func TestImmutableFieldEvent(t *testing.T) {
// assert.True(t, false)
//}
//
//func TestErrorEvent(t *testing.T) {
// assert.True(t, false)
//}
//
//func TestDeploymentEvent(t *testing.T) {
// assert.True(t, false)
//}

0 comments on commit 11eda98

Please sign in to comment.