362e089be0
Der Nutzer hat recht: Der Ordner war voller Entwicklungs-Muell. Jetzt ist sauber getrennt: ROOT (was der Nutzer sieht und braucht): - run.py = das Programm - hms_app/ = der Anwendungscode - HMS MediaEngine.app = macOS Doppelklick-Starter - HMS-Start.vbs = Windows Doppelklick-Starter - HMS-Install.vbs = Windows Erst-Installation - HMS-Mac-Install.command = macOS Homebrew-Installation - HMS-Portable-Install.command = macOS Portable-Installation (16GB-Fix) - installer_gui.py = grafischer Installer - launcher.pyw + launcher_core.py = interne Start-Logik - LIESMICH.txt = 10-Zeilen-Kurzanleitung - .gitignore _entwicklung/ (alles andere, NICHT benoetigt): - packages/ apps/ native/ plugins/ tools/ schemas/ tests/ docs/ build/ fixture_profiles/ - PLAN.md STATUS.md ERRORS.md TEST_REPORT.md CHANGELOG.md README.md - pyproject.toml uv.lock setup_*.sh/ps1 make_mac_app.py Diese Trennung gilt ab sofort fuer alle Commits. Der Nutzer kann _entwicklung/ loeschen wenn er Platz braucht - die App laeuft ohne. Verifiziert: App startet nach Aufraeumen unveraendert (Health 200).
53 lines
2.0 KiB
Python
53 lines
2.0 KiB
Python
"""Unit-Tests Capability-Probe (PLAN.md §5, §5.2).
|
|
|
|
Regel: kein Fake-Ergebnis (§33). Ein Report ohne GPU-Messung darf kein
|
|
DESKTOP-Tier vergeben; HEADLESS nur ohne Display.
|
|
"""
|
|
|
|
from __future__ import annotations
|
|
|
|
from hms_capabilities import CapabilityReport, CapabilityTier
|
|
|
|
|
|
def test_report_starts_with_unknown_tier_and_gpu() -> None:
|
|
report = CapabilityReport()
|
|
assert report.tier is None
|
|
assert report.gpu is None
|
|
d = report.as_dict()
|
|
assert d["tier"] is None # ungeprüft = ungeeignet für Gate-Aussagen
|
|
|
|
|
|
def test_full_gpu_with_8gb_vram_is_desktop_full() -> None:
|
|
report = CapabilityReport()
|
|
tier = report.conclude_tier(has_gpu=True, vram_gb=12.0, decode_ok=True, has_display=True)
|
|
assert tier is CapabilityTier.DESKTOP_FULL
|
|
|
|
|
|
def test_igpu_with_low_vram_is_desktop_lite() -> None:
|
|
report = CapabilityReport()
|
|
tier = report.conclude_tier(has_gpu=True, vram_gb=2.0, decode_ok=True, has_display=True)
|
|
assert tier is CapabilityTier.DESKTOP_LITE
|
|
|
|
|
|
def test_no_display_is_headless_control() -> None:
|
|
report = CapabilityReport()
|
|
tier = report.conclude_tier(has_gpu=False, vram_gb=None, decode_ok=False, has_display=False)
|
|
assert tier is CapabilityTier.HEADLESS_CONTROL
|
|
|
|
|
|
def test_unmeasured_gpu_yields_no_tier() -> None:
|
|
"""Ohne GPU-Messung darf kein DESKTOP-Tier vergeben werden (§33)."""
|
|
report = CapabilityReport()
|
|
tier = report.conclude_tier(has_gpu=True, vram_gb=None, decode_ok=True, has_display=True)
|
|
assert tier is CapabilityTier.DESKTOP_LITE
|
|
# Aber: ohne verifizierten Decode → None
|
|
tier = report.conclude_tier(has_gpu=True, vram_gb=None, decode_ok=False, has_display=True)
|
|
assert tier is None
|
|
|
|
|
|
def test_failed_decode_on_display_machine_is_none_not_lite() -> None:
|
|
"""Display vorhanden, aber Decode unbestätigt → kein stiller Lite-Status."""
|
|
report = CapabilityReport()
|
|
tier = report.conclude_tier(has_gpu=True, vram_gb=16.0, decode_ok=False, has_display=True)
|
|
assert tier is None
|