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

This commit is contained in:
2026-09-20 02:30:33 +09:00
14 changed files with 403 additions and 164 deletions
+28
View File
@@ -304,3 +304,31 @@ def test_품셈재료_단가는_연결의_낮은_값과_출처(client: TestClien
one = _get(client, "/api/m01/logic", key=key)
power = one["prices"][key_of("MP:전력")]
assert power["값"] > 0 and power["출처"].startswith(key_of("MT:M0005250064") + ".")
def test_하위_거름과_참조_이름(client: TestClient) -> None:
every = _get(client, "/api/m01/rows", file=LABOR, size=500)
survey = _get(client, "/api/m01/rows", file=LABOR, size=500, sub="측량")
assert 0 < survey["total"] < every["total"] and {r["조사"] for r in survey["rows"]} == {"측량"}
machine = _get(client, "/api/m01/rows", file="기계.json", size=500, sub="산림품셈")
assert 0 < machine["total"] < 100 and {r["세부분류"] for r in machine["rows"]} == {"산림품셈"}
linked = _get(client, "/api/m01/rows", file="재료_품셈재료.json", size=500)
keyed = [r for r in linked["rows"] if isinstance(r["연결"], str)]
assert keyed and all(linked["refs"][r["연결"]] for r in keyed)
def test_시중물가_저장은_띄어쓰기를_안_바꿈(client: TestClient) -> None:
market = "재료_시중물가.json"
old = (store.FOLDER / market).read_text(encoding="utf-8").split("\n")
rows = _get(client, "/api/m01/rows", file=market, size=1)
row = rows["rows"][0]
row["값"]["시중"]["가격정보"] = 1
change = {"op": "edit", "key": row["키"], "row": row}
body = {"files": [{"file": market, "version": rows["version"], "changes": [change]}]}
assert client.post("/api/m01/save", json=body).status_code == 200
new = (store.FOLDER / market).read_text(encoding="utf-8").split("\n")
diff = [(a, b) for a, b in zip(old, new) if a != b]
assert len(new) == len(old) and len(diff) == 1
assert diff[0][1].replace('"가격정보": 1,', '"가격정보": X,').count("{ ") == diff[0][0].count(
"{ "
)