Skip to content

Commit

Permalink
adjust unit tests
Browse files Browse the repository at this point in the history
  • Loading branch information
edmarSoaress committed Mar 11, 2024
1 parent accc274 commit 17bf9e2
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 6 deletions.
1 change: 0 additions & 1 deletion .testcoverage.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,5 +8,4 @@ exclude:
paths:
- ^pkg/internal
- ^pkg/config
- ^pkg/cardtoken/mock.go
- ^pkg/internal/requester/mock.go
2 changes: 1 addition & 1 deletion pkg/internal/requester/mock.go
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ func NewInvalidRequestMock() *http.Request {
return req
}

func NewRequestMockWithCancelledContext() *http.Request {
func NewRequestMockWithCanceledContext() *http.Request {
ctx, cancel := context.WithTimeout(context.Background(), time.Second*1)
defer cancel()

Expand Down
8 changes: 4 additions & 4 deletions pkg/internal/requester/requester_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -27,23 +27,23 @@ func TestDo(t *testing.T) {
wantErr string
}{
{
name: "should_return_reponse_ok_when_status_code_is_200",
name: "should_return_response_ok_when_status_code_is_200",
args: args{
req: reqOK,
},
wantStatus: "200 OK",
},
{
name: "should_retry_and_return_reponse_erro_when_status_code_is_503",
name: "should_retry_and_return_response_error_when_status_code_is_503",
args: args{
req: req,
},
wantStatus: "503 Service Unavailable",
},
{
name: "should_return_error_when_context_is_cancelled",
name: "should_return_error_when_context_is_canceled",
args: args{
req: NewRequestMockWithCancelledContext(),
req: NewRequestMockWithCanceledContext(),
},
wantErr: "context canceled",
},
Expand Down

0 comments on commit 17bf9e2

Please sign in to comment.