Files
XingHuo/tests/test_wave0_trace.py
zhanghongyu_0626 3995cb44d8 Implement authentication and chat functionality with JWT support
- Added `auth.py` for mock login and JWT issuance.
- Introduced `chat.py` for handling chat requests with role-based access control.
- Enhanced `main.py` to include new routers and middleware for tracing.
- Implemented input validation in `input_guard.py` to prevent SQL injection.
- Created repositories for managing agent sessions and audit logs.
- Added exception handling for authorization errors.
- Updated settings to include JWT configuration.
- Introduced tests for authentication and input validation.
2026-09-07 17:20:42 +08:00

14 lines
392 B
Python
Raw Permalink Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
"""Wave 0:trace_id 测试。"""
def test_health_returns_trace_id(client):
resp = client.get("/health")
assert resp.status_code == 200
assert resp.headers.get("X-Trace-Id")
assert resp.json()["trace_id"]
def test_trace_id_echo(client):
resp = client.get("/health", headers={"X-Trace-Id": "trace-fixed-001"})
assert resp.headers["X-Trace-Id"] == "trace-fixed-001"