Files
Aislo/resources/tester/test_507_1_exposed_mark.py
T
eomsangdonandClaude Opus 5.5 254b5267ff fix(507-1 노출형 횡단수로 · 개거 = 횡단면 표시만): 부품 상자 형상 「표시만」(mark · 읽는 칸 없음 · 그림 없음) · 두 종류 처음값 = 측점 세움(anchor) + 표시만 · B05 「횡단」 판 · 임시 횡단 창 = 머리 걷기 전 구조물 이름 칩 남김 — 요구 311-2
- 사용자 마스터(구조물정의.json 반영) 안 고침 · M02 표 형상 칸에서 「표시만」 고름
- 시험 약속 바뀜: 322-1 처음값 · 272-1 · 322-3 측점 120 더함 · 322-2 218 규칙 보기 = 반사경 · 505-3 칩에 이름
- 새 시험 test_507_1_exposed_mark(.py · _screen)

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-21 15:49:05 +09:00

75 lines
2.9 KiB
Python

"""PLAN 507-1 노출형 횡단수로 · 개거 = 횡단면 표시만(요구 311-2).
- 부품 상자 형상 `mark`(표시만) — 읽는 칸 · 필수 칸 없음 → 빈칸 경고 없음 · 그리는 함수 없음.
- 처음값 = 횡단도 anchor(측점 세움) · 카드이름 name · 형상 mark · 3D none.
- 측점 계획 = 그 자리에 측점 하나 · 이름 = 종류 이름.
- 실제 정의(사용자 마스터 · 반영 없음) = M02 검사 오류 없음(218 규칙 = 형상 none 만 막음).
- B05 「횡단」 판 · 임시 횡단 창 = 카드 머리를 걷기 전에 구조물 이름 칩을 꺼내 남김.
"""
from __future__ import annotations
from pathlib import Path
from B05_Profile.B05_Profile_Structures_Schema import StructureInstance, load_definition
from common_util.common_util_structure_catalog import (
catalog,
load_parts,
resolve_catalog,
shape_needs,
)
from common_util.common_util_structure_station import plan_stations
from M02_MasterTemplete.StructOptions.M02_SO_Check import catalog_errors
ROOT = Path(__file__).resolve().parents[2]
KINDS = {"cross_drain_exposed": "노출형 횡단수로", "open_ditch": "개거(겉도랑)"}
def test_mark_part_has_no_fields() -> None:
mark = load_parts()["parts"]["형상"]["mark"]
assert mark["읽는 칸"] == [] and "필수 칸" not in mark
assert "point" in mark["자리꼴"] and "structures" in mark["정본"]
def test_start_values_are_mark_only() -> None:
rows = resolve_catalog(load_definition())
for type_id in KINDS:
row = rows[type_id]
got = (row["station"], row["title"], row["shape"], row["model3d"])
assert got == ("anchor", "name", "mark", "none"), type_id
assert shape_needs(type_id) == []
def test_station_planted_with_name() -> None:
structures = [
StructureInstance.model_validate(
{
"structure_id": f"s{i}",
"type_id": type_id,
"placement": "point",
"chainage_m": at,
"options": {},
}
)
for i, (type_id, at) in enumerate((("cross_drain_exposed", 120.0), ("open_ditch", 240.0)))
]
plan = plan_stations([], structures)
assert [(round(s["chainage_m"], 3), s["title"], s["blank"]) for s in plan] == [
(120.0, KINDS["cross_drain_exposed"], []),
(240.0, KINDS["open_ditch"], []),
]
def test_real_definition_passes_m02_check() -> None:
assert load_definition().get("반영") == {} # 사용자 마스터 값은 안 고침
assert catalog_errors(load_definition(), None) == []
assert all(catalog()[t]["shape"] == "mark" for t in KINDS)
def test_b05_card_keeps_structure_name_chip() -> None:
card = (ROOT / "B05_Profile" / "B05_Profile_UI_RouteEdit_Cross_Card.ts").read_text(
encoding="utf-8"
)
keep = card.index(":scope > header .b06-cross-card__structure")
assert keep < card.index(':scope > header, :scope > footer, .b06-cross-card__zoom"')