From 2bb056e5166510ef7b96479b1a0bcfde835fe1e1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=8D=BF=E4=BA=91=E7=A7=8B=E6=9C=88?= <15273589815@163.com> Date: Sat, 12 Sep 2026 12:09:55 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E4=BF=AE=E6=AD=A3=E5=90=88=E5=B9=B6?= =?UTF-8?q?=E8=BF=9B=E6=9D=A5=E7=9A=84=20test=5Fsecurity.py=20=E4=B8=A4?= =?UTF-8?q?=E5=A4=84=E5=AF=86=E9=92=A5=E8=B7=AF=E5=BE=84=E6=BC=82=E7=A7=BB?= =?UTF-8?q?=EF=BC=88=E6=BC=8F=20dev/=EF=BC=8C=E6=A0=87=E5=87=86=E5=B8=83?= =?UTF-8?q?=E5=B1=80=E4=B8=8B=E5=BF=85=E7=BA=A2=202=20=E4=B8=AA=E7=94=A8?= =?UTF-8?q?=E4=BE=8B=EF=BC=89?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- tests/unit/core/test_security.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tests/unit/core/test_security.py b/tests/unit/core/test_security.py index 658d797..9259993 100644 --- a/tests/unit/core/test_security.py +++ b/tests/unit/core/test_security.py @@ -45,7 +45,7 @@ def test_authenticate_valid_token() -> None: def test_authenticate_visitor_token_returns_limited_anonymous_context() -> None: now = datetime.now(UTC) - private_key = Path("config/jwt/jwt-private.pem").read_text(encoding="utf-8") + private_key = (DEV_KEY_DIR / "jwt-private.pem").read_text(encoding="utf-8") token = jwt.encode( {"sub": "2", "iss": "jr-auth", "aud": "jr-agent-platform", "iat": now, "nbf": now, "exp": now + timedelta(minutes=5), "jti": "visitor-jti-1", @@ -105,7 +105,7 @@ async def test_visitor_token_skips_identity_database_resolution(monkeypatch): from app.api.dependencies.auth import _authenticator, build_request_context now = datetime.now(UTC) - private_key = Path("config/jwt/jwt-private.pem").read_text(encoding="utf-8") + private_key = (DEV_KEY_DIR / "jwt-private.pem").read_text(encoding="utf-8") token = jwt.encode( {"sub": "2", "iss": "jr-local", "aud": "jr-agent-platform", "iat": now, "nbf": now, "exp": now + timedelta(minutes=5), "jti": "visitor-jti-2",