Files
rpa_vision_v3/tests/unit/test_window_context_exports.py
Dom a27b74cf22 v1.0 - Version stable: multi-PC, détection UI-DETR-1, 3 modes exécution
- Frontend v4 accessible sur réseau local (192.168.1.40)
- Ports ouverts: 3002 (frontend), 5001 (backend), 5004 (dashboard)
- Ollama GPU fonctionnel
- Self-healing interactif
- Dashboard confiance

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-29 11:23:51 +01:00

41 lines
1.3 KiB
Python

"""
Tests de validation - Fiche #1 : Exports WindowContext sans collision
Auteur: Dom, Alice Kiro - 15 décembre 2024
"""
import pytest
from core.models import RawWindowContext, WindowContext, ScreenWindowContext
def test_window_context_no_collision():
"""Test que les imports WindowContext ne sont plus ambigus"""
# WindowContext doit pointer vers RawWindowContext (compatibilité layer 0)
assert WindowContext is RawWindowContext
# ScreenWindowContext doit être distinct (layer 1)
assert ScreenWindowContext is not WindowContext
# Vérifier qu'on peut créer les deux types
raw_ctx = RawWindowContext(title="Test", app_name="TestApp")
screen_ctx = ScreenWindowContext(
app_name="TestApp",
window_title="Test",
screen_resolution=[1920, 1080]
)
assert raw_ctx.title == "Test"
assert screen_ctx.window_title == "Test"
def test_backward_compatibility():
"""Test que l'alias WindowContext fonctionne pour le code legacy"""
# Le code legacy qui faisait from core.models import WindowContext
# doit continuer à fonctionner
ctx = WindowContext(title="Legacy", app_name="LegacyApp")
assert ctx.title == "Legacy"
assert ctx.app_name == "LegacyApp"
if __name__ == "__main__":
pytest.main([__file__, "-v"])