File tree Expand file tree Collapse file tree 3 files changed +27
-2
lines changed
Expand file tree Collapse file tree 3 files changed +27
-2
lines changed Original file line number Diff line number Diff line change @@ -207,7 +207,7 @@ def _allocate_widget(
207207 if scrn_mapping ["type" ] == "embedded" :
208208 height , width = self ._get_screen_dimensions (str (scrn_path ))
209209 new_widget = pwidget .EmbeddedDisplay (
210- name ,
210+ name . removeprefix ( ":" ). removesuffix ( ":" ) ,
211211 str (data_scrn_path ),
212212 0 ,
213213 0 , # Change depending on the order
Original file line number Diff line number Diff line change 11<?xml version =" 1.0" ?>
22<widget type =" embedded" version =" 2.0.0" >
3- <name >CAM: </name >
3+ <name >CAM</name >
44 <x >0</x >
55 <y >0</y >
66 <width >860</width >
Original file line number Diff line number Diff line change @@ -221,6 +221,31 @@ def test_generator_allocate_widget(generator):
221221 assert str (widget ) == xml_content
222222
223223
224+ def test_generator_allocate_widget_with_suffix (generator ):
225+ generator ._initilise_name_suffix = Mock (return_value = (":CAM:" , ":CAM:" , "R" ))
226+
227+ scrn_mapping = {
228+ "file" : "ADAravis/ADAravis_summary.bob" ,
229+ "prefix" : "$(P)$(R)" ,
230+ "suffix" : ":CAM:" ,
231+ "type" : "embedded" ,
232+ }
233+ component = Entity (
234+ type = "detectorPlugins.detectorPlugins" ,
235+ P = "BL23B-DI-MOD-02" ,
236+ desc = None ,
237+ M = None ,
238+ R = None ,
239+ )
240+ widget = generator ._allocate_widget (scrn_mapping , component )
241+ control_widget = Path ("tests/test_files/widget.xml" )
242+
243+ with open (control_widget ) as f :
244+ xml_content = f .read ()
245+
246+ assert str (widget ) == xml_content
247+
248+
224249def test_generator_create_widget_related (generator ):
225250 generator ._get_screen_dimensions = Mock (return_value = (800 , 1280 ))
226251 screen_name = "test"
You can’t perform that action at this time.
0 commit comments