- B07~B09 · D · E · M01 · M02 페이지 CSS 에 날 흰 바탕 금지(E05 종이 미리보기만 예외) Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
44 lines
1.4 KiB
Python
44 lines
1.4 KiB
Python
"""556-2 나머지 페이지(B07~B09 · D · E · M01 · M02) 본문 — 페이지 CSS 가 흰 바탕을 날 색으로 박지 않음 · 그림 판은 제 색."""
|
|
|
|
import os
|
|
import re
|
|
from pathlib import Path
|
|
|
|
ROOT = Path(__file__).resolve().parents[2]
|
|
PAGES = (
|
|
"B07_DesignDetail",
|
|
"B08_Quantity",
|
|
"B09_Estimation",
|
|
"D01_PlanRegister",
|
|
"D02_PlanBase",
|
|
"D03_PlanAnalysis",
|
|
"D04_PlanConfirm",
|
|
"E01_StabRegister",
|
|
"E02_StabGround",
|
|
"E03_StabSection",
|
|
"E04_Stab3D",
|
|
"E05_StabReport",
|
|
"E06_StabRock",
|
|
"E07_StabArea",
|
|
"M01_MasterData",
|
|
"M02_MasterTemplete",
|
|
)
|
|
# 종이 미리보기(PDF 틀)는 인쇄 종이 흰색 그대로
|
|
PAPER = {"E05_StabReport/E05_StabReport_UI_Style.css"}
|
|
RAW_WHITE = re.compile(r"background(-color)?\s*:\s*(#fff(fff)?|white)\b", re.I)
|
|
|
|
|
|
def test_no_raw_white_background_in_page_css():
|
|
bad = []
|
|
for page in PAGES:
|
|
for base, dirs, files in os.walk(ROOT / page):
|
|
dirs[:] = [d for d in dirs if d not in ("node_modules", "dist", "build")]
|
|
for name in files:
|
|
if not name.endswith(".css"):
|
|
continue
|
|
path = Path(base) / name
|
|
rel = path.relative_to(ROOT).as_posix()
|
|
if rel not in PAPER and RAW_WHITE.search(path.read_text(encoding="utf-8")):
|
|
bad.append(rel)
|
|
assert not bad, f"날 흰 바탕: {bad}"
|