diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/kube2msb/kube2msb_test.go | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/src/kube2msb/kube2msb_test.go b/src/kube2msb/kube2msb_test.go index 09f7a80..eea0f92 100644 --- a/src/kube2msb/kube2msb_test.go +++ b/src/kube2msb/kube2msb_test.go @@ -89,3 +89,24 @@ func TestSendServiceWork(t *testing.T) { } } } + +func TestSendPodWork(t *testing.T) { + + kubeWorkQueue := make(chan KubeWork, 1) + podObj := kapi.Pod{} + + cases := []KubeWorkAction{ + KubeWorkAddPod, + KubeWorkRemovePod, + KubeWorkUpdatePod, + } + + for _, c := range cases { + sendPodWork(c, kubeWorkQueue, &podObj) + got := <-kubeWorkQueue + + if got.Action != c { + t.Errorf("sendPodWork(%action, queue, service) got %gotAction", c, got.Action) + } + } +} |