Skip to content

Commit

Permalink
Rename ioErrResp
Browse files Browse the repository at this point in the history
  • Loading branch information
winebarrel committed Jun 10, 2024
1 parent 33b11f2 commit 208a583
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 9 deletions.
4 changes: 2 additions & 2 deletions admin_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ func Test_GetAdminQueriesOutdated_IOErr(t *testing.T) {
defer httpmock.DeactivateAndReset()

httpmock.RegisterResponder(http.MethodGet, "https://redash.example.com/api/admin/queries/outdated", func(req *http.Request) (*http.Response, error) {
return ioErrResp, nil
return testIOErrResp, nil
})

client, _ := redash.NewClient("https://redash.example.com", testRedashAPIKey)
Expand Down Expand Up @@ -261,7 +261,7 @@ func Test_GetAdminQueriesRqStatus_IOErr(t *testing.T) {
defer httpmock.DeactivateAndReset()

httpmock.RegisterResponder(http.MethodGet, "https://redash.example.com/api/admin/queries/rq_status", func(req *http.Request) (*http.Response, error) {
return ioErrResp, nil
return testIOErrResp, nil
})

client, _ := redash.NewClient("https://redash.example.com", testRedashAPIKey)
Expand Down
8 changes: 4 additions & 4 deletions alert_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,7 @@ func Test_ListAlerts_IOErr(t *testing.T) {
defer httpmock.DeactivateAndReset()

httpmock.RegisterResponder(http.MethodGet, "https://redash.example.com/api/alerts", func(req *http.Request) (*http.Response, error) {
return ioErrResp, nil
return testIOErrResp, nil
})

client, _ := redash.NewClient("https://redash.example.com", testRedashAPIKey)
Expand Down Expand Up @@ -189,7 +189,7 @@ func Test_GetAlert_IOErr(t *testing.T) {
defer httpmock.DeactivateAndReset()

httpmock.RegisterResponder(http.MethodGet, "https://redash.example.com/api/alerts/1", func(req *http.Request) (*http.Response, error) {
return ioErrResp, nil
return testIOErrResp, nil
})

client, _ := redash.NewClient("https://redash.example.com", testRedashAPIKey)
Expand Down Expand Up @@ -305,7 +305,7 @@ func Test_CreateAlert_IOErr(t *testing.T) {
defer httpmock.DeactivateAndReset()

httpmock.RegisterResponder(http.MethodPost, "https://redash.example.com/api/alerts", func(req *http.Request) (*http.Response, error) {
return ioErrResp, nil
return testIOErrResp, nil
})

client, _ := redash.NewClient("https://redash.example.com", testRedashAPIKey)
Expand Down Expand Up @@ -432,7 +432,7 @@ func Test_UpdateAlert_IOErr(t *testing.T) {
defer httpmock.DeactivateAndReset()

httpmock.RegisterResponder(http.MethodPost, "https://redash.example.com/api/alerts/1", func(req *http.Request) (*http.Response, error) {
return ioErrResp, nil
return testIOErrResp, nil
})

client, _ := redash.NewClient("https://redash.example.com", testRedashAPIKey)
Expand Down
2 changes: 1 addition & 1 deletion ping_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ func Test_Ping_IOErr(t *testing.T) {
defer httpmock.DeactivateAndReset()

httpmock.RegisterResponder(http.MethodGet, "https://redash.example.com/ping", func(req *http.Request) (*http.Response, error) {
return ioErrResp, nil
return testIOErrResp, nil
})

client, _ := redash.NewClient("https://redash.example.com", testRedashAPIKey)
Expand Down
4 changes: 2 additions & 2 deletions redash_go_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,8 @@ import (
)

var (
testAcc = false
ioErrResp = &http.Response{
testAcc = false
testIOErrResp = &http.Response{
Status: strconv.Itoa(http.StatusOK),
StatusCode: http.StatusOK,
Body: io.NopCloser(iotest.ErrReader(errors.New("IO error"))),
Expand Down

0 comments on commit 208a583

Please sign in to comment.