This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user