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

This commit is contained in:
2026-09-16 15:57:29 +09:00
3 changed files with 70 additions and 1 deletions
+31
View File
@@ -271,3 +271,34 @@ def test_같은_기울기가_두_자리인_까닭을_표가_말함(client: TestC
assert any("축과 근거가 다름" in line for line in notice)
slope = _get(client, "masonry_slope", size=1)["notice"]
assert any("횡단 도면" in line for line in slope) # 표준경사 쪽 알림은 그대로
def test_kind_목록을_서버가_줌_새_kind_도_저절로(
client: TestClient, monkeypatch: pytest.MonkeyPatch
) -> None:
"""화면이 kind 목록을 제 코드에 들면 **새 kind 가 조용히 안 뜸**(기계 작업량이 그랬음 · 브레인).
⇒ 갈래·kind·한글 이름·줄 수를 서버가 냄. 화면은 상자만 세운다.
"""
listed = client.get("/api/master-data/base-prices")
assert listed.status_code == 200, listed.text
items = listed.json()["kinds"]
assert [i["kind"] for i in items] == list(base_prices.KINDS)
groups = {i["kind"]: i["group"] for i in items}
assert groups["labor"] == "base_price" and groups["machine_productivity"] == "pumsem_basis"
assert {i["group"] for i in items} == {"base_price", "pumsem_basis"}
labor = next(i for i in items if i["kind"] == "labor")
assert labor["label"] == "노임" and labor["rows"] == 261 # 이름은 이름표에서
assert next(i for i in items if i["kind"] == "machine_productivity")["rows"] == 47
from Z01_MasterData import Z01_MasterData_BasePrices_Tables as base_tables
fake = dict(base_tables.SPEC)
fake["coef_fake"] = dict(base_tables.SPEC["coef"])
monkeypatch.setattr(base_tables, "SPEC", fake)
monkeypatch.setattr(base_prices, "KINDS", (*base_prices.KINDS, "coef_fake"))
grown = client.get("/api/master-data/base-prices").json()["kinds"]
assert [i["kind"] for i in grown][-1] == "coef_fake" # 더하면 목록이 저절로 늚
assert (
next(i for i in grown if i["kind"] == "coef_fake")["label"] == "coef_fake"
) # 이름표 전엔 영문