Skip to content

Commit

Permalink
fix TestClient_APIResponseBadGateway test
Browse files Browse the repository at this point in the history
  • Loading branch information
0xch4z committed Apr 27, 2020
1 parent 27b27bd commit ee626c3
Showing 1 changed file with 3 additions and 11 deletions.
14 changes: 3 additions & 11 deletions test/integration/client_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,7 @@ package integration

import (
"context"
"strings"
"testing"

. "github.com/linode/linodego"
)

func TestClientAliases(t *testing.T) {
Expand Down Expand Up @@ -47,13 +44,8 @@ func TestClient_APIResponseBadGateway(t *testing.T) {
t.Errorf("Error should be thrown on 502 Response from API")
}

responseError, ok := err.(*Error)

if !ok {
t.Errorf("Error type did not match the expected result")
}

if !strings.Contains(responseError.Message, "Unexpected Content-Type") {
t.Errorf("Error message does not contain: \"Unexpected Content-Type\"")
expectedErr := "[502] Bad Gateway"
if err.Error() != expectedErr {
t.Errorf(`expected error to be "%s" but got "%s"`, expectedErr, err)
}
}

0 comments on commit ee626c3

Please sign in to comment.