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
|