use Watch for single object instead of WatchList

This commit is contained in:
Masahiro Sano
2015-04-18 01:23:58 +09:00
parent 23e806604d
commit f90dc8f413
6 changed files with 63 additions and 26 deletions

View File

@@ -101,7 +101,11 @@ func TestWatch(t *testing.T) {
expectedVersion := resp.Node.ModifiedIndex
// watch should load the object at the current index
w := helper.Watch(key, 0)
w, err := helper.Watch(key, 0, tools.Everything)
if err != nil {
t.Fatalf("Unexpected error: %v", err)
}
event := <-w.ResultChan()
if event.Type != watch.Added || event.Object == nil {
t.Fatalf("expected first value to be set to ADDED, got %#v", event)