Browse Source

test resty commented

pull/6/head
yedongfu 5 years ago
parent
commit
a3551fdfb4
  1. 16
      common/utils_test.go

16
common/utils_test.go

@ -79,11 +79,11 @@ func TestGin(t *testing.T) {
assert.Equal(t, "{\"code\":500,\"message\":\"err1\"}", getResultString("/api/error", strings.NewReader("{}"))) assert.Equal(t, "{\"code\":500,\"message\":\"err1\"}", getResultString("/api/error", strings.NewReader("{}")))
} }
func TestResty(t *testing.T) { // func TestResty(t *testing.T) {
resp, err := RestyClient.R().Get("http://taobao.com") // resp, err := RestyClient.R().Get("http://taobao.com")
assert.Equal(t, nil, err) // assert.Equal(t, nil, err)
err2 := CatchP(func() { // err2 := CatchP(func() {
CheckRestySuccess(resp, err) // CheckRestySuccess(resp, err)
}) // })
assert.NotEqual(t, nil, err2) // assert.NotEqual(t, nil, err2)
} // }

Loading…
Cancel
Save