From 8ec38db6d1a47f3b41886fcb5659d567c315cd6d Mon Sep 17 00:00:00 2001 From: king Date: Fri, 14 Aug 2026 16:14:40 +0900 Subject: [PATCH] =?UTF-8?q?revert(cafe24):=20=EC=9D=BC=EA=B4=84=EC=88=98?= =?UTF-8?q?=EC=A0=95=20=EA=B8=B0=EB=8A=A5=20=EC=A0=9C=EA=B1=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 사용자 결정에 따라 화면·라우트·로직·문서를 모두 제거했다. 제거 대상: routes_bulk.py (파일 삭제) templates/cafe24/bulk.html (파일 삭제) _nav.html 「일괄수정」 탭 router.py import·include·설명 store.py find_style_blocks / replace_first_style_block / 정규식 tests " - - -def _preview(html: str) -> dict[str, Any]: - """현재 ", re.IGNORECASE | re.DOTALL) - - -def find_style_blocks(html: str) -> list[str]: - """상세설명 안의 블록 전체(원문 그대로).""" - return _STYLE_BLOCK_RE.findall(html or "") - - -def replace_first_style_block(html: str, new_block: str) -> str: - """맨 앞 " - - -def test_find_style_blocks(): - html = "
x
" - blocks = store.find_style_blocks(html) - assert len(blocks) == 2 - assert blocks[0] == "" - - -def test_replace_first_style_block_only(): - """두 번째 이후
x
" - out = store.replace_first_style_block(html, _NEW_STYLE) - assert "OLD" not in out - assert "" in out - assert out.startswith(_NEW_STYLE) - assert "
x
" in out - - -def test_replace_style_inserts_when_missing(): - out = store.replace_first_style_block("
x
", _NEW_STYLE) - assert out.startswith(_NEW_STYLE) - assert "
x
" in out - - -def test_replace_style_is_idempotent(): - once = store.replace_first_style_block("
x
", _NEW_STYLE) - assert store.replace_first_style_block(once, _NEW_STYLE) == once - - -def test_replace_style_survives_formatting(): - """정리(포맷)를 거쳐도
x
", _NEW_STYLE) - ) - assert "\tdiv {" in formatted - assert "\t\ttext-align: center;" in formatted - assert len(store.find_style_blocks(formatted)) == 1 - - -def test_replace_style_keeps_multiline_original_shape(): - """원문이 여러 줄이어도 앞 블록만 정확히 잘라낸다.""" - html = '\n' - out = store.replace_first_style_block(html, _NEW_STYLE) - assert "비디오" not in out - assert '' in out - - -def test_fingerprint_detects_change(): - a = store.fingerprint("

A

") - assert a == store.fingerprint("

A

") - assert a != store.fingerprint("

B

") - assert len(a) == 32 - - # ════════════════════════════════════════════════════════════ # 예약 — 입력 검증 # ════════════════════════════════════════════════════════════ @@ -628,10 +569,14 @@ def test_parse_schedule_at_rejects_past_and_garbage(): def test_parse_schedule_at_allows_one_minute_grace(): - """폼을 채우는 동안 시간이 흐른 경우를 거부하지 않는다.""" - base = now_kst() - just_now = (base - timedelta(seconds=30)).strftime("%Y-%m-%dT%H:%M") - assert store.parse_schedule_at(just_now, now=base) is not None + """`datetime-local` 은 초를 버린다 — 지금 이 분(分)을 고른 것을 거부하면 안 된다. + + now 의 초를 고정해 실행 시각에 따라 결과가 달라지지 않게 한다(예전에 이 테스트가 + 초에 따라 실패했다). + """ + base = now_kst().replace(second=40, microsecond=0) + this_minute = base.strftime("%Y-%m-%dT%H:%M") # 초가 잘려 base 보다 40초 과거 + assert store.parse_schedule_at(this_minute, now=base) is not None def test_describe_schedule_action(): diff --git a/docs/CAFE24_MODULE.md b/docs/CAFE24_MODULE.md index 2b56a7f..59f4f6a 100644 --- a/docs/CAFE24_MODULE.md +++ b/docs/CAFE24_MODULE.md @@ -26,7 +26,6 @@ app/integrations/cafe24/ ← 공통 (상품관리 + 향후 주문관리 app/modules/cafe24/ ← 상품관리 모듈 ├─ router.py 루트 라우터(prefix=/cafe24) + 서브 라우터 결합 ├─ routes_products.py 2분할 화면 · 편집기 조각 · 적용(쓰기) -├─ routes_bulk.py 일괄수정 (검사 → 선택 적용) ├─ routes_schedules.py 예약 등록·목록·취소 ├─ worker.py 예약 실행기 (compose 서비스 dbx-cafe24-worker) ├─ routes_system.py 연결(OAuth)·상태·API 로그·작업 로그 @@ -35,7 +34,7 @@ app/modules/cafe24/ ← 상품관리 모듈 ├─ store.py 순수 로직 — 상수·상태전이·재시도 규칙·검증 ├─ tests/ DB/네트워크 없는 유닛테스트 └─ templates/cafe24/ _nav.html · products.html(2분할) · - _editor.html(오른쪽 조각) · bulk.html · + _editor.html(오른쪽 조각) · schedules.html · system.html ``` @@ -56,9 +55,6 @@ app/modules/cafe24/ ← 상품관리 모듈 | `GET /cafe24/products/{product_no}/pane` | 오른쪽 편집기 조각 (JS 가 가져감) | `cafe24` | | `GET /cafe24/products/{product_no}` | → `/cafe24/?selected=` 로 리다이렉트(옛 주소) | `cafe24` | | `POST /cafe24/products/{product_no}/apply` | 편집한 HTML 을 카페24에 즉시 적용 | `cafe24` | -| `GET /cafe24/bulk` | 일괄수정 화면 (`