diff --git a/tests/fixtures/mocked_panda.py b/tests/fixtures/mocked_panda.py index 07c24801..21d93b6a 100644 --- a/tests/fixtures/mocked_panda.py +++ b/tests/fixtures/mocked_panda.py @@ -406,12 +406,12 @@ def standard_responses(table_field_info, table_data_1, table_data_2): ), } ), - command_to_key(Put(field="PCAP1.TRIG_EDGE", value="Falling")): repeat("OK"), + command_to_key(Put(field="PCAP.TRIG_EDGE", value="Falling")): repeat("OK"), command_to_key(Arm()): repeat("OK"), command_to_key(Disarm()): repeat("OK"), command_to_key( Put( - field="SEQ1.TABLE", + field="SEQ.TABLE", value=[ "2457862145", "4294967291", @@ -438,7 +438,7 @@ def standard_responses(table_field_info, table_data_1, table_data_2): ): repeat(None), command_to_key( Put( - field="SEQ1.TABLE", + field="SEQ.TABLE", value=[ "2457862145", "4294967291", @@ -467,7 +467,7 @@ def standard_responses(table_field_info, table_data_1, table_data_2): }, ), # DRVL changing from 8e-06 ms to minutes - command_to_key(GetLine(field="PULSE1.DELAY.MIN")): chain( + command_to_key(GetLine(field="PULSE.DELAY.MIN")): chain( ["8e-09"], repeat("1.333333333e-10") ), command_to_key(GetFieldInfo(block="SEQ", extended_metadata=True)): repeat( @@ -490,12 +490,12 @@ def standard_responses(table_field_info, table_data_1, table_data_2): "PCAP.GATE": "CLOCK1.OUT", "PCAP.GATE.DELAY": "1", "PCAP.ARM": "0", - "*METADATA.LABEL_PCAP1": "PcapMetadataLabel", + "*METADATA.LABEL_PCAP": "PcapMetadataLabel", "PULSE.DELAY": "100", - "PULSE1.DELAY.UNITS": "ms", - "PULSE1.DELAY.MIN": "8e-06", + "PULSE.DELAY.UNITS": "ms", + "PULSE.DELAY.MIN": "8e-06", }, - multiline_values={"SEQ1.TABLE": table_data_1}, + multiline_values={"SEQ.TABLE": table_data_1}, ), # 0.5 seconds of no changes in case the ioc setup completes # before the test starts @@ -503,9 +503,9 @@ def standard_responses(table_field_info, table_data_1, table_data_2): changes_iterator_wrapper( values={ "PCAP.TRIG_EDGE": "Either", - "PULSE1.DELAY.UNITS": "s", + "PULSE.DELAY.UNITS": "s", }, - multiline_values={"SEQ1.TABLE": table_data_2}, + multiline_values={"SEQ.TABLE": table_data_2}, ), # Keep the panda active with no changes until pytest tears it down respond_with_no_changes(), diff --git a/tests/test-bobfiles/PCAP.bob b/tests/test-bobfiles/PCAP.bob new file mode 100644 index 00000000..c03a5d03 --- /dev/null +++ b/tests/test-bobfiles/PCAP.bob @@ -0,0 +1,115 @@ + + Display + 0 + 0 + 408 + 202 + 4 + 4 + + Title + TITLE + PCAP - TEST-PREFIX: + 0 + 0 + 408 + 25 + + + + + + + + + true + 1 + + + Label + PCAP: LABEL + 23 + 30 + 250 + 20 + + + TextUpdate + TEST-PREFIX:PCAP:LABEL + 278 + 30 + 125 + 20 + + + + + 1 + + + PARAMETERS + 5 + 55 + 351 + 56 + true + + Label + PCAP: TRIG_ EDGE + 0 + 0 + 250 + 20 + + + ComboBox + TEST-PREFIX:PCAP:TRIG_EDGE + 255 + 0 + 60 + 20 + + + + INPUTS + 5 + 116 + 351 + 81 + true + + Label + PCAP: GATE + 0 + 0 + 250 + 20 + + + TextEntry + TEST-PREFIX:PCAP:GATE + 255 + 0 + 60 + 20 + 1 + + + Label + PCAP: GATE: DELAY + 0 + 25 + 250 + 20 + + + TextEntry + TEST-PREFIX:PCAP:GATE:DELAY + 255 + 25 + 60 + 20 + 1 + + + diff --git a/tests/test-bobfiles/PCAP1.bob b/tests/test-bobfiles/PCAP1.bob deleted file mode 100644 index ff9fbda9..00000000 --- a/tests/test-bobfiles/PCAP1.bob +++ /dev/null @@ -1,111 +0,0 @@ - - Display - 0 - 0 - 426 - 202 - - Title - TITLE - PCAP1 - TEST-PREFIX: - 0 - 0 - 426 - 25 - - - - - true - 1 - - - Label - PCAP1: LABEL - 23 - 30 - 250 - 20 - - - TextUpdate - TEST-PREFIX:PCAP1:LABEL - 278 - 30 - 125 - 20 - - - - - 1 - - - PARAMETERS - 5 - 55 - 416 - 56 - true - - Label - PCAP1: TRIG_ EDGE - 0 - 0 - 250 - 20 - - - ComboBox - TEST-PREFIX:PCAP1:TRIG_EDGE - 255 - 0 - 125 - 20 - - - - INPUTS - 5 - 116 - 416 - 81 - true - - Label - PCAP1: GATE - 0 - 0 - 250 - 20 - - - TextEntry - TEST-PREFIX:PCAP1:GATE - 255 - 0 - 125 - 20 - 1 - - - Label - PCAP1: GATE: DELAY - 0 - 25 - 250 - 20 - - - TextEntry - TEST-PREFIX:PCAP1:GATE:DELAY - 255 - 25 - 125 - 20 - 1 - - - 4 - 4 - diff --git a/tests/test-bobfiles/PULSE.bob b/tests/test-bobfiles/PULSE.bob new file mode 100644 index 00000000..9c7d46c8 --- /dev/null +++ b/tests/test-bobfiles/PULSE.bob @@ -0,0 +1,69 @@ + + Display + 0 + 0 + 361 + 116 + 4 + 4 + + Title + TITLE + PULSE - TEST-PREFIX: + 0 + 0 + 361 + 25 + + + + + + + + + true + 1 + + + PARAMETERS + 5 + 30 + 351 + 81 + true + + Label + PULSE: DELAY + 0 + 0 + 250 + 20 + + + TextEntry + TEST-PREFIX:PULSE:DELAY + 255 + 0 + 60 + 20 + 1 + + + Label + PULSE: DELAY: UNITS + 0 + 25 + 250 + 20 + + + ComboBox + TEST-PREFIX:PULSE:DELAY:UNITS + 255 + 25 + 60 + 20 + + + diff --git a/tests/test-bobfiles/PULSE1.bob b/tests/test-bobfiles/PULSE1.bob deleted file mode 100644 index cac3923a..00000000 --- a/tests/test-bobfiles/PULSE1.bob +++ /dev/null @@ -1,65 +0,0 @@ - - Display - 0 - 0 - 426 - 116 - - Title - TITLE - PULSE1 - TEST-PREFIX: - 0 - 0 - 426 - 25 - - - - - true - 1 - - - PARAMETERS - 5 - 30 - 416 - 81 - true - - Label - PULSE1: DELAY - 0 - 0 - 250 - 20 - - - TextEntry - TEST-PREFIX:PULSE1:DELAY - 255 - 0 - 125 - 20 - 1 - - - Label - PULSE1: DELAY: UNITS - 0 - 25 - 250 - 20 - - - ComboBox - TEST-PREFIX:PULSE1:DELAY:UNITS - 255 - 25 - 125 - 20 - - - 4 - 4 - diff --git a/tests/test-bobfiles/PandA.bob b/tests/test-bobfiles/PandA.bob index 0c30b614..28f53fab 100644 --- a/tests/test-bobfiles/PandA.bob +++ b/tests/test-bobfiles/PandA.bob @@ -2,31 +2,27 @@ Display 0 0 - 46 - 71 + 10 + 35 + 4 + 4 Title TITLE PandA - TEST-PREFIX: 0 0 - 46 + 10 25 + + + + true 1 - - POSITIONS_ TABLE - 5 - 30 - 36 - 36 - true - - 4 - 4 - + diff --git a/tests/test-bobfiles/SEQ.bob b/tests/test-bobfiles/SEQ.bob new file mode 100644 index 00000000..656f7cfa --- /dev/null +++ b/tests/test-bobfiles/SEQ.bob @@ -0,0 +1,366 @@ + + Display + 0 + 0 + 361 + 746 + 4 + 4 + + Title + TITLE + SEQ - TEST-PREFIX: + 0 + 0 + 361 + 25 + + + + + + + + + true + 1 + + + PARAMETERS + 5 + 30 + 351 + 711 + true + + Table + pva://TEST-PREFIX:SEQ:TABLE + 0 + 0 + -2 + 200 + + + Label + SEQ: TABLE: REPEATS: SCALAR + 0 + 205 + 250 + 20 + + + TextEntry + TEST-PREFIX:SEQ:TABLE:REPEATS:SCALAR + 255 + 205 + 60 + 20 + 1 + + + Label + SEQ: TABLE: TRIGGER: SCALAR + 0 + 230 + 250 + 20 + + + TextEntry + TEST-PREFIX:SEQ:TABLE:TRIGGER:SCALAR + 255 + 230 + 60 + 20 + 1 + + + Label + SEQ: TABLE: POSITION: SCALAR + 0 + 255 + 250 + 20 + + + TextEntry + TEST-PREFIX:SEQ:TABLE:POSITION:SCALAR + 255 + 255 + 60 + 20 + 1 + + + Label + SEQ: TABLE: TIME1: SCALAR + 0 + 280 + 250 + 20 + + + TextEntry + TEST-PREFIX:SEQ:TABLE:TIME1:SCALAR + 255 + 280 + 60 + 20 + 1 + + + Label + SEQ: TABLE: OUTA1: SCALAR + 0 + 305 + 250 + 20 + + + TextEntry + TEST-PREFIX:SEQ:TABLE:OUTA1:SCALAR + 255 + 305 + 60 + 20 + 1 + + + Label + SEQ: TABLE: OUTB1: SCALAR + 0 + 330 + 250 + 20 + + + TextEntry + TEST-PREFIX:SEQ:TABLE:OUTB1:SCALAR + 255 + 330 + 60 + 20 + 1 + + + Label + SEQ: TABLE: OUTC1: SCALAR + 0 + 355 + 250 + 20 + + + TextEntry + TEST-PREFIX:SEQ:TABLE:OUTC1:SCALAR + 255 + 355 + 60 + 20 + 1 + + + Label + SEQ: TABLE: OUTD1: SCALAR + 0 + 380 + 250 + 20 + + + TextEntry + TEST-PREFIX:SEQ:TABLE:OUTD1:SCALAR + 255 + 380 + 60 + 20 + 1 + + + Label + SEQ: TABLE: OUTE1: SCALAR + 0 + 405 + 250 + 20 + + + TextEntry + TEST-PREFIX:SEQ:TABLE:OUTE1:SCALAR + 255 + 405 + 60 + 20 + 1 + + + Label + SEQ: TABLE: OUTF1: SCALAR + 0 + 430 + 250 + 20 + + + TextEntry + TEST-PREFIX:SEQ:TABLE:OUTF1:SCALAR + 255 + 430 + 60 + 20 + 1 + + + Label + SEQ: TABLE: TIME2: SCALAR + 0 + 455 + 250 + 20 + + + TextEntry + TEST-PREFIX:SEQ:TABLE:TIME2:SCALAR + 255 + 455 + 60 + 20 + 1 + + + Label + SEQ: TABLE: OUTA2: SCALAR + 0 + 480 + 250 + 20 + + + TextEntry + TEST-PREFIX:SEQ:TABLE:OUTA2:SCALAR + 255 + 480 + 60 + 20 + 1 + + + Label + SEQ: TABLE: OUTB2: SCALAR + 0 + 505 + 250 + 20 + + + TextEntry + TEST-PREFIX:SEQ:TABLE:OUTB2:SCALAR + 255 + 505 + 60 + 20 + 1 + + + Label + SEQ: TABLE: OUTC2: SCALAR + 0 + 530 + 250 + 20 + + + TextEntry + TEST-PREFIX:SEQ:TABLE:OUTC2:SCALAR + 255 + 530 + 60 + 20 + 1 + + + Label + SEQ: TABLE: OUTD2: SCALAR + 0 + 555 + 250 + 20 + + + TextEntry + TEST-PREFIX:SEQ:TABLE:OUTD2:SCALAR + 255 + 555 + 60 + 20 + 1 + + + Label + SEQ: TABLE: OUTE2: SCALAR + 0 + 580 + 250 + 20 + + + TextEntry + TEST-PREFIX:SEQ:TABLE:OUTE2:SCALAR + 255 + 580 + 60 + 20 + 1 + + + Label + SEQ: TABLE: OUTF2: SCALAR + 0 + 605 + 250 + 20 + + + TextEntry + TEST-PREFIX:SEQ:TABLE:OUTF2:SCALAR + 255 + 605 + 60 + 20 + 1 + + + Label + SEQ: TABLE: MODE + 0 + 630 + 250 + 20 + + + ComboBox + TEST-PREFIX:SEQ:TABLE:MODE + 255 + 630 + 60 + 20 + + + Label + SEQ: TABLE: INDEX + 0 + 655 + 250 + 20 + + + TextEntry + TEST-PREFIX:SEQ:TABLE:INDEX + 255 + 655 + 60 + 20 + 1 + + + diff --git a/tests/test-bobfiles/SEQ1.bob b/tests/test-bobfiles/SEQ1.bob deleted file mode 100644 index 81369112..00000000 --- a/tests/test-bobfiles/SEQ1.bob +++ /dev/null @@ -1,354 +0,0 @@ - - Display - 0 - 0 - 426 - 541 - - Title - TITLE - SEQ1 - TEST-PREFIX: - 0 - 0 - 426 - 25 - - - - - true - 1 - - - PARAMETERS - 5 - 30 - 416 - 506 - true - - Label - SEQ1: TABLE: REPEATS: SCALAR - 0 - 0 - 250 - 20 - - - TextEntry - TEST-PREFIX:SEQ1:TABLE:REPEATS:SCALAR - 255 - 0 - 125 - 20 - 1 - - - Label - SEQ1: TABLE: TRIGGER: SCALAR - 0 - 25 - 250 - 20 - - - TextEntry - TEST-PREFIX:SEQ1:TABLE:TRIGGER:SCALAR - 255 - 25 - 125 - 20 - 1 - - - Label - SEQ1: TABLE: POSITION: SCALAR - 0 - 50 - 250 - 20 - - - TextEntry - TEST-PREFIX:SEQ1:TABLE:POSITION:SCALAR - 255 - 50 - 125 - 20 - 1 - - - Label - SEQ1: TABLE: TIME1: SCALAR - 0 - 75 - 250 - 20 - - - TextEntry - TEST-PREFIX:SEQ1:TABLE:TIME1:SCALAR - 255 - 75 - 125 - 20 - 1 - - - Label - SEQ1: TABLE: OUTA1: SCALAR - 0 - 100 - 250 - 20 - - - TextEntry - TEST-PREFIX:SEQ1:TABLE:OUTA1:SCALAR - 255 - 100 - 125 - 20 - 1 - - - Label - SEQ1: TABLE: OUTB1: SCALAR - 0 - 125 - 250 - 20 - - - TextEntry - TEST-PREFIX:SEQ1:TABLE:OUTB1:SCALAR - 255 - 125 - 125 - 20 - 1 - - - Label - SEQ1: TABLE: OUTC1: SCALAR - 0 - 150 - 250 - 20 - - - TextEntry - TEST-PREFIX:SEQ1:TABLE:OUTC1:SCALAR - 255 - 150 - 125 - 20 - 1 - - - Label - SEQ1: TABLE: OUTD1: SCALAR - 0 - 175 - 250 - 20 - - - TextEntry - TEST-PREFIX:SEQ1:TABLE:OUTD1:SCALAR - 255 - 175 - 125 - 20 - 1 - - - Label - SEQ1: TABLE: OUTE1: SCALAR - 0 - 200 - 250 - 20 - - - TextEntry - TEST-PREFIX:SEQ1:TABLE:OUTE1:SCALAR - 255 - 200 - 125 - 20 - 1 - - - Label - SEQ1: TABLE: OUTF1: SCALAR - 0 - 225 - 250 - 20 - - - TextEntry - TEST-PREFIX:SEQ1:TABLE:OUTF1:SCALAR - 255 - 225 - 125 - 20 - 1 - - - Label - SEQ1: TABLE: TIME2: SCALAR - 0 - 250 - 250 - 20 - - - TextEntry - TEST-PREFIX:SEQ1:TABLE:TIME2:SCALAR - 255 - 250 - 125 - 20 - 1 - - - Label - SEQ1: TABLE: OUTA2: SCALAR - 0 - 275 - 250 - 20 - - - TextEntry - TEST-PREFIX:SEQ1:TABLE:OUTA2:SCALAR - 255 - 275 - 125 - 20 - 1 - - - Label - SEQ1: TABLE: OUTB2: SCALAR - 0 - 300 - 250 - 20 - - - TextEntry - TEST-PREFIX:SEQ1:TABLE:OUTB2:SCALAR - 255 - 300 - 125 - 20 - 1 - - - Label - SEQ1: TABLE: OUTC2: SCALAR - 0 - 325 - 250 - 20 - - - TextEntry - TEST-PREFIX:SEQ1:TABLE:OUTC2:SCALAR - 255 - 325 - 125 - 20 - 1 - - - Label - SEQ1: TABLE: OUTD2: SCALAR - 0 - 350 - 250 - 20 - - - TextEntry - TEST-PREFIX:SEQ1:TABLE:OUTD2:SCALAR - 255 - 350 - 125 - 20 - 1 - - - Label - SEQ1: TABLE: OUTE2: SCALAR - 0 - 375 - 250 - 20 - - - TextEntry - TEST-PREFIX:SEQ1:TABLE:OUTE2:SCALAR - 255 - 375 - 125 - 20 - 1 - - - Label - SEQ1: TABLE: OUTF2: SCALAR - 0 - 400 - 250 - 20 - - - TextEntry - TEST-PREFIX:SEQ1:TABLE:OUTF2:SCALAR - 255 - 400 - 125 - 20 - 1 - - - Label - SEQ1: TABLE: MODE - 0 - 425 - 250 - 20 - - - ComboBox - TEST-PREFIX:SEQ1:TABLE:MODE - 255 - 425 - 125 - 20 - - - Label - SEQ1: TABLE: INDEX - 0 - 450 - 250 - 20 - - - TextEntry - TEST-PREFIX:SEQ1:TABLE:INDEX - 255 - 450 - 125 - 20 - 1 - - - 4 - 4 - diff --git a/tests/test-bobfiles/TOP.bob b/tests/test-bobfiles/TOP.bob index e50dfe79..5b36375d 100644 --- a/tests/test-bobfiles/TOP.bob +++ b/tests/test-bobfiles/TOP.bob @@ -4,6 +4,8 @@ 0 278 105 + 4 + 4 Title TITLE @@ -16,12 +18,16 @@ + + + + true 1 Label - PCAP1: PVI + PCAP: PVI 23 30 250 @@ -29,7 +35,7 @@ Label - SEQ1: PVI + SEQ: PVI 23 55 250 @@ -37,12 +43,10 @@ Label - PULSE1: PVI + PULSE: PVI 23 80 250 20 - 4 - 4 - + diff --git a/tests/test_ioc.py b/tests/test_ioc.py index 44868e03..8fa47271 100644 --- a/tests/test_ioc.py +++ b/tests/test_ioc.py @@ -789,7 +789,7 @@ async def test_update_on_error_marks_record(caplog): record_info = RecordInfo(None, is_in_record=True) record_info.record = MagicMock() - all_records = {EpicsName("ABC1:DEF"): record_info} + all_records = {EpicsName("ABC:DEF"): record_info} poll_period = 0.1 all_values_dict = {} @@ -802,7 +802,7 @@ async def test_update_on_error_marks_record(caplog): record_info.record.set_alarm.assert_called_with(3, 17) assert "PandA reports field in error" in caplog.text - assert "Setting record ABC1:DEF to invalid value error state." in caplog.text + assert "Setting record ABC:DEF to invalid value error state." in caplog.text @pytest.mark.asyncio @@ -824,7 +824,7 @@ async def test_update_toggles_bit_field(): record_info.record.get.return_value = 0 record_info._field_info = FieldInfo("bit_out", None, None) - all_records = {EpicsName("ABC1:DEF"): record_info} + all_records = {EpicsName("ABC:DEF"): record_info} poll_period = 0.1 all_values_dict = {} diff --git a/tests/test_ioc_system.py b/tests/test_ioc_system.py index ad6e711a..526178c7 100644 --- a/tests/test_ioc_system.py +++ b/tests/test_ioc_system.py @@ -62,11 +62,11 @@ async def test_introspect_panda( ), }, values={ - EpicsName("PCAP1:TRIG_EDGE"): "Falling", - EpicsName("PCAP1:GATE"): "CLOCK1.OUT", - EpicsName("PCAP1:GATE:DELAY"): "1", - EpicsName("PCAP1:LABEL"): "PcapMetadataLabel", - EpicsName("PCAP1:ARM"): "0", + EpicsName("PCAP:TRIG_EDGE"): "Falling", + EpicsName("PCAP:GATE"): "CLOCK1.OUT", + EpicsName("PCAP:GATE:DELAY"): "1", + EpicsName("PCAP:LABEL"): "PcapMetadataLabel", + EpicsName("PCAP:ARM"): "0", }, ) @@ -75,19 +75,19 @@ async def test_introspect_panda( fields={ "TABLE": table_field_info, }, - values={EpicsName("SEQ1:TABLE"): table_data_1}, + values={EpicsName("SEQ:TABLE"): table_data_1}, ) assert all_values_dict == { - "PCAP1:TRIG_EDGE": "Falling", - "PCAP1:GATE": "CLOCK1.OUT", - "PCAP1:GATE:DELAY": "1", - "PCAP1:LABEL": "PcapMetadataLabel", - "PULSE1:DELAY": "100", - "PCAP1:ARM": "0", - "PULSE1:DELAY:MIN": "8e-06", - "PULSE1:DELAY:UNITS": "ms", - "SEQ1:TABLE": table_data_1, + "PCAP:TRIG_EDGE": "Falling", + "PCAP:GATE": "CLOCK1.OUT", + "PCAP:GATE:DELAY": "1", + "PCAP:LABEL": "PcapMetadataLabel", + "PULSE:DELAY": "100", + "PCAP:ARM": "0", + "PULSE:DELAY:MIN": "8e-06", + "PULSE:DELAY:UNITS": "ms", + "SEQ:TABLE": table_data_1, } @@ -101,14 +101,14 @@ async def test_create_softioc_system( values.""" # Check table fields for field_name, expected_array in table_unpacked_data.items(): - actual_array = await caget(TEST_PREFIX + ":SEQ1:TABLE:" + field_name) + actual_array = await caget(TEST_PREFIX + ":SEQ:TABLE:" + field_name) assert numpy.array_equal(actual_array, expected_array) - assert await caget(TEST_PREFIX + ":PCAP1:TRIG_EDGE") == 1 # == Falling - assert await caget(TEST_PREFIX + ":PCAP1:GATE") == "CLOCK1.OUT" - assert await caget(TEST_PREFIX + ":PCAP1:GATE:DELAY") == 1 + assert await caget(TEST_PREFIX + ":PCAP:TRIG_EDGE") == 1 # == Falling + assert await caget(TEST_PREFIX + ":PCAP:GATE") == "CLOCK1.OUT" + assert await caget(TEST_PREFIX + ":PCAP:GATE:DELAY") == 1 - pcap1_label = await caget(TEST_PREFIX + ":PCAP1:LABEL") + pcap1_label = await caget(TEST_PREFIX + ":PCAP:LABEL") assert numpy.array_equal( pcap1_label, numpy.array(list("PcapMetadataLabel".encode() + b"\0"), dtype=numpy.uint8), @@ -125,7 +125,7 @@ async def test_create_softioc_update( try: # Set up a monitor to wait for the expected change capturing_queue = asyncio.Queue() - monitor = camonitor(TEST_PREFIX + ":PCAP1:TRIG_EDGE", capturing_queue.put) + monitor = camonitor(TEST_PREFIX + ":PCAP:TRIG_EDGE", capturing_queue.put) curr_val = await asyncio.wait_for(capturing_queue.get(), TIMEOUT) # First response is the current value @@ -195,20 +195,20 @@ async def test_create_softioc_time_panda_changes(mocked_panda_standard_responses # and check the initial values are correct egu_queue = asyncio.Queue() m1 = camonitor( - TEST_PREFIX + ":PULSE1:DELAY.EGU", + TEST_PREFIX + ":PULSE:DELAY.EGU", egu_queue.put, ) assert await asyncio.wait_for(egu_queue.get(), TIMEOUT) == "ms" units_queue = asyncio.Queue() m2 = camonitor( - TEST_PREFIX + ":PULSE1:DELAY:UNITS", units_queue.put, datatype=str + TEST_PREFIX + ":PULSE:DELAY:UNITS", units_queue.put, datatype=str ) assert await asyncio.wait_for(units_queue.get(), TIMEOUT) == "ms" drvl_queue = asyncio.Queue() m3 = camonitor( - TEST_PREFIX + ":PULSE1:DELAY.DRVL", + TEST_PREFIX + ":PULSE:DELAY.DRVL", drvl_queue.put, ) assert await asyncio.wait_for(drvl_queue.get(), TIMEOUT) == 8e-06 @@ -232,20 +232,20 @@ async def test_create_softioc_time_epics_changes( # and check the initial values are correct egu_queue = asyncio.Queue() m1 = camonitor( - TEST_PREFIX + ":PULSE1:DELAY.EGU", + TEST_PREFIX + ":PULSE:DELAY.EGU", egu_queue.put, ) assert await asyncio.wait_for(egu_queue.get(), TIMEOUT) == "ms" units_queue = asyncio.Queue() m2 = camonitor( - TEST_PREFIX + ":PULSE1:DELAY:UNITS", units_queue.put, datatype=str + TEST_PREFIX + ":PULSE:DELAY:UNITS", units_queue.put, datatype=str ) assert await asyncio.wait_for(units_queue.get(), TIMEOUT) == "ms" drvl_queue = asyncio.Queue() m3 = camonitor( - TEST_PREFIX + ":PULSE1:DELAY.DRVL", + TEST_PREFIX + ":PULSE:DELAY.DRVL", drvl_queue.put, ) assert await asyncio.wait_for(drvl_queue.get(), TIMEOUT) == 8e-06 @@ -256,7 +256,7 @@ async def test_create_softioc_time_epics_changes( # Change the UNITS to "min" assert await caput( - TEST_PREFIX + ":PULSE1:DELAY:UNITS", "min", wait=True, timeout=TIMEOUT + TEST_PREFIX + ":PULSE:DELAY:UNITS", "min", wait=True, timeout=TIMEOUT ) assert await asyncio.wait_for(egu_queue.get(), TIMEOUT) == "min" @@ -320,12 +320,12 @@ async def test_create_softioc_record_update_send_to_panda( ) = mocked_panda_standard_responses await asyncio.sleep(1.5) - await caput(TEST_PREFIX + ":PCAP1:TRIG_EDGE", "Falling", wait=True, timeout=TIMEOUT) + await caput(TEST_PREFIX + ":PCAP:TRIG_EDGE", "Falling", wait=True, timeout=TIMEOUT) await asyncio.sleep(1.5) command_queue.put(None) commands_recieved_by_panda = list(iter(command_queue.get, None)) assert ( - command_to_key(Put(field="PCAP1.TRIG_EDGE", value="Falling")) + command_to_key(Put(field="PCAP.TRIG_EDGE", value="Falling")) in commands_recieved_by_panda ) diff --git a/tests/test_pvaccess.py b/tests/test_pvaccess.py index e8c21bf3..27199e42 100644 --- a/tests/test_pvaccess.py +++ b/tests/test_pvaccess.py @@ -21,7 +21,7 @@ async def test_table_column_info( ctxt = Context("pva", nt=False) - table_value: Value = ctxt.get(TEST_PREFIX + ":SEQ1:TABLE") + table_value: Value = ctxt.get(TEST_PREFIX + ":SEQ:TABLE") for (actual_name, actual_value), (expected_name, expected_value) in zip( table_value.todict(wrapper=collections.OrderedDict)["value"].items(), diff --git a/tests/test_tables.py b/tests/test_tables.py index e9716113..7632687f 100644 --- a/tests/test_tables.py +++ b/tests/test_tables.py @@ -118,7 +118,7 @@ async def test_create_softioc_update_table( try: # Set up a monitor to wait for the expected change capturing_queue = asyncio.Queue() - monitor = camonitor(TEST_PREFIX + ":SEQ1:TABLE:TIME1", capturing_queue.put) + monitor = camonitor(TEST_PREFIX + ":SEQ:TABLE:TIME1", capturing_queue.put) curr_val = await asyncio.wait_for(capturing_queue.get(), TIMEOUT) # First response is the current value @@ -132,17 +132,17 @@ async def test_create_softioc_update_table( ) # And check some other columns too - curr_val = await caget(TEST_PREFIX + ":SEQ1:TABLE:TRIGGER") + curr_val = await caget(TEST_PREFIX + ":SEQ:TABLE:TRIGGER") assert numpy.array_equal( curr_val, # Numeric values: [0, 0, 0, 9, 12] ["Immediate", "Immediate", "Immediate", "POSB>=POSITION", "POSC<=POSITION"], ) - curr_val = await caget(TEST_PREFIX + ":SEQ1:TABLE:POSITION") + curr_val = await caget(TEST_PREFIX + ":SEQ:TABLE:POSITION") assert numpy.array_equal(curr_val, [-5, 0, 0, 444444, -99]) - curr_val = await caget(TEST_PREFIX + ":SEQ1:TABLE:OUTD2") + curr_val = await caget(TEST_PREFIX + ":SEQ:TABLE:OUTD2") assert numpy.array_equal(curr_val, [0, 0, 1, 1, 0]) finally: @@ -168,7 +168,7 @@ async def test_create_softioc_update_index_drvh( try: # Set up a monitor to wait for the expected change drvh_queue = asyncio.Queue() - monitor = camonitor(TEST_PREFIX + ":SEQ1:TABLE:INDEX.DRVH", drvh_queue.put) + monitor = camonitor(TEST_PREFIX + ":SEQ:TABLE:INDEX.DRVH", drvh_queue.put) curr_val = await asyncio.wait_for(drvh_queue.get(), TIMEOUT) # First response is the current value (0-indexed hence -1 ) @@ -196,13 +196,13 @@ async def test_create_softioc_table_update_send_to_panda( ) = mocked_panda_standard_responses await asyncio.sleep(1) - await caput(TEST_PREFIX + ":SEQ1:TABLE:MODE", "EDIT", wait=True, timeout=TIMEOUT) + await caput(TEST_PREFIX + ":SEQ:TABLE:MODE", "EDIT", wait=True, timeout=TIMEOUT) await caput( - TEST_PREFIX + ":SEQ1:TABLE:REPEATS", [1, 1, 1, 1, 1], wait=True, timeout=TIMEOUT + TEST_PREFIX + ":SEQ:TABLE:REPEATS", [1, 1, 1, 1, 1], wait=True, timeout=TIMEOUT ) - await caput(TEST_PREFIX + ":SEQ1:TABLE:MODE", "SUBMIT", wait=True, timeout=TIMEOUT) + await caput(TEST_PREFIX + ":SEQ:TABLE:MODE", "SUBMIT", wait=True, timeout=TIMEOUT) await asyncio.sleep(1) command_queue.put(None) @@ -210,7 +210,7 @@ async def test_create_softioc_table_update_send_to_panda( assert ( command_to_key( Put( - field="SEQ1.TABLE", + field="SEQ.TABLE", value=[ "2457862145", "4294967291", @@ -250,13 +250,13 @@ async def test_create_softioc_update_table_index( # Set up monitors to wait for the expected changes repeats_queue = asyncio.Queue() repeats_monitor = camonitor( - TEST_PREFIX + ":SEQ1:TABLE:REPEATS:SCALAR", repeats_queue.put + TEST_PREFIX + ":SEQ:TABLE:REPEATS:SCALAR", repeats_queue.put ) trigger_queue = asyncio.Queue() # TRIGGER is an mbbin so must specify datatype to get its strings, otherwise # cothread will return the integer representation trigger_monitor = camonitor( - TEST_PREFIX + ":SEQ1:TABLE:TRIGGER:SCALAR", trigger_queue.put, datatype=str + TEST_PREFIX + ":SEQ:TABLE:TRIGGER:SCALAR", trigger_queue.put, datatype=str ) # Confirm initial values are correct @@ -267,7 +267,7 @@ async def test_create_softioc_update_table_index( # Now set a new INDEX index_val = 1 - await caput(TEST_PREFIX + ":SEQ1:TABLE:INDEX", index_val) + await caput(TEST_PREFIX + ":SEQ:TABLE:INDEX", index_val) # Wait for the new values to appear curr_val = await asyncio.wait_for(repeats_queue.get(), TIMEOUT) @@ -291,7 +291,7 @@ async def test_create_softioc_update_table_scalars_change( # Set up monitors to wait for the expected changes repeats_queue = asyncio.Queue() repeats_monitor = camonitor( - TEST_PREFIX + ":SEQ1:TABLE:REPEATS:SCALAR", repeats_queue.put + TEST_PREFIX + ":SEQ:TABLE:REPEATS:SCALAR", repeats_queue.put ) # Confirm initial values are correct @@ -299,9 +299,9 @@ async def test_create_softioc_update_table_scalars_change( assert curr_val == table_unpacked_data["REPEATS"][index_val] # Now set a new value - await caput(TEST_PREFIX + ":SEQ1:TABLE:MODE", "EDIT") + await caput(TEST_PREFIX + ":SEQ:TABLE:MODE", "EDIT") new_repeats_vals = [9, 99, 999] - await caput(TEST_PREFIX + ":SEQ1:TABLE:REPEATS", new_repeats_vals) + await caput(TEST_PREFIX + ":SEQ:TABLE:REPEATS", new_repeats_vals) # Wait for the new values to appear curr_val = await asyncio.wait_for(repeats_queue.get(), TIMEOUT) diff --git a/tests/test_unit_testing_structure.py b/tests/test_unit_testing_structure.py index 1a1ddd2c..d1f8114b 100644 --- a/tests/test_unit_testing_structure.py +++ b/tests/test_unit_testing_structure.py @@ -12,5 +12,5 @@ async def test_fake_panda_and_ioc(mocked_panda_standard_responses): tmp_path, child_conn, responses, command_queue = mocked_panda_standard_responses # PVs are broadcast - gate_delay = await caget(f"{TEST_PREFIX}:PCAP1:GATE:DELAY") + gate_delay = await caget(f"{TEST_PREFIX}:PCAP:GATE:DELAY") assert gate_delay == 1