feat(836-2): 기계 덮음(836-1) 도 고친 항목 — 그 기계 줄 M01 바뀌면 덮음 지움 + 알림 · 문서 다시 복사 때 덮음 유지

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
2026-11-15 13:37:38 +09:00
co-authored by Claude Opus 5.5
parent 7ef248df24
commit ea95007a32
4 changed files with 107 additions and 3 deletions
@@ -211,3 +211,38 @@ def test_imported_values_only(world, monkeypatch):
back = _at(me, lambda: imp.to_price(store.read("sangeun", key)["문서"], "엑셀")["문서"])
_at(me, lambda: store.write("sangeun", key, store.read("sangeun", key)["판"], back))
assert _sum(me, key) == excel
def _cover(me, key: str, cover: dict) -> None:
got = _at(me, path.read, key)
doc = {**copy.deepcopy(got["문서"]), "기계덮음": cover}
_at(me, path.save, key, {"문서": doc, "판": got["판"]})
def test_machine_cover_dropped_when_machine_moves(world, monkeypatch):
"""㉢ 기계 덮음(836-1) + 그 기계 줄 M01 바뀜 = 덮음 지움 + 알림(전 · 후 · 내 고침 값)."""
me = world["personal"]
key = _sk(me)
_stack(me, key, [("기계", MACHINE, "묶음")])
no = MACHINE["입력"]["기계"].strip("'")
_cover(me, key, {no: {"값": {"가격": 150000}}})
assert _at(me, path.read, key)["문서"]["기계덮음"]
_move(monkeypatch, DIG)
got = _at(me, path.read, key)
assert "기계덮음" not in got["문서"]
[note] = got["사본"]["갱신"]
assert note["키"] == DIG and note["갈래"] == "기계"
assert any(x.startswith("가격 ") for x in note["M01"]) and note["내고침"] == ["가격 150000"]
def test_machine_cover_kept_other_item(world, monkeypatch):
"""㉣ 기계 덮음 + 다른 항목(바탕 문서)만 바뀜 = 덮음 그대로(문서 다시 복사 뒤에도)."""
me = world["personal"]
key = _base(me)
_stack(me, key, [("기계", MACHINE, "묶음")])
no = MACHINE["입력"]["기계"].strip("'")
_cover(me, key, {no: {"값": {"가격": 150000}}})
_doc_move(monkeypatch, PCT, _rate("노무비 × 4%"))
got = _at(me, path.read, key)
assert got["문서"]["기계덮음"] == {no: {"값": {"가격": 150000}}}
assert [n["갈래"] for n in got["사본"]["갱신"]] == ["문서"] # 기계 줄 붙인 문서 고침