- 새 프로젝트 씨앗(KINDS)에서도 빠짐 · 새 열은 구조물 도면 · 면적산출만 만듦 - storage 층(회사 · 개인 · 프로젝트) material/ 파일은 지우지 않음(읽기만 끊음) - 장부 재료번 칸은 다음 집계표 [저장] 때 빠짐 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01NPJGtfXo6GMbcpiboQC4uK
49 lines
1.9 KiB
Python
49 lines
1.9 KiB
Python
"""저장 뒤 식 · 값 유지 — M02 면적산출 저장본을 서버 엔진으로 다시 풀면 저장된 `계산값` 과 같음.
|
|
|
|
시험 안 견본 저장본(`fixtures/m02_master_sample` · PLAN 26-5a)을 읽기만 함.
|
|
저장 때 서버가 적은 값과 지금 엔진 풀이가 어긋나면 화면을 다시 열 때
|
|
값이 달라 보임.
|
|
"""
|
|
|
|
import json
|
|
import shutil
|
|
|
|
import pytest
|
|
|
|
from common_util import common_util_spreadsheet as spreadsheet
|
|
from resources.tester.helper_m02_master_sample import SAMPLE as FOLDER
|
|
|
|
pytestmark = pytest.mark.skipif(shutil.which("node") is None, reason="node 가 없음")
|
|
|
|
|
|
def _books() -> list[tuple[str, dict]]:
|
|
out = []
|
|
for kind in ("area",):
|
|
for path in sorted((FOLDER / kind).glob("[!.]*.json")):
|
|
book = json.loads(path.read_text(encoding="utf-8"))
|
|
if isinstance(book, dict) and book.get("시트"):
|
|
out.append((f"{kind}/{path.stem}", book))
|
|
return out
|
|
|
|
|
|
def test_저장본_서버_재계산_같음():
|
|
books = _books()
|
|
assert any("계산값" in b for _, b in books), "계산값 있는 저장본이 없음"
|
|
fresh = spreadsheet.recalc_workbooks([b for _, b in books])
|
|
diffs = []
|
|
for (name, book), values in zip(books, fresh):
|
|
if "계산값" not in book:
|
|
continue # 옛 저장본 — 풀리기만 하면 됨
|
|
saved = book["계산값"]
|
|
for sheet, cells in values.items():
|
|
for addr, v in cells.items():
|
|
if saved.get(sheet, {}).get(addr) != v:
|
|
diffs.append(
|
|
f"{name} {sheet}!{addr}: 저장 {saved.get(sheet, {}).get(addr)} · 지금 {v}"
|
|
)
|
|
for sheet, cells in saved.items():
|
|
for addr in cells:
|
|
if addr not in values.get(sheet, {}):
|
|
diffs.append(f"{name} {sheet}!{addr}: 저장에만 있음")
|
|
assert not diffs, "\n".join(diffs[:30])
|