Change test cases to verify the client sends the received resourceVersion

This commit is contained in:
Clayton Coleman 2014-10-07 18:31:34 -04:00
parent 82bcdd3b3b
commit a5462c0678
2 changed files with 7 additions and 7 deletions

View File

@ -92,8 +92,8 @@ func TestReflector_watchHandler(t *testing.T) {
}
}
// RV should stay 1 higher than the last id we see.
if e, a := "33", resumeRV; e != a {
// RV should send the last version we see.
if e, a := "32", resumeRV; e != a {
t.Errorf("expected %v, got %v", e, a)
}
}
@ -102,9 +102,9 @@ func TestReflector_listAndWatch(t *testing.T) {
createdFakes := make(chan *watch.FakeWatcher)
// The ListFunc says that it's at revision 1. Therefore, we expect our WatchFunc
// to get called at the beginning of the watch with 1, and again with 4 when we
// inject an error at 3.
expectedRVs := []string{"1", "4"}
// to get called at the beginning of the watch with 1, and again with 3 when we
// inject an error.
expectedRVs := []string{"1", "3"}
lw := &testLW{
WatchFunc: func(rv string) (watch.Interface, error) {
fw := watch.NewFake()

View File

@ -66,7 +66,7 @@ func TestServices(t *testing.T) {
fakeWatch.Stop()
newFakeWatch.Add(&service)
if !reflect.DeepEqual(fakeClient.Actions, []client.FakeAction{{"watch-services", "1"}, {"watch-services", "3"}}) {
if !reflect.DeepEqual(fakeClient.Actions, []client.FakeAction{{"watch-services", "1"}, {"watch-services", "2"}}) {
t.Errorf("expected call to watch-endpoints, got %#v", fakeClient)
}
}
@ -191,7 +191,7 @@ func TestEndpoints(t *testing.T) {
fakeWatch.Stop()
newFakeWatch.Add(&endpoint)
if !reflect.DeepEqual(fakeClient.Actions, []client.FakeAction{{"watch-endpoints", "1"}, {"watch-endpoints", "3"}}) {
if !reflect.DeepEqual(fakeClient.Actions, []client.FakeAction{{"watch-endpoints", "1"}, {"watch-endpoints", "2"}}) {
t.Errorf("expected call to watch-endpoints, got %#v", fakeClient)
}
}