vendor: update all dependencies
This commit is contained in:
parent
940df88eb2
commit
d64789528d
4309 changed files with 1327278 additions and 1001118 deletions
29
vendor/github.com/stretchr/testify/assert/http_assertions_test.go
generated
vendored
29
vendor/github.com/stretchr/testify/assert/http_assertions_test.go
generated
vendored
|
@ -89,6 +89,35 @@ func httpHelloName(w http.ResponseWriter, r *http.Request) {
|
|||
w.Write([]byte(fmt.Sprintf("Hello, %s!", name)))
|
||||
}
|
||||
|
||||
func TestHTTPRequestWithNoParams(t *testing.T) {
|
||||
var got *http.Request
|
||||
handler := func(w http.ResponseWriter, r *http.Request) {
|
||||
got = r
|
||||
w.WriteHeader(http.StatusOK)
|
||||
}
|
||||
|
||||
True(t, HTTPSuccess(t, handler, "GET", "/url", nil))
|
||||
|
||||
Empty(t, got.URL.Query())
|
||||
Equal(t, "/url", got.URL.RequestURI())
|
||||
}
|
||||
|
||||
func TestHTTPRequestWithParams(t *testing.T) {
|
||||
var got *http.Request
|
||||
handler := func(w http.ResponseWriter, r *http.Request) {
|
||||
got = r
|
||||
w.WriteHeader(http.StatusOK)
|
||||
}
|
||||
params := url.Values{}
|
||||
params.Add("id", "12345")
|
||||
|
||||
True(t, HTTPSuccess(t, handler, "GET", "/url", params))
|
||||
|
||||
Equal(t, url.Values{"id": []string{"12345"}}, got.URL.Query())
|
||||
Equal(t, "/url?id=12345", got.URL.String())
|
||||
Equal(t, "/url?id=12345", got.URL.RequestURI())
|
||||
}
|
||||
|
||||
func TestHttpBody(t *testing.T) {
|
||||
assert := New(t)
|
||||
mockT := new(testing.T)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue