fix(gui): clarifier aide et disponibilite moteurs

Passe theme clair, libelles utilisateur, aides conteneurs, recherche de mise a jour et indication honnete des moteurs optionnels non embarques. Tests GUI unitaires: 126 passed.
This commit is contained in:
2026-06-17 18:01:25 +02:00
parent d18ca919fa
commit 60fb41c2e7
11 changed files with 296 additions and 44 deletions

View File

@@ -28,9 +28,11 @@ class FakeResponse:
class FakeSession:
"""Session HTTP mockable : enregistre les appels, renvoie des réponses scriptées."""
def __init__(self, response=None, exc=None):
def __init__(self, response=None, exc=None, get_response=None, get_exc=None):
self._response = response
self._exc = exc
self._get_response = response if get_response is None else get_response
self._get_exc = exc if get_exc is None else get_exc
self.calls = []
def post(self, url, json, timeout):
@@ -39,6 +41,12 @@ class FakeSession:
raise self._exc
return self._response
def get(self, url, timeout):
self.calls.append({"url": url, "timeout": timeout})
if self._get_exc is not None:
raise self._get_exc
return self._get_response
def _client(tmp_path, session):
store = LicenseStore(tmp_path / "license.json")
@@ -173,6 +181,29 @@ def test_local_status_reads_store(tmp_path):
assert status.license_ref == "LIC-7"
def test_latest_version_reads_active_artifact(tmp_path):
payload = {
"version": "v11.0-beta",
"channel": "beta",
"filename": "Anonymisation-Setup.exe",
}
session = FakeSession(get_response=FakeResponse(200, payload))
client, _ = _client(tmp_path, session)
version = client.latest_version()
assert version == payload
assert session.calls[0]["url"] == "https://portail.example/api/v1/version"
def test_latest_version_unavailable_on_404_or_network_error(tmp_path):
client_404, _ = _client(tmp_path, FakeSession(get_response=FakeResponse(404, {"detail": "No active version"})))
assert client_404.latest_version() is None
client_down, _ = _client(tmp_path, FakeSession(get_exc=TimeoutError("timeout")))
assert client_down.latest_version() is None
def test_status_never_exposes_token():
# Le statut ne porte pas de token : la repr ne peut pas le fuiter.
status = LicenseStatus.from_payload({"status": "active", "license_ref": "LIC-1"})