(t *testing.T)
| 33 | ) |
| 34 | |
| 35 | func Test_TrackBundleCommand(t *testing.T) { |
| 36 | cases := []struct { |
| 37 | name string |
| 38 | args []string |
| 39 | expectOutput string |
| 40 | expectUrls []string |
| 41 | expectPrune bool |
| 42 | expectInput string |
| 43 | expectStdout bool |
| 44 | expectImageOutput bool |
| 45 | expectFreshen bool |
| 46 | expectInEffectDays int |
| 47 | }{ |
| 48 | { |
| 49 | name: "simple", |
| 50 | args: []string{ |
| 51 | "--bundle", |
| 52 | "registry/image:tag", |
| 53 | }, |
| 54 | expectPrune: true, |
| 55 | expectUrls: []string{"registry/image:tag"}, |
| 56 | expectStdout: true, |
| 57 | }, |
| 58 | { |
| 59 | name: "with output file", |
| 60 | args: []string{ |
| 61 | "--bundle", |
| 62 | "registry/image:tag", |
| 63 | "--output", |
| 64 | "output-1.json", |
| 65 | }, |
| 66 | expectOutput: "output-1.json", |
| 67 | expectUrls: []string{"registry/image:tag"}, |
| 68 | expectPrune: true, |
| 69 | expectStdout: false, |
| 70 | }, |
| 71 | { |
| 72 | name: "with input file", |
| 73 | args: []string{ |
| 74 | "--bundle", |
| 75 | "registry/image:tag", |
| 76 | "--input", |
| 77 | "input-3.json", |
| 78 | }, |
| 79 | expectUrls: []string{"registry/image:tag"}, |
| 80 | expectPrune: true, |
| 81 | expectInput: "input-3.json", |
| 82 | expectStdout: true, |
| 83 | }, |
| 84 | { |
| 85 | name: "with input file replace", |
| 86 | args: []string{ |
| 87 | "--bundle", |
| 88 | "registry/image:tag", |
| 89 | "--input", |
| 90 | "tracker-3.json", |
| 91 | "--replace", |
| 92 | }, |
nothing calls this directly
no test coverage detected