MCPcopy Index your code
hub / github.com/aws/aws-node-termination-handler / TestGetEventIDSuccess

Function TestGetEventIDSuccess

pkg/node/node_test.go:249–266  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

247}
248
249func TestGetEventIDSuccess(t *testing.T) {
250 var labelValue = "bla"
251
252 client := fake.NewSimpleClientset()
253 _, err := client.CoreV1().Nodes().Create(context.Background(),
254 &v1.Node{
255 ObjectMeta: metav1.ObjectMeta{
256 Name: nodeName,
257 Labels: map[string]string{"aws-node-termination-handler/event-id": labelValue},
258 },
259 },
260 metav1.CreateOptions{})
261 h.Ok(t, err)
262 tNode := getNode(t, getDrainHelper(client))
263 value, err := tNode.GetEventID(nodeName)
264 h.Ok(t, err)
265 h.Equals(t, labelValue, value)
266}
267
268func TestGetEventIDNoNodeFailure(t *testing.T) {
269 tNode := getNode(t, getDrainHelper(fake.NewSimpleClientset()))

Callers

nothing calls this directly

Calls 3

GetEventIDMethod · 0.80
getNodeFunction · 0.70
getDrainHelperFunction · 0.70

Tested by

no test coverage detected