File: test_application_before_send.py

package info (click to toggle)
litestar 2.19.0-2
  • links: PTS, VCS
  • area: main
  • in suites: sid
  • size: 12,500 kB
  • sloc: python: 70,169; makefile: 254; javascript: 105; sh: 60
file content (11 lines) | stat: -rw-r--r-- 428 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
from docs.examples.application_hooks import before_send_hook

from litestar.status_codes import HTTP_200_OK
from litestar.testing import TestClient


def test_application_before_send_hooks() -> None:
    with TestClient(app=before_send_hook.app) as client:
        response = client.get("/test")
        assert response.status_code == HTTP_200_OK
        assert response.headers.get("My-Header") == "value injected during send"