Merge remote-tracking branch 'origin/main_laptop_1' into sub_laptop_1

This commit is contained in:
2026-09-15 19:37:29 +09:00
2 changed files with 22 additions and 16 deletions
+12 -10
View File
@@ -170,27 +170,29 @@ def test_찾는_차례와_없는_이름은_영문_key(
def test_낱값은_파일마다_표_하나_설명은_뺌(client: TestClient) -> None:
"""브레인 ④ — 표 아닌 마디(값 묶음)도 트리에 `@values` 한 마디로 · 값/설명 가름은 이름표 `role`."""
"""브레인 ④ — 표 아닌 마디(값 묶음)도 트리에 `@values` 한 마디로 · 값/설명 가름은 이름표 `kind`."""
files = _files(client)
rates = files["rates"]["tables"]
assert rates[-1]["id"] == "@values"
assert rates[-1]["id"] == "@values" and rates[-1]["label"] == "낱값" # 이름표 synthetic_tables
values = _rows(client, file="rates", table="@values", size=500)
assert values["total"] == rates[-1]["row_count"]
by_path = {r["@path"]: r for r in values["rows"]}
sanjae = by_path["variables/rate_sanjae"]
assert sanjae["@value"] == {"rate_percent": 3.56, "base": "total_labor_cost"}
assert sanjae["@name"] == "산재보험료"
assert {c["key"]: c["hidden"] for c in values["columns"]} == {
"@name": False,
"@value": False,
"@path": True,
assert {c["key"]: (c["label"], c["hidden"]) for c in values["columns"]} == {
"@name": ("항목", False),
"@value": ("값", False),
"@path": ("원문 자리", True),
}
assert "@values" not in {
t["id"] for t in files["work_item_master"]["tables"]
} # 방침·집계 = 설명
assert "@values" not in {t["id"] for t in files["fx"]["tables"]} # 값 묶음 없음 — 줄이 곧 값
for entry in LABELS["files"]: # 보이는 것 = 이름표가 「값」 이라 한 것 그대로
want = [g["key"] for g in entry["value_groups"] if g["role"] == "value"]
for entry in LABELS[
"files"
]: # 보이는 것 = 이름표가 「값」 이라 한 것 그대로(수로 박지 않음 — 이름표가 늘어도 맞음)
want = [g["key"] for g in entry["value_groups"] if g["kind"] == "value"]
got = (
_rows(client, file=entry["file_id"], table="@values", size=500)["rows"]
if "@values" in {t["id"] for t in files[entry["file_id"]]["tables"]}
@@ -209,9 +211,9 @@ def test_이름표가_값_설명을_안_가른_마디는_미판정으로_보임(
lagging = [dict(g) for g in entry["value_groups"]]
for g in lagging:
if g["key"] in ("variables/rate_vat", "variables/rate_goyong/base"):
del g["role"] # 이름표가 뒤처짐
del g["kind"] # 이름표가 뒤처짐
elif g["key"] == "variables/rate_care":
g["role"] = "formula" # 코드가 모르는 낱말도 미판정
g["kind"] = "formula" # 코드가 모르는 낱말도 미판정
(tmp_path / "labels_2026-01-01.json").write_text(
json.dumps({**LABELS, "files": [{**entry, "value_groups": lagging}]}, ensure_ascii=False),
encoding="utf-8",