Files
Aislo/resources/tester/test_271_save_same.py
T
eomsangdonandClaude Opus 5.5 11c75f022a refactor(767-1): 안 쓰는 지면 필터 · 서피스 지움 — 필터 넷(CSF · 격자 최저 · PMF · RANSAC) · 표현 셋(TIN + Taubin 평활 · NURBS · meshfree) · 수치지형도 비교 방식 다섯 · 안 부르는 길 정리
- 필터 = 업체 분류 · 점진 TIN · 둘의 다듬기 판만 · 분석 허용 목록 = Ground 등록부(available_filters) 한 벌
- 표현 = DTM · implicit 만 · 평활 = DTM 만 · config 기본 목록 · PRECOMPUTE · 설정 사전 맞춤(설정 지문 바뀜 — 768 에서 다시 지음)
- 등고선 = 격자 · 굳힌 격자만(삼각망 굽기 · 외곽 맞춤 · implicit RBF 폴백 걷음) · 표본기 · 경로 찾기 tin · nurbs · meshfree 갈래 걷음
- 수치지형도 = 라플라스만(TIN 둘 · TPS · ANUDEM형 · 다중해상도 걷음) · B04 단추 하나
- 안 부르는 길 — B04 JSON 점군 GET · ground-stats GET + TS · B07 옛 계획평면도(라이다) 짓기 · lidar_source · LIDAR_ID · plan_lidar 종류 이름 · SOURCE_FILTER_LABELS · MODEL_METHODS(py) · MESH_* 설정
- 옛 manifest 의 지운 갈래 줄은 DB 로 되살리지 않음 · 옛 csf 행은 미리보기 · 등고선 그대로 열림 · 지운 이름 요청 = 400
- 낡은 글 — Ground · Pipeline 머리 · WF1 「없으면 csf」 · B07 음영 기본 「csf」 → 빈 값 · 등고선 폴백 「csf」 → 404 · B04 3D 보기 처음값 · B05 Schema · B06 Prebuild · 씨닝 설명
- 시험 지움 2 — test_b04_contour_raster · test_b04_contour_equivalence(지운 삼각망 굽기 · 없는 프로젝트를 봐 건너뛰던 것)
- 시험 덜어냄 — test_b04_ground_filters CSF · 격자 최저 네 경우(지운 필터)
- 시험 고침 — 허용 목록 · 형 검사에 걸린 csf · tin · grid_min_z · meshfree · tin_sheet 견본을 ptd · implicit · laplace 로(54_22 · 238_1 · 443 · 342_2 · 346_3 · 351_1 · 442_2 · 271 + helper · 344_1 · 133_1 · 343_2 · 637 · 754_1 · 763_1 깨진 tin → 깨진 implicit · 763_3 · b05 둘 · b06 · sheet_surface TIN(도엽선) 경우 지움) · 이름만 바꿈(273_2 · 343_1 · 343_3 · 624_1)

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-03 16:35:12 +09:00

90 lines
3.8 KiB
Python

"""463 B05 · B06 한 페이지 — [저장] 같은 본문(요구 271-5 · 분석 4장 (D)).
① 종단 보기를 안 연 [저장](기본 창구) · 연 뒤 [저장](종단 보기 몫) = 요청 줄 같음
— 옛 코드 = 기본 창구가 상단측만 보내 서버 확정 요청에 지표 조건 · 확정 지표면 id 가 빠짐
(비정규 측점 횡단 맞춤 안 돎)
② 노선 캐시 없음(새로고침해 B06 로 바로) = 서버에서 한 번 읽고 같은 본문
③ 서버 — 그 본문이면 확정이 비정규 측점 횡단을 맞춤(`can_regenerate`)
TS 셈은 `helper_271_save_same.cjs`.
./venv/Scripts/python.exe -m pytest resources/tester/test_271_save_same.py -q
"""
import json
import subprocess
from pathlib import Path
import pytest
from B05_Profile.B05_Profile_Schema import RouteConfirmRequest
ROOT = Path(__file__).resolve().parents[2]
HELPER = Path(__file__).with_name("helper_271_save_same.cjs")
pytestmark = pytest.mark.skipif(
not (ROOT / "config" / "node_modules" / "typescript").is_dir(),
reason="프론트엔드 의존성 미설치",
)
@pytest.fixture(scope="module")
def got() -> dict:
run = subprocess.run( # noqa: S603 — 고정 실행 파일
["node", str(HELPER)],
capture_output=True,
text=True,
encoding="utf-8",
timeout=120,
)
assert run.returncode == 0, run.stderr
return json.loads(run.stdout)
def _confirm_body(lines: list[str]) -> dict:
"""상단측 차례 본문 — 472-6 부터 한 본문 창구(`/design/save`)의 `uphill` 칸."""
posts = [line for line in lines if line.startswith("POST ") and "/design/save" in line]
assert len(posts) == 1, lines
return json.loads(posts[0].split(" ", 2)[2])["uphill"]
def test_종단_보기를_열든_안_열든_같은_요청(got):
assert got["closed"]["ok"] and got["open"]["ok"]
assert got["closed"]["failed"] == [] and got["open"]["failed"] == []
assert got["closed"]["lines"] == got["open"]["lines"]
body = _confirm_body(got["closed"]["lines"])
assert body == {
"filter_key": "ptd",
"method": "implicit",
"smooth": True,
"surface_model_id": 7,
"irregular_stations": [],
"uphill_overrides": [{"chainage_m": 40, "side": "right"}],
}
# 상단측 세션 · 종단 보기 메모리 둘 다 비움(다음 [저장]이 옛 값을 다시 안 보냄)
assert got["closed"]["uphillAfter"] is None and got["open"]["uphillAfter"] is None
# 종단 보기 몫에 상단측 사본(메모리 맵) 없음 — 기본 조각 그대로(472-5)
assert got["openOwnUphill"] == "undefined"
def test_노선_캐시_없어도_같은_본문(got):
lines = got["noCache"]["lines"]
assert lines[0] == "GET /api/projects/P463/route/latest"
assert _confirm_body(lines) == _confirm_body(got["closed"]["lines"])
def test_서버는_그_본문이면_비정규_측점_횡단을_맞춤(got):
body = _confirm_body(got["closed"]["lines"])
assert RouteConfirmRequest(**body).can_regenerate()
assert not RouteConfirmRequest(uphill_overrides=body["uphill_overrides"]).can_regenerate()
def test_종단_보기_몫은_기본_창구_함수를_부름():
actions = (ROOT / "B05_Profile" / "B05_Profile_UI_Page_Actions.ts").read_text("utf-8")
save = (ROOT / "A00_Common" / "design" / "design_save.ts").read_text("utf-8")
# 472-6 — 상단측 = 기본 조각 한 벌(종단 보기 몫 없음 · 메모리 사본 걷음 · 472-5) · 노선 바뀐 저장도 한
# 본문(6-B · 옛 창구 `flushRouteParts` 걷음 · 노선 바뀌면 손 상단측 안 보냄 = 요구 274)
assert "uphill:" not in actions
assert "saveRouteParts(" not in actions and "flushRouteParts" not in actions
assert "body: await routePartsBody(projectId)," in save
assert "flushRouteParts" not in save and "if (moved) return null;" in save