MCPcopy
hub / github.com/labstack/echo / TestEchoPost

Function TestEchoPost

echo_test.go:860–875  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

858}
859
860func TestEchoPost(t *testing.T) {
861 e := New()
862
863 ri := e.POST("/", func(c *Context) error {
864 return c.String(http.StatusTeapot, "OK")
865 })
866
867 assert.Equal(t, http.MethodPost, ri.Method)
868 assert.Equal(t, "/", ri.Path)
869 assert.Equal(t, http.MethodPost+":/", ri.Name)
870 assert.Nil(t, ri.Parameters)
871
872 status, body := request(http.MethodPost, "/", e)
873 assert.Equal(t, http.StatusTeapot, status)
874 assert.Equal(t, "OK", body)
875}
876
877func TestEchoPut(t *testing.T) {
878 e := New()

Callers

nothing calls this directly

Calls 4

NewFunction · 0.85
requestFunction · 0.85
POSTMethod · 0.45
StringMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…