MCPcopy
hub / github.com/kubernetes/client-go / TestNewRetryWatcher

Function TestNewRetryWatcher

tools/watch/retrywatcher_test.go:143–168  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

141var _ runtime.Object = &unexpectedError{}
142
143func TestNewRetryWatcher(t *testing.T) {
144 tt := []struct {
145 name string
146 initialRV string
147 err error
148 }{
149 {
150 name: "empty RV should fail",
151 initialRV: "",
152 err: errors.New("initial RV \"\" is not supported due to issues with underlying WATCH"),
153 },
154 {
155 name: "RV \"0\" should fail",
156 initialRV: "0",
157 err: errors.New("initial RV \"0\" is not supported due to issues with underlying WATCH"),
158 },
159 }
160 for _, tc := range tt {
161 t.Run(tc.name, func(t *testing.T) {
162 _, err := NewRetryWatcher(tc.initialRV, nil)
163 if !reflect.DeepEqual(err, tc.err) {
164 t.Errorf("Expected error: %v, got: %v", tc.err, err)
165 }
166 })
167 }
168}
169
170func TestRetryWatcher(t *testing.T) {
171 tt := []struct {

Callers

nothing calls this directly

Calls 3

NewRetryWatcherFunction · 0.85
RunMethod · 0.65
ErrorfMethod · 0.65

Tested by

no test coverage detected