fix: type disque SATA + df timeout Proxmox

- disk_type : rota booléen (False/True) en plus des int (0/1) — lsblk récent
- df --local : évite le timeout sur montages réseau/NFS (Proxmox)
- 6 nouveaux tests disk_type

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
Gilles Soulier
2026-05-28 20:50:19 +02:00
parent 29a63be483
commit 325b5dc281
2 changed files with 26 additions and 3 deletions
+21
View File
@@ -103,6 +103,27 @@ def test_bytes_human_none():
assert inventaire.bytes_human(None) == "?"
# -- disk_type ----------------------------------------------------------------
def test_disk_type_nvme():
assert inventaire.disk_type("nvme0n1", None) == "NVMe"
def test_disk_type_hdd_int():
assert inventaire.disk_type("sda", 1) == "HDD"
def test_disk_type_ssd_int():
assert inventaire.disk_type("sdb", 0) == "SSD"
def test_disk_type_hdd_bool():
assert inventaire.disk_type("sda", True) == "HDD"
def test_disk_type_ssd_bool():
assert inventaire.disk_type("sdb", False) == "SSD"
def test_disk_type_inconnu():
assert inventaire.disk_type("sdc", None) == "inconnu"
# ── get_smart ─────────────────────────────────────────────────────────────────
SMART_PASSED = """