Update tests/test_utils_pvpreload.py
Run CI Tests / test (push) Successful in 1m9s

This commit is contained in:
2025-08-07 20:59:38 +02:00
parent 6764d930af
commit d259c0369c
+3 -3
View File
@@ -1,7 +1,7 @@
import pytest
import time
import threading
import pickle
import pickle as std_pickle
from pathlib import Path
from slic.utils.picklio import unpickle
@@ -68,7 +68,7 @@ def test_preload_fichier_valide(tmp_path, caplog):
# Crée un fichier pickle avec les noms de PV
with open(f, "wb") as pkl:
pickle.dump([pvname_1, pvname_2], pkl)
std_pickle.dump([pvname_1, pvname_2], pkl)
# Vérifie que les PV ne sont pas encore dans le cache EPICS
assert not is_pv_in_cache(pvname_1)
@@ -100,7 +100,7 @@ def test_preload_fichier_trop_vieux(tmp_path, caplog):
# Crée un fichier pickle valide avec un nom de PV
with open(f, "wb") as pkl:
pickle.dump([pvname], pkl)
std_pickle.dump([pvname], pkl)
# Vieillit artificiellement le fichier (par exemple 2h d'ancienneté)
old_time = datetime.timestamp(datetime.now() - 2 * lifetime)