Files
webmail-client/backend/tests/sync/test_folder_names.py
T
lukasandClaude Opus 4.8 a5ec0d21cb Initial commit: webmail client (M0/M1)
Three-pane webmail client.
- Backend: FastAPI + async SQLAlchemy + arq worker (Postgres/Redis), IMAP/SMTP
  sync, threading, search, drafts/outbox with undo, attachments, 2FA.
- Frontend: React 18 + Vite + TypeScript + TanStack Query + Tailwind; three-pane
  UI with rich-text composer, light/dark themes, resizable panels.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-07-17 23:20:34 +02:00

35 lines
930 B
Python

"""Folder-name special-use heuristics (SPEC §6.3)."""
from __future__ import annotations
import pytest
from app.sync.folder_names import infer_special_use
@pytest.mark.parametrize(
"path,expected",
[
("INBOX", "inbox"),
("inbox", "inbox"),
("Sent", "sent"),
("Wysłane", "sent"), # Polish
("Elementy wysłane", "sent"),
("Gesendet", "sent"), # German
("Drafts", "drafts"),
("Robocze", "drafts"),
("Trash", "trash"),
("Kosz", "trash"), # Polish
("Papierkorb", "trash"), # German
("Spam", "junk"),
("Junk", "junk"),
("Archive", "archive"),
("Archiwum", "archive"),
("INBOX/Sent", "sent"), # nested leaf
("Work", None),
("Random Folder", None),
],
)
def test_infer_special_use(path: str, expected: str | None) -> None:
assert infer_special_use(path) == expected