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

This commit is contained in:
2025-08-07 21:27:30 +02:00
parent 174fb58c66
commit 7b41c2e596
+8 -2
View File
@@ -38,6 +38,12 @@ def epics_ioc():
def is_pv_in_cache(name):
return any(k[0] == name for k in epics.pv._PVcache_)
def get_pv_from_cache(pvname):
for k, pv in _PVcache_.items():
if hasattr(pv, "pvname") and pv.pvname == pvname:
return pv
return None
# Tests
# file_age()
@@ -85,8 +91,8 @@ def test_preload_fichier_valide(tmp_path, caplog):
assert is_pv_in_cache(pvname_1)
assert is_pv_in_cache(pvname_2)
pv_1 = _PVcache_[pvname_1]
pv_2 = _PVcache_[pvname_2]
pv_1 = get_pv_from_cache(pvname_1)
pv_2 = get_pv_from_cache(pvname_2)
assert not pv_1.connected
assert not pv_2.connected