Skip to content

Commit

Permalink
added test for swapping labels post introspection
Browse files Browse the repository at this point in the history
  • Loading branch information
evalott100 committed Jan 7, 2025
1 parent 1590ad4 commit c5d7e58
Show file tree
Hide file tree
Showing 3 changed files with 52 additions and 4 deletions.
3 changes: 1 addition & 2 deletions tests/fixtures/mocked_panda.py
Original file line number Diff line number Diff line change
Expand Up @@ -859,13 +859,12 @@ def standard_responses(table_field_info, table_data_1, table_data_2):
"PCAP.GATE.DELAY": "1",
"PCAP.ARM": "0",
"*METADATA.LABEL_PCAP1": "PcapMetadataLabel",
"*METADATA.LABEL_PULSE1": "OriginalLabel",
"PULSE.DELAY": "100",
"PULSE.DELAY.UNITS": "ms",
},
multiline_values={"SEQ.TABLE": table_data_1},
),
# 0.5 seconds of no changes in case the ioc setup completes
# before the test starts
respond_with_no_changes(number_of_iterations=15),
changes_iterator_wrapper(
values={
Expand Down
31 changes: 29 additions & 2 deletions tests/test-bobfiles/PULSE.bob
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
<x>0</x>
<y use_class="true">0</y>
<width>506</width>
<height>116</height>
<height>177</height>
<grid_step_x>4</grid_step_x>
<grid_step_y>4</grid_step_y>
<widget type="label" version="2.0.0">
Expand All @@ -26,10 +26,37 @@
<horizontal_alignment>1</horizontal_alignment>
</widget>
<widget type="group" version="2.0.0">
<name>PARAMETERS</name>
<name>INPUTS</name>
<x>5</x>
<y>30</y>
<width>496</width>
<height>56</height>
<transparent>true</transparent>
<widget type="label" version="2.0.0">
<name>Label</name>
<text>Label</text>
<x>0</x>
<y>0</y>
<width>250</width>
<height>20</height>
<tooltip>$(text)</tooltip>
</widget>
<widget type="textentry" version="3.0.0">
<name>TextEntry</name>
<pv_name>TEST_PREFIX:PULSE:LABEL</pv_name>
<x>255</x>
<y>0</y>
<width>205</width>
<height>20</height>
<horizontal_alignment>1</horizontal_alignment>
<format>6</format>
</widget>
</widget>
<widget type="group" version="2.0.0">
<name>PARAMETERS</name>
<x>5</x>
<y>91</y>
<width>496</width>
<height>81</height>
<transparent>true</transparent>
<widget type="label" version="2.0.0">
Expand Down
22 changes: 22 additions & 0 deletions tests/test_ioc_system.py
Original file line number Diff line number Diff line change
Expand Up @@ -83,6 +83,7 @@ async def test_introspect_panda(
"PULSE:DELAY": "100",
"PCAP:ARM": "0",
"PULSE:DELAY:UNITS": "ms",
"PULSE:LABEL": "OriginalLabel",
"SEQ:TABLE": table_data_1,
}

Expand Down Expand Up @@ -541,6 +542,27 @@ async def test_metadata_parses_into_single_pv(mocked_panda_standard_responses):
) in multiprocessing_queue_to_list(command_queue)


async def test_metadata_label_update_from_panda_updates_pv(
mocked_panda_standard_responses,
):
(
tmp_path,
child_conn,
response_handler,
command_queue,
test_prefix,
) = mocked_panda_standard_responses
camonitor_queue = asyncio.Queue()
m1 = camonitor(
test_prefix + ":PULSE:LABEL", camonitor_queue.put, datatype=DBR_CHAR_STR
)
try:
assert await asyncio.wait_for(camonitor_queue.get(), TIMEOUT) == "OriginalLabel"
assert await asyncio.wait_for(camonitor_queue.get(), TIMEOUT) == "ANewLabel"
finally:
m1.close()


async def test_metadata_parses_into_multiple_pvs_caput_single_pv(
mocked_panda_multiple_seq_responses,
):
Expand Down

0 comments on commit c5d7e58

Please sign in to comment.