Update tests/test_utils_reprate.py
Run CI Tests / test (push) Has been cancelled

This commit is contained in:
2025-08-12 19:26:07 +02:00
parent ace89a5985
commit 28242677bb
+5 -4
View File
@@ -21,11 +21,12 @@ def test_get_beamline(instrument, expected_beamline):
def test_get_pvname_reprate_for_inferred_beamline():
"""Test the PV name retrieval when using inferred beamline based on IP address."""
# Mock the socket to simulate an IP address
with patch("socket.gethostname", return_value="testhost"), patch("socket.gethostbyname", return_value="129.129.242"):
beamline = infer_beamline()
pvname = get_pvname_reprate(instrument=None, beamline=beamline)
assert pvname == "alvra"
beamline = infer_beamline() # This will return "alvra" based on the IP
pvname = get_pvname_reprate(instrument=None, beamline=beamline) # This should return the PV name associated with 'aramis'
expected_pvname = "SIN-TIMAST-TMA:Bunch-1-Exp-Freq-RB"
assert pvname == expected_pvname, f"Expected {expected_pvname}, but got {pvname}"
@pytest.mark.parametrize("ip,expected_instrument", [
("129.129.242", "alvra"),