start sprint 4 error code mapping
Some checks failed
CI / pytest (Python 3.10) (push) Has been cancelled
CI / pytest (Python 3.11) (push) Has been cancelled
CI / pytest (Python 3.12) (push) Has been cancelled

This commit is contained in:
Frontend Developer
2026-07-03 21:55:30 +08:00
parent e554215335
commit 86296bdb0e
5 changed files with 247 additions and 3 deletions

View File

@@ -9,6 +9,9 @@
from __future__ import annotations
import json
from pathlib import Path
import pytest
from fastapi.testclient import TestClient
@@ -158,6 +161,12 @@ class TestRegistry:
"""
assert len(MESSAGES_ZH_CN) == 17
def test_frontend_i18n_catalog_matches_registry(self):
catalog_path = Path(__file__).resolve().parents[2] / "packages" / "i18n" / "zh-CN" / "errors.json"
catalog = json.loads(catalog_path.read_text(encoding="utf-8"))
expected = {code: message.to_dict() for code, message in MESSAGES_ZH_CN.items()}
assert catalog == expected
# ---------------- exceptions.py ----------------