14 lines
392 B
Python
14 lines
392 B
Python
"""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"
|