(t *testing.T)
| 63 | } |
| 64 | |
| 65 | func TestUpdateContainerLabels(t *testing.T) { |
| 66 | flags := newUpdateCommand(nil).Flags() |
| 67 | flags.Set("container-label-add", "add-beats-remove=value") |
| 68 | flags.Set("container-label-add", "to-add=value") |
| 69 | flags.Set("container-label-add", "to-update=new-value") |
| 70 | flags.Set("container-label-add", "to-replace=new-value") |
| 71 | flags.Set("container-label-rm", "add-beats-remove") |
| 72 | flags.Set("container-label-rm", "to-remove") |
| 73 | flags.Set("container-label-rm", "to-replace") |
| 74 | flags.Set("container-label-rm", "no-such-label") |
| 75 | |
| 76 | labels := map[string]string{ |
| 77 | "to-keep": "value", |
| 78 | "to-remove": "value", |
| 79 | "to-replace": "value", |
| 80 | "to-update": "value", |
| 81 | } |
| 82 | |
| 83 | updateContainerLabels(flags, &labels) |
| 84 | assert.DeepEqual(t, labels, map[string]string{ |
| 85 | "add-beats-remove": "value", |
| 86 | "to-add": "value", |
| 87 | "to-keep": "value", |
| 88 | "to-replace": "new-value", |
| 89 | "to-update": "new-value", |
| 90 | }) |
| 91 | } |
| 92 | |
| 93 | func TestUpdatePlacementConstraints(t *testing.T) { |
| 94 | flags := newUpdateCommand(nil).Flags() |
nothing calls this directly
no test coverage detected
searching dependent graphs…