Skip to content

Commit

Permalink
Resolve lint erros
Browse files Browse the repository at this point in the history
  • Loading branch information
bhatipradeep committed Apr 29, 2022
1 parent a64f431 commit 9a2e49d
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 12 deletions.
6 changes: 3 additions & 3 deletions client/foundation/foundation_api_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -25,9 +25,9 @@ func TestNewFoundationAPIClient(t *testing.T) {
if err != nil {
t.Errorf(err.Error())
}
outUrl := fmt.Sprintf("http://%s:%s/", cred.FoundationEndpoint, cred.FoundationPort)
if foundationClient.client.BaseURL.String() != outUrl {
t.Errorf("NewFoundationAPIClient(%v) BaseUrl in base client of foundation client = %v, expected %v", cred, foundationClient.client.BaseURL.String(), outUrl)
outURL := fmt.Sprintf("http://%s:%s/", cred.FoundationEndpoint, cred.FoundationPort)
if foundationClient.client.BaseURL.String() != outURL {
t.Errorf("NewFoundationAPIClient(%v) BaseUrl in base client of foundation client = %v, expected %v", cred, foundationClient.client.BaseURL.String(), outURL)
}

// verify missing client scenario
Expand Down
12 changes: 6 additions & 6 deletions client/foundation/foundation_file_management_service_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -116,13 +116,13 @@ func TestFMOperations_ListHypervisorISOs(t *testing.T) {
func TestFMOperations_UploadImage(t *testing.T) {
mux, c, server := setup()
defer server.Close()
installer_type := "kvm"
installerType := "kvm"
filename := "test_ahv.iso"
source := "foundation_api.go"
mux.HandleFunc("/foundation/upload", func(w http.ResponseWriter, r *http.Request) {
testHTTPMethod(t, r, http.MethodPost)

expectedURL := fmt.Sprintf("/foundation/upload?installer_type=%v&filename=%v", installer_type, filename)
expectedURL := fmt.Sprintf("/foundation/upload?installer_type=%v&filename=%v", installerType, filename)
if expectedURL != r.URL.String() {
t.Errorf("FileManagementOperations.UploadImage() expected URL %v, got %v", expectedURL, r.URL.String())
}
Expand Down Expand Up @@ -154,7 +154,7 @@ func TestFMOperations_UploadImage(t *testing.T) {
}

// checks
got, err := op.UploadImage(ctx, installer_type, filename, source)
got, err := op.UploadImage(ctx, installerType, filename, source)
if err != nil {
t.Fatalf("FileManagementOperations.UploadImage() error = %v", err)
}
Expand All @@ -167,7 +167,7 @@ func TestFMOperations_UploadImage(t *testing.T) {
func TestFMOperations_DeleteImage(t *testing.T) {
mux, c, server := setup()
defer server.Close()
installer_type := "kvm"
installerType := "kvm"
filename := "test_ahv.iso"
mux.HandleFunc("/foundation/delete/", func(w http.ResponseWriter, r *http.Request) {
testHTTPMethod(t, r, http.MethodPost)
Expand All @@ -178,7 +178,7 @@ func TestFMOperations_DeleteImage(t *testing.T) {
}

// check form encoded body
expected := fmt.Sprintf("filename=%v&installer_type=%v", filename, installer_type)
expected := fmt.Sprintf("filename=%v&installer_type=%v", filename, installerType)
if string(body) != expected {
t.Errorf("FileManagementOperations.DeleteImage() request body expected = %v, got = %v", expected, string(body))
}
Expand All @@ -191,7 +191,7 @@ func TestFMOperations_DeleteImage(t *testing.T) {
}

// checks
err := op.DeleteImage(ctx, installer_type, filename)
err := op.DeleteImage(ctx, installerType, filename)
if err != nil {
t.Fatalf("FileManagementOperations.DeleteImage() error = %v", err)
}
Expand Down
6 changes: 3 additions & 3 deletions client/foundation/foundation_node_imaging_service_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -160,7 +160,7 @@ func TestNodeImagingOperations_ImageNodes(t *testing.T) {
func TestNodeImagingOperations_ImageNodesProgress(t *testing.T) {
mux, c, server := setup()
defer server.Close()
sessionId := "123456-1234-123456"
sessionID := "123456-1234-123456"
mux.HandleFunc("/foundation/progress", func(w http.ResponseWriter, r *http.Request) {
testHTTPMethod(t, r, http.MethodGet)

Expand All @@ -183,7 +183,7 @@ func TestNodeImagingOperations_ImageNodesProgress(t *testing.T) {
"time_elapsed": 102.33,
"percent_complete": 100.00
}]
}`, sessionId)
}`, sessionID)
})
ctx := context.TODO()

Expand Down Expand Up @@ -214,7 +214,7 @@ func TestNodeImagingOperations_ImageNodesProgress(t *testing.T) {
}

// checks
got, err := op.ImageNodesProgress(ctx, sessionId)
got, err := op.ImageNodesProgress(ctx, sessionID)
if err != nil {
t.Fatalf("NodeImagingOperations.ImageNodesProgress() error = %v", err)
}
Expand Down

0 comments on commit 9a2e49d

Please sign in to comment.