feat(b08): 라이브러리 가져오기 목록에 항목 종류 배지 [양식형]·[고정형] — 명세 13장대로 식이 한 줄이라도 있나로만 가름(저장된 item_kind 표시는 안 믿음)
Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_016VBGFXB9AbJBwXP19z75Qq
This commit is contained in:
@@ -216,6 +216,26 @@ def test_확정_때_기본_양식을_박는다(project: Path) -> None:
|
||||
assert library_module.pin_program_templates(project) == 0 # 이미 박힌 것은 그대로
|
||||
|
||||
|
||||
def test_항목마다_양식형_고정형_종류가_붙는다(tmp_path: Path) -> None:
|
||||
"""PLAN 4장 「항목마다 종류 배지」 — 명세 13장: 칸은 같고 `formula` 유무로만 갈림."""
|
||||
folder = tmp_path / "personal"
|
||||
folder.mkdir()
|
||||
fixed = {
|
||||
"type_id": "masonry_wet",
|
||||
"code": "AX-ST-0000beef",
|
||||
"name": "뽑은 항목",
|
||||
"rows": [{"name": "돌쌓기", "formula": "", "amount": 20.9}],
|
||||
}
|
||||
(folder / "AX-ST-0000beef.json").write_text(json.dumps(fixed), encoding="utf-8")
|
||||
dirs = {"personal": folder, "program": library_module.TEMPLATE_DIR}
|
||||
kinds = {item["tier"]: item["kind"] for item in library_module.list_items(dirs, "masonry_wet")}
|
||||
assert kinds == {"personal": "fixed", "program": "form"}
|
||||
ui = (ROOT / "B08_Quantity" / "B08_Quantity_UI_StructureSheet_Library.ts").read_text(
|
||||
encoding="utf-8"
|
||||
)
|
||||
assert "양식형" in ui and "고정형" in ui and "item.kind" in ui
|
||||
|
||||
|
||||
def test_코드_모양이_아니면_박지_않는다(project: Path) -> None:
|
||||
with pytest.raises(ValueError):
|
||||
library_module.import_item(project, {"type_id": "masonry_wet", "code": "../x"}, "personal")
|
||||
|
||||
Reference in New Issue
Block a user