From b46ea839000da2d8c62df32fb4e1c4f8d2a460ef Mon Sep 17 00:00:00 2001 From: Domi31tls Date: Mon, 2 Mar 2026 21:54:55 +0100 Subject: [PATCH] =?UTF-8?q?test:=20V=C3=A9rifier=20que=20le=20GUI=20foncti?= =?UTF-8?q?onne=20apr=C3=A8s=20correction?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- test_gui_fixed.py | 46 ++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 46 insertions(+) create mode 100644 test_gui_fixed.py diff --git a/test_gui_fixed.py b/test_gui_fixed.py new file mode 100644 index 0000000..8034048 --- /dev/null +++ b/test_gui_fixed.py @@ -0,0 +1,46 @@ +#!/usr/bin/env python3 +"""Test rapide pour vérifier que le GUI peut anonymiser correctement.""" + +import sys +from pathlib import Path +sys.path.insert(0, str(Path(__file__).parent)) + +import anonymizer_core_refactored_onnx as core + +# Test avec un PDF simple +test_pdf = Path("/tmp/test_gui_pdfs") +if not test_pdf.exists(): + print("❌ Répertoire de test non trouvé:", test_pdf) + sys.exit(1) + +pdfs = list(test_pdf.glob("*.pdf")) +if not pdfs: + print("❌ Aucun PDF trouvé dans:", test_pdf) + sys.exit(1) + +pdf = pdfs[0] +print(f"Test avec: {pdf}") + +out_dir = Path("/tmp/test_gui_fixed") +out_dir.mkdir(exist_ok=True) + +try: + # Simuler l'appel du GUI (sans use_vlm) + outputs = core.process_pdf( + pdf_path=pdf, + out_dir=out_dir, + make_vector_redaction=False, + also_make_raster_burn=True, + config_path=Path("config/dictionnaires.yml"), + use_hf=False, + ner_manager=None, + ner_thresholds=None, + ogc_label=None, + vlm_manager=None, + ) + print(f"✅ Succès: {outputs}") +except Exception as e: + print(f"❌ Erreur: {e}") + import traceback + traceback.print_exc() + sys.exit(1)