update func name according to standard
This commit is contained in:
parent
2dc923eb46
commit
94029f3339
@ -351,7 +351,7 @@ func TestNewBeegoRequest(t *testing.T) {
|
|||||||
assert.NotNil(t, req)
|
assert.NotNil(t, req)
|
||||||
}
|
}
|
||||||
|
|
||||||
func TestBeegoHTTPRequest_SetProtocolVersion(t *testing.T) {
|
func TestBeegoHTTPRequestSetProtocolVersion(t *testing.T) {
|
||||||
req := NewBeegoRequest("http://beego.me", "GET")
|
req := NewBeegoRequest("http://beego.me", "GET")
|
||||||
req.SetProtocolVersion("HTTP/3.10")
|
req.SetProtocolVersion("HTTP/3.10")
|
||||||
assert.Equal(t, "HTTP/3.10", req.req.Proto)
|
assert.Equal(t, "HTTP/3.10", req.req.Proto)
|
||||||
@ -376,21 +376,21 @@ func TestPut(t *testing.T) {
|
|||||||
assert.Equal(t, "PUT", req.req.Method)
|
assert.Equal(t, "PUT", req.req.Method)
|
||||||
}
|
}
|
||||||
|
|
||||||
func TestBeegoHTTPRequest_Header(t *testing.T) {
|
func TestBeegoHTTPRequestHeader(t *testing.T) {
|
||||||
req := Post("http://beego.me")
|
req := Post("http://beego.me")
|
||||||
key, value := "test-header", "test-header-value"
|
key, value := "test-header", "test-header-value"
|
||||||
req.Header(key, value)
|
req.Header(key, value)
|
||||||
assert.Equal(t, value, req.req.Header.Get(key))
|
assert.Equal(t, value, req.req.Header.Get(key))
|
||||||
}
|
}
|
||||||
|
|
||||||
func TestBeegoHTTPRequest_SetHost(t *testing.T) {
|
func TestBeegoHTTPRequestSetHost(t *testing.T) {
|
||||||
req := Post("http://beego.me")
|
req := Post("http://beego.me")
|
||||||
host := "test-hose"
|
host := "test-hose"
|
||||||
req.SetHost(host)
|
req.SetHost(host)
|
||||||
assert.Equal(t, host, req.req.Host)
|
assert.Equal(t, host, req.req.Host)
|
||||||
}
|
}
|
||||||
|
|
||||||
func TestBeegoHTTPRequest_Param(t *testing.T) {
|
func TestBeegoHTTPRequestParam(t *testing.T) {
|
||||||
req := Post("http://beego.me")
|
req := Post("http://beego.me")
|
||||||
key, value := "test-param", "test-param-value"
|
key, value := "test-param", "test-param-value"
|
||||||
req.Param(key, value)
|
req.Param(key, value)
|
||||||
@ -401,7 +401,7 @@ func TestBeegoHTTPRequest_Param(t *testing.T) {
|
|||||||
assert.Equal(t, value1, req.params[key][1])
|
assert.Equal(t, value1, req.params[key][1])
|
||||||
}
|
}
|
||||||
|
|
||||||
func TestBeegoHTTPRequest_Body(t *testing.T) {
|
func TestBeegoHTTPRequestBody(t *testing.T) {
|
||||||
req := Post("http://beego.me")
|
req := Post("http://beego.me")
|
||||||
body := `hello, world`
|
body := `hello, world`
|
||||||
req.Body([]byte(body))
|
req.Body([]byte(body))
|
||||||
@ -423,7 +423,7 @@ type user struct {
|
|||||||
Name string `xml:"name"`
|
Name string `xml:"name"`
|
||||||
}
|
}
|
||||||
|
|
||||||
func TestBeegoHTTPRequest_XMLBody(t *testing.T) {
|
func TestBeegoHTTPRequestXMLBody(t *testing.T) {
|
||||||
req := Post("http://beego.me")
|
req := Post("http://beego.me")
|
||||||
body := &user{
|
body := &user{
|
||||||
Name: "Tom",
|
Name: "Tom",
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user