(t *testing.T)
| 261 | } |
| 262 | |
| 263 | func 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 | } |
nothing calls this directly
no test coverage detected