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

Function Test_Client_CookieJar

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

Source from the content-addressed store, hash-verified

1513}
1514
1515func Test_Client_CookieJar(t *testing.T) {
1516 handler := func(c fiber.Ctx) error {
1517 return c.SendString(
1518 c.Cookies("k1") + c.Cookies("k2") + c.Cookies("k3"),
1519 )
1520 }
1521
1522 jar := AcquireCookieJar()
1523 defer ReleaseCookieJar(jar)
1524
1525 jar.SetKeyValue("example.com", "k1", "v1")
1526 jar.SetKeyValue("example.com", "k2", "v2")
1527 jar.SetKeyValue("example", "k3", "v3")
1528
1529 wrapAgent := func(c *Client) {
1530 c.SetCookieJar(jar)
1531 }
1532 testClient(t, handler, wrapAgent, "v1v2")
1533}
1534
1535func Test_Client_CookieJar_Response(t *testing.T) {
1536 t.Parallel()

Callers

nothing calls this directly

Calls 7

AcquireCookieJarFunction · 0.85
ReleaseCookieJarFunction · 0.85
testClientFunction · 0.85
SetKeyValueMethod · 0.80
SetCookieJarMethod · 0.80
SendStringMethod · 0.65
CookiesMethod · 0.65

Tested by

no test coverage detected