Files
Aislo/resources/tester/test_173_6_half_width_apply.py
T
eomsangdonandClaude Opus 5.5 281c71b55b refactor(logic): 348-1 순수 계산 TS 49 파일 <페이지>/logic/ 로 옮김 — 이름 앞머리 그대로 · 동작 고침 없음
- 옮김: B04 2 · B05 23 · B06 11 · A00_Common/design 13 (9,299 줄) · 이미 logic/ 에 있던 16 파일 그대로
- 안 옮김: 묶음 입구(package.json build:*) · 파이썬 · 순수지만 계산 아닌 8 (보기 결선 · 콜백 · API 타입 · 갈아끼움 알림판)
- import 266 줄(142 파일) · 시험 · 주석 · 짝 표시 문자열 경로 고침 · B05 · B06 CLAUDE.md 짝 줄 logic/
- 시험 도우미 새 경로: 가짜 require 열쇠 · B05()/B06() 부름 · 형제 import 자리 · tsc 묶어 돌리는 시험 · 정규식 · rglob
- design_view_cross 줄 한도 시험 685 → 688 (긴 import 경로 줄바꿈 3줄)
- 확인: typecheck 0 · 서버 묶음 넷(corridor · server-calc · b07-extent · b07-note) 다시 지어 코드 같음(//#region 경로 주석만 다름) · 관련 시험 270 파일 — 남은 실패 19 는 옮기기 전과 같음

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_014utrjfoW831Vc5wJUd13kL
2026-10-16 13:44:50 +09:00

49 lines
1.9 KiB
Python

"""173-6 횡단 보기 반폭 [적용] — 요청값만으로 샘플 폭을 잼(교차점 맞춤 폭 안 씀).
원지반 못 만나는 측점이 있으면 누를 때마다 서버 재생성하던 옛 줄(`maxToeFitHalfWidth`)을 지움 →
보유 샘플(20 m) 넘는 값일 때만 재생성 · 나머지는 카드 다시 그리기만.
소스(`design_view_cross.ts` · `B06_Section_UI_Cross_Fit.ts`) + `createSampleWidener` 를 돌린 값
(`helper_173_6_half_width.cjs`).
"""
import json
import subprocess
from pathlib import Path
import pytest
HERE = Path(__file__).parent
ROOT = HERE.parents[1]
DVC = (ROOT / "A00_Common" / "design" / "design_view_cross.ts").read_text(encoding="utf-8")
FIT = (ROOT / "B06_Section" / "logic" / "B06_Section_UI_Cross_Fit.ts").read_text(encoding="utf-8")
def _apply_body() -> str:
at = DVC.index("async function applyCrossHalfWidth")
return DVC[at : DVC.index("\n }\n", at)]
def test_적용은_요청값만_넘김() -> None:
body = _apply_body()
assert "ensureSampledWidth(requested)" in body
assert "maxToeFitHalfWidth" not in DVC and "Math.max" not in body
def test_교차점_맞춤_폭_함수_지움() -> None:
assert "maxToeFitHalfWidth" not in FIT and "toeFitHalfWidth" not in FIT
@pytest.mark.skipif(not (ROOT / "config" / "node_modules").is_dir(), reason="의존성 미설치")
def test_보유_폭_안은_재생성_없음_넘을_때만_한_번() -> None:
done = subprocess.run( # noqa: S603 — 고정 실행 파일
["node", str(HERE / "helper_173_6_half_width.cjs")],
capture_output=True,
text=True,
encoding="utf-8",
)
assert done.returncode == 0, done.stderr
out = json.loads(done.stdout)
assert out["within"] == [True, True, True] and out["withinCalls"] == 0
assert out["over"] is True and out["overCalls"] == [25]
assert out["again"] is True and out["againCalls"] == 1