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

Function TestWatchCallMultipleInvocation

testing/fixture_test.go:131–230  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

129}
130
131func TestWatchCallMultipleInvocation(t *testing.T) {
132 cases := []struct {
133 name string
134 op watch.EventType
135 ns string
136 }{
137 {
138 "foo",
139 watch.Added,
140 "test_namespace",
141 },
142 {
143 "bar",
144 watch.Added,
145 "test_namespace",
146 },
147 {
148 "baz",
149 watch.Added,
150 "",
151 },
152 {
153 "bar",
154 watch.Modified,
155 "test_namespace",
156 },
157 {
158 "baz",
159 watch.Modified,
160 "",
161 },
162 {
163 "foo",
164 watch.Deleted,
165 "test_namespace",
166 },
167 {
168 "bar",
169 watch.Deleted,
170 "test_namespace",
171 },
172 {
173 "baz",
174 watch.Deleted,
175 "",
176 },
177 }
178
179 scheme := runtime.NewScheme()
180 codecs := serializer.NewCodecFactory(scheme)
181 testResource := schema.GroupVersionResource{Group: "", Version: "test_version", Resource: "test_kind"}
182
183 o := NewObjectTracker(scheme, codecs.UniversalDecoder())
184 watchNamespaces := []string{
185 "",
186 "",
187 "test_namespace",
188 "test_namespace",

Callers

nothing calls this directly

Calls 11

WatchMethod · 0.95
CreateMethod · 0.95
UpdateMethod · 0.95
DeleteMethod · 0.95
NewObjectTrackerFunction · 0.85
getArbitraryResourceFunction · 0.85
AddMethod · 0.65
GetNameMethod · 0.65
GetNamespaceMethod · 0.65
DoneMethod · 0.65
ResultChanMethod · 0.45

Tested by

no test coverage detected