MCPcopy
hub / github.com/encode/starlette / test_cookies_edge_cases

Function test_cookies_edge_cases

tests/test_requests.py:415–428  ·  tests/test_requests.py::test_cookies_edge_cases
(
    set_cookie: str,
    expected: dict[str, str],
    test_client_factory: TestClientFactory,
)

Source from the content-addressed store, hash-verified

413 ],
414)
415def test_cookies_edge_cases(
416 set_cookie: str,
417 expected: dict[str, str],
418 test_client_factory: TestClientFactory,
419) -> None:
420 async def app(scope: Scope, receive: Receive, send: Send) -> None:
421 request = Request(scope, receive)
422 response = JSONResponse({class="st">"cookies": request.cookies})
423 await response(scope, receive, send)
424
425 client = test_client_factory(app)
426 response = client.get(class="st">"/", headers={class="st">"cookie": set_cookie})
427 result = response.json()
428 assert result[class="st">"cookies"] == expected
429
430
431@pytest.mark.parametrize(

Callers

nothing calls this directly

Calls 3

test_client_factoryFunction · 0.85
jsonMethod · 0.80
getMethod · 0.45

Tested by

no test coverage detected