File size: 1,630 Bytes
f40f952 | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 | """Phase 0 — tests de structure du dépôt.
Ces tests vérifient que le socle attendu existe. Ils échouent volontairement
tant que la structure n'est pas complète (approche TDD du cahier des charges).
"""
from pathlib import Path
ROOT = Path(__file__).resolve().parents[1]
EXPECTED_FILES = [
"README.md",
"LICENSE",
"CHANGELOG.md",
"pyproject.toml",
"requirements.txt",
"Dockerfile",
".env.example",
".gitignore",
"configs/model.yaml",
"docs/architecture.md",
"docs/decisions.md",
"docs/phases.md",
]
EXPECTED_DIRS = [
"src",
"src/tokenizer",
"src/model",
"src/data",
"src/train",
"src/memory",
"app",
"tests",
"notebooks",
]
def test_expected_files_exist():
missing = [f for f in EXPECTED_FILES if not (ROOT / f).is_file()]
assert not missing, f"Fichiers manquants : {missing}"
def test_expected_dirs_exist():
missing = [d for d in EXPECTED_DIRS if not (ROOT / d).is_dir()]
assert not missing, f"Dossiers manquants : {missing}"
def test_env_is_gitignored():
gitignore = (ROOT / ".gitignore").read_text(encoding="utf-8")
assert ".env" in gitignore, "`.env` doit être ignoré par git"
def test_readme_is_bilingual():
readme = (ROOT / "README.md").read_text(encoding="utf-8")
assert "🇫🇷" in readme and "🇬🇧" in readme, "README doit être bilingue FR/EN"
def test_readme_states_no_pretrained_model():
readme = (ROOT / "README.md").read_text(encoding="utf-8").lower()
assert "from scratch" in readme
assert "gpt-4v" in readme, "README doit assumer explicitement les limites"
|