- M02_Library_Same_Router — 733-1a 지문(Same 한 벌 · above) 으로 묶음 · 합칠 때 지문 다시 셈(다르면 409) - main.py 에 라우터 등록(로그인만 · 층 쓰기 권한은 길 안에서) - 새 시험 test_733_3_library_same_merge(합치기 참조 옮김 · 금액 같음 · 되돌림 · 지문 · 판 409 · 권한 밖 남김 · 위 층 키 · 일반 사용자 회사 층 403 · SC 수량만 다름) - 새 시험 test_733_3_library_same_screen(부품만 · 날 색 없음 · 나무 메뉴 · 서버 길 짝) Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
33 lines
1.6 KiB
Python
33 lines
1.6 KiB
Python
"""서고 [중복 찾기] 화면 지킴(PLAN 733-3) — 부품 상자만 · 날 색 없음 · 나무 메뉴 · 서버 길 짝."""
|
|
|
|
import re
|
|
from pathlib import Path
|
|
|
|
ROOT = Path(__file__).resolve().parents[2]
|
|
M02 = ROOT / "M02_MasterTemplete"
|
|
TS = (M02 / "M02_MasterTemplete_Library_Same.ts").read_text(encoding="utf-8")
|
|
CSS = (M02 / "M02_MasterTemplete_Library_Same.css").read_text(encoding="utf-8")
|
|
RAW_COLOR = re.compile(r"#[0-9a-fA-F]{3,8}\b|\brgba?\(|\bhsla?\(")
|
|
|
|
|
|
def test_부품만_씀():
|
|
for part in ("openModal", "askConfirm", "createTable", "createButton", "createBadge"):
|
|
assert part in TS, f"부품 {part} 를 안 씀"
|
|
assert "<button" not in TS and "<input" not in TS
|
|
assert not re.search(r"""createElement\(["'](button|input|table)""", TS)
|
|
assert not RAW_COLOR.search(CSS)
|
|
for sel in (".ui-btn", ".ui-table", ".ui-badge", "button", "table", "th", "td"):
|
|
assert not re.search(rf"(^|[\s,]){re.escape(sel)}\b", CSS), f"CSS 가 {sel} 꼴을 만짐"
|
|
|
|
|
|
def test_나무_메뉴_서버_길_짝():
|
|
side = (M02 / "M02_MasterTemplete_UI_Side_Library.ts").read_text(encoding="utf-8")
|
|
assert "openLibrarySame" in side and "sameLabel()" in side
|
|
router = (M02 / "M02_Library_Same_Router.py").read_text(encoding="utf-8")
|
|
for tail in ("", "/merge", "/undo"):
|
|
assert f'"/layers/{{layer}}/{{kind}}-same{tail}"' in router
|
|
assert "`/layers/${layer}/${kind}-same${tail}" in TS
|
|
assert '"/merge"' in TS and '"/undo"' in TS
|
|
main = (ROOT / "main.py").read_text(encoding="utf-8")
|
|
assert "M02_MasterTemplete.M02_Library_Same_Router" in main
|