Skip to content

Commit

Permalink
changes for test case failure
Browse files Browse the repository at this point in the history
Signed-off-by: Sunanda-Boorla <sboorla@progress.com>
  • Loading branch information
Sunanda-Boorla committed Jun 13, 2023
1 parent 62a1a50 commit 93f7acb
Showing 1 changed file with 27 additions and 0 deletions.
27 changes: 27 additions & 0 deletions components/automate-cli/cmd/chef-automate/infrastructure_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,34 @@ var nodeDelCmd = &cobra.Command{
Args: cobra.ExactArgs(1),
}

var infrastructureCmdTest = &cobra.Command{
Use: "infrastructure COMMAND",
Short: "Chef Automate infrastructure",
Long: "Test for infra cmd",
PersistentPreRunE: preInfrastructureCmd,
}


func Test_runpreInfrastructureCmd(t *testing.T) {
tests := []struct {
testName string
cmd *cobra.Command
args []string
}{
{"Test node delete", infrastructureCmdTest, []string{"uuid of node"}},
}
for _, tt := range tests {
t.Run(tt.testName, func(t *testing.T) {
err := preInfrastructureCmd(tt.cmd, tt.args)
if err == nil{
assert.NoError(t, err)
}
assert.Error(t, err)
})
}
}

func Test_runDeleteNodeCmd(t *testing.T) {
tests := []struct {
testName string
cmd *cobra.Command
Expand Down

0 comments on commit 93f7acb

Please sign in to comment.