Merge remote-tracking branches 'origin/sub_laptop_1' and 'origin/sub_laptop_8' into main_laptop_1

This commit is contained in:
2026-10-17 18:56:22 +09:00
4 changed files with 82 additions and 6 deletions
+4 -1
View File
@@ -1,6 +1,7 @@
"""152-3 도수로 · 돌붙임 띠 — 묻힌 유출 끝 3도 절토선(내림 · 수평)에도 띠 · 오르막 복합경사 절토엔 없음.
화면 TS 를 그 자리에서 돌린 값(`helper_152_3_chute_cut.cjs`) · B06 관 · 흙막이 띠와 3D 띠가 같은 거름.
배관 85.052 = 371-1 뒤 아랫단 0.5 m 내려가 끝 구간이 묻힘 → 성토 + 3도 절토(의도된 바뀜 · 394-3).
"""
import json
@@ -48,7 +49,9 @@ def test_배관_묻힌_끝_내림이면_띠_오르막이면_없음(out: dict) ->
def test_성토만인_측점은_그대로(out: dict) -> None:
base = out["pipeBase"]
assert base["bands3d"] == base["bands3dFillOnly"] == 2
assert [s["kind"] for s in base["segments"]] == ["fill", "cut"]
# 성토 조각 띠는 두 거름 같음 · 3도 절토 조각만 관 거름이 더함
assert base["bands3d"] == 2 and base["bands3dFillOnly"] == 1
def test_거름_한_벌_배선() -> None:
@@ -0,0 +1,63 @@
"""390-4 스냅 상태줄 글 = 고른 간격 따라 — `B05_Profile_UI_RouteEdit_SnapStep.ts` 의 `snapFitText`
를 Node 로 돌려 간격별 글 판정 + 편집기 두 자리(전체 · 놓을 때)가 그 글을 씀.
./venv/Scripts/python.exe -m pytest resources/tester/test_390_4_snap_step_text.py -q
"""
import json
import subprocess
from pathlib import Path
import pytest
ROOT = Path(__file__).resolve().parents[2]
B05 = ROOT / "B05_Profile"
SNAP = B05 / "B05_Profile_UI_RouteEdit_SnapStep.ts"
TS = ROOT / "config" / "node_modules" / "typescript"
STEPS = ["0.1", "1", "10", "station"]
NODE = """
const fs = require("fs");
const ts = require(process.argv[1]);
const js = ts.transpileModule(fs.readFileSync(process.argv[2], "utf8"), {
compilerOptions: { module: ts.ModuleKind.CommonJS, target: ts.ScriptTarget.ES2020 },
}).outputText;
const box = { exports: {} };
new Function("exports", "module", "require", js)(box.exports, box, () => ({}));
const steps = JSON.parse(process.argv[3]);
console.log(JSON.stringify(Object.fromEntries(steps.map((s) => [s, box.exports.snapFitText(s)]))));
"""
@pytest.fixture(scope="module")
def texts() -> dict:
run = subprocess.run( # noqa: S603 — 고정 실행 파일
["node", "-e", NODE, str(TS), str(SNAP), json.dumps(STEPS)],
capture_output=True,
text=True,
encoding="utf-8",
timeout=60,
)
assert run.returncode == 0, run.stderr
return json.loads(run.stdout)
@pytest.mark.parametrize(
("step", "want"),
[
("station", "곡선 가운데(MC)를 일반측점에 맞췄습니다."),
("0.1", "곡선 가운데(MC)를 0.1 m 배수에 맞췄습니다."),
("1", "곡선 가운데(MC)를 1 m 배수에 맞췄습니다."),
("10", "곡선 가운데(MC)를 10 m 배수에 맞췄습니다."),
],
)
def test_간격별_상태줄_글(texts, step, want) -> None:
assert texts[step] == want
def test_편집기는_고른_간격_글을_씀() -> None:
edit = (B05 / "B05_Profile_UI_RouteEdit.ts").read_text(encoding="utf-8")
assert "일반측점에 맞췄" not in edit
assert edit.count("applyEdit(snapStepM.text())") == 2
snap = SNAP.read_text(encoding="utf-8")
assert "text: () => snapFitText(select.value)" in snap