Skip to content

Commit

Permalink
Fix panics with testify's assert.Eventually
Browse files Browse the repository at this point in the history
stretchr/testify#808 is merged into master,
but not yet released as of moment of writing. Updating to latest master version.
  • Loading branch information
tadaskay committed Jan 31, 2020
1 parent 9003877 commit 7c074e5
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 7 deletions.
4 changes: 2 additions & 2 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ require (
github.com/status-im/keycard-go v0.0.0-20191114114615-9d48af884d5b // indirect
github.com/steakknife/bloomfilter v0.0.0-20180922174646-6819c0d2a570 // indirect
github.com/steakknife/hamming v0.0.0-20180906055917-c99c65617cd3 // indirect
github.com/stretchr/testify v1.4.0
github.com/stretchr/testify v1.4.1-0.20200130210847-518a1491c713
github.com/urfave/cli/v2 v2.1.1
github.com/vmihailenco/msgpack v4.0.4+incompatible // indirect
github.com/xi2/xz v0.0.0-20171230120015-48954b6210f8 // indirect
Expand All @@ -73,5 +73,5 @@ require (
google.golang.org/appengine v1.6.5 // indirect
gopkg.in/src-d/go-git.v4 v4.13.1 // indirect
gopkg.in/urfave/cli.v1 v1.20.0 // indirect
gopkg.in/yaml.v2 v2.2.7 // indirect
gopkg.in/yaml.v2 v2.2.8 // indirect
)
5 changes: 5 additions & 0 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -569,11 +569,14 @@ github.com/steakknife/hamming v0.0.0-20180906055917-c99c65617cd3 h1:njlZPzLwU639
github.com/steakknife/hamming v0.0.0-20180906055917-c99c65617cd3/go.mod h1:hpGUWaI9xL8pRQCTXQgocU38Qw1g0Us7n5PxxTwTCYU=
github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME=
github.com/stretchr/objx v0.1.1/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME=
github.com/stretchr/objx v0.2.0 h1:Hbg2NidpLE8veEBkEZTL3CvlkUIVzuU9jDplZO54c48=
github.com/stretchr/objx v0.2.0/go.mod h1:qt09Ya8vawLte6SNmTgCsAVtYtaKzEcn8ATUoHMkEqE=
github.com/stretchr/testify v1.2.2/go.mod h1:a8OnRcib4nhh0OaRAV+Yts87kKdq0PP7pXfy6kDkUVs=
github.com/stretchr/testify v1.3.0/go.mod h1:M5WIy9Dh21IEIfnGCwXGc5bZfKNJtfHm1UVUgZn+9EI=
github.com/stretchr/testify v1.4.0 h1:2E4SXV/wtOkTonXsotYi4li6zVWxYlZuYNCXe9XRJyk=
github.com/stretchr/testify v1.4.0/go.mod h1:j7eGeouHqKxXV5pUuKE4zz7dFj8WfuZ+81PSLYec5m4=
github.com/stretchr/testify v1.4.1-0.20200130210847-518a1491c713 h1:6Ug34M4M9ccOd4tmc1tqLP6pHVbQNYi6HdE00T7wYjw=
github.com/stretchr/testify v1.4.1-0.20200130210847-518a1491c713/go.mod h1:5W2xD1RspED5o8YsWQXVCued0rvSQ+mT+I5cxcmMvtA=
github.com/syndtr/goleveldb v1.0.0/go.mod h1:ZVVdQEZoIme9iO1Ch2Jdy24qqXrMMOU6lpPAyBWyWuQ=
github.com/syndtr/goleveldb v1.0.1-0.20190923125748-758128399b1d h1:gZZadD8H+fF+n9CmNhYL1Y0dJB+kLOmKd7FbPJLeGHs=
github.com/syndtr/goleveldb v1.0.1-0.20190923125748-758128399b1d/go.mod h1:9OrXJhf154huy1nPWmuSrkgjPUtUNhA+Zmy+6AESzuA=
Expand Down Expand Up @@ -837,6 +840,8 @@ gopkg.in/yaml.v2 v2.2.2 h1:ZCJp+EgiOT7lHqUV2J862kp8Qj64Jo6az82+3Td9dZw=
gopkg.in/yaml.v2 v2.2.2/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI=
gopkg.in/yaml.v2 v2.2.7 h1:VUgggvou5XRW9mHwD/yXxIYSMtY0zoKQf/v226p2nyo=
gopkg.in/yaml.v2 v2.2.7/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI=
gopkg.in/yaml.v2 v2.2.8 h1:obN1ZagJSUGI0Ek/LBmuj4SNLPfIny3KsKFopxRdj10=
gopkg.in/yaml.v2 v2.2.8/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI=
honnef.co/go/tools v0.0.0-20190102054323-c2f93a96b099/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4=
honnef.co/go/tools v0.0.0-20190106161140-3f1c8253044a/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4=
honnef.co/go/tools v0.0.0-20190418001031-e561f6794a2a/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4=
Expand Down
9 changes: 4 additions & 5 deletions tequilapi/api_test_utils.go
Original file line number Diff line number Diff line change
Expand Up @@ -21,18 +21,17 @@ import (
"encoding/json"
"fmt"
"net/http"
"testing"

"github.com/stretchr/testify/assert"
)

type testClient struct {
t *testing.T
t assert.TestingT
baseURL string
}

// NewTestClient returns client for making test requests
func NewTestClient(t *testing.T, address string) *testClient {
func NewTestClient(t assert.TestingT, address string) *testClient {
return &testClient{
t,
fmt.Sprintf("http://%s", address),
Expand All @@ -47,12 +46,12 @@ func (tc *testClient) Get(path string) *http.Response {
return resp
}

func expectJSONStatus200(t *testing.T, resp *http.Response, httpStatus int) {
func expectJSONStatus200(t assert.TestingT, resp *http.Response, httpStatus int) {
assert.Equal(t, "application/json; charset=utf-8", resp.Header.Get("Content-type"))
assert.Equal(t, httpStatus, resp.StatusCode)
}

func parseResponseAsJSON(t *testing.T, resp *http.Response, v interface{}) {
func parseResponseAsJSON(t assert.TestingT, resp *http.Response, v interface{}) {
err := json.NewDecoder(resp.Body).Decode(v)
assert.Nil(t, err)
}

0 comments on commit 7c074e5

Please sign in to comment.