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

Function TestPatchWithMissingObject

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

Source from the content-addressed store, hash-verified

261}
262
263func TestPatchWithMissingObject(t *testing.T) {
264 nodesResource := schema.GroupVersionResource{Group: "", Version: "v1", Resource: "nodes"}
265
266 scheme := runtime.NewScheme()
267 codecs := serializer.NewCodecFactory(scheme)
268 o := NewObjectTracker(scheme, codecs.UniversalDecoder())
269 reaction := ObjectReaction(o)
270 action := NewRootPatchSubresourceAction(nodesResource, "node-1", types.StrategicMergePatchType, []byte(`{}`))
271 handled, node, err := reaction(action)
272 assert.True(t, handled)
273 assert.Nil(t, node)
274 assert.EqualError(t, err, `nodes "node-1" not found`)
275}

Callers

nothing calls this directly

Calls 3

NewObjectTrackerFunction · 0.85
ObjectReactionFunction · 0.85

Tested by

no test coverage detected