From e2b5b9fdfc7852fe6d9a41dfb66a5c48da52c8e5 Mon Sep 17 00:00:00 2001 From: Sunanda-Boorla Date: Tue, 13 Jun 2023 12:18:14 +0530 Subject: [PATCH] Formatting Signed-off-by: Sunanda-Boorla --- .../cmd/chef-automate/infrastructure_test.go | 37 +++++++++---------- 1 file changed, 18 insertions(+), 19 deletions(-) diff --git a/components/automate-cli/cmd/chef-automate/infrastructure_test.go b/components/automate-cli/cmd/chef-automate/infrastructure_test.go index 00e3ffc414a..e570e3b7116 100644 --- a/components/automate-cli/cmd/chef-automate/infrastructure_test.go +++ b/components/automate-cli/cmd/chef-automate/infrastructure_test.go @@ -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) { @@ -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)