diff options
author | Grzegorz Bizon <grzesiek.bizon@gmail.com> | 2019-12-05 18:58:55 +0300 |
---|---|---|
committer | Grzegorz Bizon <grzesiek.bizon@gmail.com> | 2019-12-05 18:58:55 +0300 |
commit | af3eeb3bf82c49bfe3b0371b5fb8aaf1ad9ff1b2 (patch) | |
tree | 69ea60b060697da2e68c286ffec31f05e6abc66b /internal/source/gitlab/client/client_test.go | |
parent | bc54e819aa4285084698d5713170266699d4d4ed (diff) |
Simplify gitlab source client by not recording http status
Diffstat (limited to 'internal/source/gitlab/client/client_test.go')
-rw-r--r-- | internal/source/gitlab/client/client_test.go | 10 |
1 files changed, 4 insertions, 6 deletions
diff --git a/internal/source/gitlab/client/client_test.go b/internal/source/gitlab/client/client_test.go index 9b7632bd..5f6be9ca 100644 --- a/internal/source/gitlab/client/client_test.go +++ b/internal/source/gitlab/client/client_test.go @@ -10,8 +10,6 @@ import ( jwt "github.com/dgrijalva/jwt-go" "github.com/stretchr/testify/require" - - "gitlab.com/gitlab-org/gitlab-pages/internal/source/gitlab/api" ) var ( @@ -48,8 +46,8 @@ func TestNewInvalidBaseURL(t *testing.T) { func TestLookupForErrorResponses(t *testing.T) { tests := map[int]string{ - http.StatusUnauthorized: "Unauthorized", - http.StatusNotFound: "Not Found", + http.StatusUnauthorized: "HTTP status: 401", + http.StatusNotFound: "HTTP status: 404", } for statusCode, expectedError := range tests { @@ -70,7 +68,7 @@ func TestLookupForErrorResponses(t *testing.T) { lookup := client.GetLookup(context.Background(), "group.gitlab.io") require.EqualError(t, lookup.Error, expectedError) - require.Equal(t, lookup.Domain, api.VirtualDomain{}) + require.Nil(t, lookup.Domain) }) } } @@ -91,7 +89,7 @@ func TestMissingDomain(t *testing.T) { lookup := client.GetLookup(context.Background(), "group.gitlab.io") require.NoError(t, lookup.Error) - require.Equal(t, lookup.Domain, api.VirtualDomain{}) + require.Nil(t, lookup.Domain) } func TestGetVirtualDomainAuthenticatedRequest(t *testing.T) { |