diff --git a/src/techui_builder/generate.py b/src/techui_builder/generate.py index cb3625a..7ea36f1 100644 --- a/src/techui_builder/generate.py +++ b/src/techui_builder/generate.py @@ -228,9 +228,7 @@ def _allocate_widget( # Add macros to the widgets new_widget.macro(self.P, component.P) if suffix_label != "": - new_widget.macro( - f"{suffix_label}", suffix.removeprefix(":").removesuffix(":") - ) + new_widget.macro(f"{suffix_label}", suffix) new_widget.macro("label", name.removeprefix(":").removesuffix(":")) # TODO: Change this to pvi_button if True: diff --git a/tests/test_files/motor_embed.bob b/tests/test_files/motor_embed.bob index 5c76313..01db8f0 100644 --- a/tests/test_files/motor_embed.bob +++ b/tests/test_files/motor_embed.bob @@ -24,7 +24,7 @@ $(name) - $(P):$(M).TWR + $(P)$(M).TWR - 10 30 @@ -52,7 +52,7 @@ $(name) - $(P):$(M).TWF + $(P)$(M).TWF + 140 10 @@ -78,7 +78,7 @@ $(IOC)/pmacAxis.pvi.bob - :$(M) + $(M)

$(P)

tab @@ -112,7 +112,7 @@ $(name)
- $(P):$(M).STOP + $(P)$(M).STOP STOP 130 60 @@ -134,7 +134,7 @@ TextEntry_27 - $(P):$(M).TWV + $(P)$(M).TWV 45 60 80 @@ -155,7 +155,7 @@ Moving - $(P):$(M).DMOV + $(P)$(M).DMOV 150 35 20 @@ -175,7 +175,7 @@ Serverity - $(P):$(M).SEVR + $(P)$(M).SEVR 35 20 1 @@ -194,7 +194,7 @@ PV - $(P):$(M) + $(P)$(M) 35 10 @@ -214,7 +214,7 @@ Readback PV - $(P):$(M).RBV + $(P)$(M).RBV 25 35 120 diff --git a/tests/test_files/widget.xml b/tests/test_files/widget.xml index 63cb651..d0d7ac0 100644 --- a/tests/test_files/widget.xml +++ b/tests/test_files/widget.xml @@ -8,7 +8,7 @@ techui-support/bob/ADAravis/ADAravis_summary.bob

BL01T-DI-IOC-01

- CAM + :CAM: test_url/bl01t-di-ioc-01
diff --git a/tests/test_generate.py b/tests/test_generate.py index fc70db9..18f742a 100644 --- a/tests/test_generate.py +++ b/tests/test_generate.py @@ -115,7 +115,7 @@ def test_generator_create_widget_keyerror(generator, caplog): P="BL01T-DI-IOC-01", desc=None, M=None, - R="CAM:", + R=":CAM:", ) result = generator._create_widget(name=screen_name, component=component) @@ -142,7 +142,7 @@ def test_generator_create_widget_is_list_of_dicts(generator): P="BL01T-DI-IOC-01", desc=None, M=None, - R="CAM:", + R=":CAM:", ) widget = generator._create_widget(name=screen_name, component=component) for value in widget: @@ -160,7 +160,7 @@ def test_generator_create_widget_embedded(generator): P="BL01T-DI-IOC-01", desc=None, M=None, - R="CAM:", + R=":CAM:", ) widget = generator._create_widget( @@ -254,7 +254,7 @@ def test_generator_allocate_widget(generator): P="BL01T-DI-IOC-01", desc=None, M=None, - R="CAM:", + R=":CAM:", ) widget = generator._allocate_widget(scrn_mapping, component) control_widget = Path("tests/test_files/widget.xml")