(t *testing.T)
| 113 | } |
| 114 | |
| 115 | func 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 | } |
nothing calls this directly
no test coverage detected
searching dependent graphs…