@@ -94,21 +94,31 @@ def test_set_W0(self):
9494 """Check that the Widget allow to update W0"""
9595 # Clear the field before writing the new value
9696 self .widget .lf_W0 .clear ()
97- QTest .keyClicks (self .widget .lf_W0 , "0.31 " )
97+ QTest .keyClicks (self .widget .lf_W0 , "0.30 " )
9898 self .widget .lf_W0 .editingFinished .emit () # To trigger the slot
9999
100- assert self .widget .hole .W0 == 0.31
101- assert self .test_obj .hole [0 ].W0 == 0.31
100+ assert self .widget .hole .W0 == 0.30
101+ assert self .test_obj .hole [0 ].W0 == 0.30
102102
103103 def test_set_W1 (self ):
104104 """Check that the Widget allow to update W1"""
105105 # Clear the field before writing the new value
106106 self .widget .lf_W1 .clear ()
107- QTest .keyClicks (self .widget .lf_W1 , "0.32 " )
107+ QTest .keyClicks (self .widget .lf_W1 , "0.31 " )
108108 self .widget .lf_W1 .editingFinished .emit () # To trigger the slot
109109
110- assert self .widget .hole .W1 == 0.32
111- assert self .test_obj .hole [0 ].W1 == 0.32
110+ assert self .widget .hole .W1 == 0.31
111+ assert self .test_obj .hole [0 ].W1 == 0.31
112+
113+ def test_set_W2 (self ):
114+ """Check that the Widget allow to update W2"""
115+ # Clear the field before writing the new value
116+ self .widget .lf_W2 .clear ()
117+ QTest .keyClicks (self .widget .lf_W2 , "0.32" )
118+ self .widget .lf_W2 .editingFinished .emit () # To trigger the slot
119+
120+ assert self .widget .hole .W2 == 0.32
121+ assert self .test_obj .hole [0 ].W2 == 0.32
112122
113123 def test_set_W3 (self ):
114124 """Check that the Widget allow to update W3"""
@@ -217,3 +227,12 @@ def test_set_material_3(self):
217227
218228 assert self .widget .w_mat_3 .c_mat_type .currentText () == "Magnet3"
219229 assert self .test_obj .hole [0 ].magnet_2 .mat_type .name == "Magnet3"
230+
231+ def test_comp_output (self ):
232+ """Check that comp_output is correctly working"""
233+ self .test_obj .hole [0 ].W0 = 0.5
234+ self .test_obj .hole [0 ].H0 = 0.00000001
235+ self .widget .hole = self .test_obj .hole [0 ]
236+ self .widget .comp_output ()
237+ assert not (self .widget .out_alpha .text () == "alpha: ?" )
238+ assert not (self .widget .out_Whole .text () == "Wslot: ?" )
0 commit comments