Skip to content

Commit

Permalink
Test HasBody
Browse files Browse the repository at this point in the history
Signed-off-by: Kazuyoshi Kato <[email protected]>
  • Loading branch information
kzys committed Oct 25, 2021
1 parent 7729882 commit 69c0f14
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions request_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -153,6 +153,14 @@ func TestJSONRequest(t *testing.T) {
assert.Nil(t, req)
}

func TestHasBody(t *testing.T) {
req, _ := http.NewRequest("GET", "", nil)
assert.False(t, HasBody(req))

req.ContentLength = 123
assert.True(t, HasBody(req))
}

func TestMethod(t *testing.T) {
testcase := []struct {
method string
Expand Down

0 comments on commit 69c0f14

Please sign in to comment.