Skip to content

Commit

Permalink
Formatting
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 93f7acb commit e2b5b9f
Showing 1 changed file with 18 additions and 19 deletions.
37 changes: 18 additions & 19 deletions components/automate-cli/cmd/chef-automate/infrastructure_test.go
Expand Up @@ -21,30 +21,29 @@ var nodeDelCmd = &cobra.Command{
}

var infrastructureCmdTest = &cobra.Command{
Use: "infrastructure COMMAND",
Short: "Chef Automate infrastructure",
Long: "Test for infra cmd",
PersistentPreRunE: preInfrastructureCmd,
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{
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) {
Expand All @@ -58,7 +57,7 @@ func Test_runDeleteNodeCmd(t *testing.T) {
for _, tt := range tests {
t.Run(tt.testName, func(t *testing.T) {
err := runDeleteNodeCmd(tt.cmd, tt.args)
if err == nil{
if err == nil {
assert.NoError(t, err)
}
assert.Error(t, err)
Expand Down

0 comments on commit e2b5b9f

Please sign in to comment.