"""Smoke tests for the Hebrew Flash Cards project.""" import sys from pathlib import Path # Ensure project root is on path sys.path.insert(0, str(Path(__file__).resolve().parent.parent)) def test_helpers_strip_nikkud(): from helpers import strip_nikkud assert strip_nikkud("שָׁלוֹם") == "שלום" assert strip_nikkud("hello") == "hello" assert strip_nikkud("") == "" def test_apkg_builder_imports(): import apkg_builder assert hasattr(apkg_builder, "build_vocab_deck") assert hasattr(apkg_builder, "build_conj_deck") assert apkg_builder.VOCAB_MODEL_ID == 1_701_222_017_968 def test_data_files_exist(): data_dir = Path(__file__).resolve().parent.parent / "data" assert (data_dir / "hebrew_dict_for_anki.csv").exists(), "vocab CSV missing" assert (data_dir / "conjugations.json").exists(), "conjugations cache missing" def test_strip_nikkud_idempotent(): from helpers import strip_nikkud plain = "שלום" assert strip_nikkud(plain) == plain def test_strip_nikkud_all_marks(): from helpers import strip_nikkud # Comprehensive: patach, kamatz, segol, tsere, hiriq, holam, kubutz, shva, dagesh nikkud = "הַמַּלְכָּה" plain = strip_nikkud(nikkud) assert all(ch < "\u0591" or ch > "\u05C7" for ch in plain), f"Residual nikkud in: {plain}"