mirror of
https://github.com/zeromicro/go-zero.git
synced 2026-05-14 02:10:00 +08:00
feat: add http to http method test case (#4820)
This commit is contained in:
@@ -201,6 +201,13 @@ func TestHttpToHttp(t *testing.T) {
|
|||||||
assert.NoError(t, err)
|
assert.NoError(t, err)
|
||||||
assert.Equal(t, http.StatusNotFound, resp.StatusCode)
|
assert.Equal(t, http.StatusNotFound, resp.StatusCode)
|
||||||
})
|
})
|
||||||
|
|
||||||
|
t.Run("method not allowed", func(t *testing.T) {
|
||||||
|
resp, err := httpc.Do(context.Background(), http.MethodPost,
|
||||||
|
"http://localhost:18882/api/ping", nil)
|
||||||
|
assert.NoError(t, err)
|
||||||
|
assert.Equal(t, http.StatusMethodNotAllowed, resp.StatusCode)
|
||||||
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
func TestHttpToHttpBadUpstream(t *testing.T) {
|
func TestHttpToHttpBadUpstream(t *testing.T) {
|
||||||
|
|||||||
Reference in New Issue
Block a user