MCPcopy
hub / github.com/gofiber/fiber / Test_Client_PathParam_With_Server

Function Test_Client_PathParam_With_Server

client/client_test.go:1859–1875  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

1857}
1858
1859func Test_Client_PathParam_With_Server(t *testing.T) {
1860 app, dial, start := createHelperServer(t)
1861
1862 app.Get("/:test", func(c fiber.Ctx) error {
1863 return c.SendString(c.Params("test"))
1864 })
1865
1866 go start()
1867
1868 resp, err := New().SetDial(dial).
1869 SetPathParam("path", "test").
1870 Get("http://example.com/:path")
1871
1872 require.NoError(t, err)
1873 require.Equal(t, fiber.StatusOK, resp.StatusCode())
1874 require.Equal(t, "test", resp.String())
1875}
1876
1877func Test_Client_TLS(t *testing.T) {
1878 t.Parallel()

Callers

nothing calls this directly

Calls 9

createHelperServerFunction · 0.85
NewFunction · 0.70
GetMethod · 0.65
SendStringMethod · 0.65
ParamsMethod · 0.65
SetDialMethod · 0.65
StringMethod · 0.65
SetPathParamMethod · 0.45
StatusCodeMethod · 0.45

Tested by

no test coverage detected