MCPcopy Create free account
hub / github.com/docker/cli / TestUpdateNodeFilter

Function TestUpdateNodeFilter

cli/command/service/ps_test.go:115–134  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

113}
114
115func TestUpdateNodeFilter(t *testing.T) {
116 selfNodeID := "foofoo"
117 filter := make(client.Filters).Add("node", "one", "two", "self")
118
119 apiClient := &fakeClient{
120 infoFunc: func(_ context.Context) (client.SystemInfoResult, error) {
121 return client.SystemInfoResult{
122 Info: system.Info{
123 Swarm: swarm.Info{NodeID: selfNodeID},
124 },
125 }, nil
126 },
127 }
128
129 err := updateNodeFilter(context.Background(), apiClient, filter)
130 assert.NilError(t, err)
131
132 expected := make(client.Filters).Add("node", "one", "two", selfNodeID)
133 assert.DeepEqual(t, expected, filter)
134}

Callers

nothing calls this directly

Calls 1

updateNodeFilterFunction · 0.85

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…