mirror of
https://github.com/helmfile/helmfile.git
synced 2026-10-09 08:17:16 +02:00
Fix typos and ask unittest (#1235)
Signed-off-by: yxxhero <aiopsclub@163.com>
This commit is contained in:
@@ -276,3 +276,42 @@ func TestAppendShowOnlyFlags(t *testing.T) {
|
||||
})
|
||||
}
|
||||
}
|
||||
|
||||
func TestAppendDryRunFlags(t *testing.T) {
|
||||
type args struct {
|
||||
flags []string
|
||||
dry-run string
|
||||
helm helmexec.Interface
|
||||
expected []string
|
||||
}
|
||||
tests := []struct {
|
||||
name string
|
||||
args args
|
||||
}{
|
||||
{
|
||||
name: "do dry-run on client",
|
||||
args: args{
|
||||
flags: []string{},
|
||||
dry-run: "client",
|
||||
helm: testutil.NewVersionHelmExec("3.12.1"),
|
||||
expected: []string{"--dry-run", "client"},
|
||||
},
|
||||
},
|
||||
{
|
||||
name: "do dry-run on server",
|
||||
args: args{
|
||||
flags: []string{},
|
||||
dry-run: "server",
|
||||
helm: testutil.NewVersionHelmExec("3.12.1"),
|
||||
expected: []string{"--dry-run", "server"},
|
||||
},
|
||||
},
|
||||
}
|
||||
for _, tt := range tests {
|
||||
t.Run(tt.name, func(t *testing.T) {
|
||||
st := &HelmState{}
|
||||
got := st.appendDryRunFlags(tt.args.flags, tt.args.helm, tt.args.release, tt.args.dry-run)
|
||||
require.Equalf(t, tt.args.expected, got, "appendDryRunFlags() = %v, want %v", got, tt.args.expected)
|
||||
})
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user