Files
Aislo/resources/tester/test_507_3_mc_label.py
T
eomsangdonandClaude Opus 5.5 1a8a16a99b fix(507-3 MC 강조): B05 · B06 MC 측점 글 (MC) · 한 단계 크게 · 굵게 · 경고색 · B07 종단 표 · 횡단 제목 · B08 토적표 · B09 인쇄 토적표 (MC) — 요구 311-4
- 평면 눈금 굵은 13px · 종단 12px · 횡단 판 · B06 카드 · 상세 창 제목 = --color-warning(밝음 · 어두움)
- 측점 갈아끼움 이름 = 서버 꼴 STA… (MC)
- B08 토적표 줄 mc = 서버가 종단 파일 kind curve 로 실음
- test_507_3_mc_label

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-21 16:03:02 +09:00

90 lines
3.8 KiB
Python

"""PLAN 507-3 — MC(곡선 가운데 · 측점 `kind` curve) 강조 · B07~B09 (MC).
B05 · B06 화면 = (MC) · 한 단계 크게 · 굵게 · 경고색(`--color-warning` — 밝음 · 어두움 테마 둘 다) ·
B07 CAD 종단 표 · 횡단 제목 = 09-03 표기 뒤 「 (MC)」(평면은 5 배수 측점만 글 · MC 글 없음) ·
B08 토적표(B09 인쇄가 같은 표) = 서버가 MC 줄에 `mc` ·
브라우저 측점 갈아끼움 이름 = 서버 꼴 「STA… (MC)」.
"""
from __future__ import annotations
import json
from pathlib import Path
from B07_DesignDetail.B07_DesignDetail_Engine_Cad import mc_suffix
from B07_DesignDetail.B07_DesignDetail_Engine_Cad_Long import _long_table_values
from B08_Quantity.B08_Quantity_Router_Earthwork import _mc_chainages
ROOT = Path(__file__).resolve().parents[2]
STATIONS = [
{"chainage_m": 580.0, "kind": "regular", "center_z": 10.0},
{"chainage_m": 599.0, "kind": "curve", "center_z": 10.5},
{"chainage_m": 600.0, "kind": "regular", "center_z": 11.0},
]
def _src(relative: str) -> str:
return (ROOT / relative).read_text(encoding="utf-8")
def test_mc_suffix_only_curve() -> None:
assert mc_suffix({"kind": "curve"}) == " (MC)"
assert mc_suffix({"kind": "regular"}) == ""
assert mc_suffix({"kind": "irregular"}) == ""
assert mc_suffix(None) == ""
def test_b07_long_table_station_mc() -> None:
rows = _long_table_values(STATIONS, STATIONS, [(0.0, 10.0), (700.0, 12.0)], {}, 20.0)
assert [row["station"] for row in rows] == ["No.29", "No.29+19.0 (MC)", "No.30"]
def test_b08_mc_chainages_from_longitudinal(tmp_path: Path) -> None:
relative = "B06_Section/longitudinal/longitudinal.json"
path = tmp_path / relative
path.parent.mkdir(parents=True)
path.write_text(json.dumps({"stations": STATIONS}), encoding="utf-8")
assert _mc_chainages(tmp_path, {"longitudinal_file_path": relative}) == {599.0}
assert _mc_chainages(tmp_path, {"longitudinal_file_path": "none.json"}) == set()
assert _mc_chainages(tmp_path, None) == set()
def test_b07_cross_title_mc() -> None:
support = _src("B07_DesignDetail/B07_DesignDetail_Router_Support.py")
assert support.count("+ mc_suffix(source)") == 2 # 횡단 장 제목 · 횡단 한 장 제목
def test_b08_b09_earthwork_station_mc() -> None:
tables = _src("B08_Quantity/B08_Quantity_Earthwork_Tables.ts")
assert '(row.mc ? " (MC)" : "")' in tables
# B09 인쇄 토적표 = B08 표 옵션 그대로
assert "earthworkSheetOptions(table, interval)" in _src(
"B09_Estimation/draft/B09_Draft_Print_Quantity.ts"
)
def test_b05_b06_screen_mc_emphasis() -> None:
css = _src("B06_Section/B06_Section_UI_Style_Cross.css")
assert "header strong.b06-station--mc {" in css # 카드 머리 strong 규칙을 이김
for rule in ("\n.b06-chart__station-label--mc {", "\n.b06-station--mc {"):
body = css[css.index(rule) : css.index("}", css.index(rule))]
assert "var(--color-warning)" in body
assert "var(--font-weight-bold)" in body
# 고름 빨강이 MC 색을 이김 — 뒤에 섬
assert css.index(".b06-chart__station-label--mc {") < css.index(
".b06-chart__station-label--selected {"
)
assert "b06-chart__station-label--mc" in _src("B06_Section/B06_Section_UI_Longitudinal.ts")
assert 'label.className = "b06-station--mc"' in _src(
"B06_Section/B06_Section_UI_Cross_Card_Chrome.ts"
)
cross = _src("B05_Profile/B05_Profile_UI_RouteEdit_Cross.ts")
assert "kind: section.kind ?? null" in cross
assert '${mc ? " b06-station--mc" : ""}' in cross
ticks = _src("B04_PreProcess/B04_PreProcess_UI_MapOverlays.ts")
assert 'mc ? "bold 13px' in ticks
assert 'themeColor("--color-warning"' in ticks
swap = _src("B06_Section/logic/B06_Section_Station_Swap.ts")
assert 'formatStation(station.chainageM) + (kind === "curve" ? " (MC)" : "")' in swap