@@ -197,59 +197,3 @@ def test_not_allow_brake_when_moving(self):
197
197
self .assertFalse (self .safety .get_controls_allowed ())
198
198
self ._rx (self ._speed_msg (0 ))
199
199
200
- # TODO: use PandaSafetyTest for all tests and delete this
201
- class StdTest :
202
- @staticmethod
203
- def test_relay_malfunction (test , addr , bus = 0 ):
204
- # input is a test class and the address that, if seen on specified bus, triggers
205
- # the relay_malfunction protection logic: both tx_hook and fwd_hook are
206
- # expected to return failure
207
- test .assertFalse (test .safety .get_relay_malfunction ())
208
- test .safety .safety_rx_hook (make_msg (bus , addr , 8 ))
209
- test .assertTrue (test .safety .get_relay_malfunction ())
210
- for a in range (1 , 0x800 ):
211
- for b in range (0 , 3 ):
212
- test .assertFalse (test .safety .safety_tx_hook (make_msg (b , a , 8 )))
213
- test .assertEqual (- 1 , test .safety .safety_fwd_hook (b , make_msg (b , a , 8 )))
214
-
215
- @staticmethod
216
- def test_manually_enable_controls_allowed (test ):
217
- test .safety .set_controls_allowed (1 )
218
- test .assertTrue (test .safety .get_controls_allowed ())
219
- test .safety .set_controls_allowed (0 )
220
- test .assertFalse (test .safety .get_controls_allowed ())
221
-
222
- @staticmethod
223
- def test_spam_can_buses (test , TX_MSGS ):
224
- for addr in range (1 , 0x800 ):
225
- for bus in range (0 , 4 ):
226
- if all (addr != m [0 ] or bus != m [1 ] for m in TX_MSGS ):
227
- test .assertFalse (test .safety .safety_tx_hook (make_msg (bus , addr , 8 )))
228
-
229
- @staticmethod
230
- def test_allow_brake_at_zero_speed (test ):
231
- # Brake was already pressed
232
- test .safety .safety_rx_hook (test ._speed_msg (0 ))
233
- test .safety .safety_rx_hook (test ._brake_msg (1 ))
234
- test .safety .set_controls_allowed (1 )
235
- test .safety .safety_rx_hook (test ._brake_msg (1 ))
236
- test .assertTrue (test .safety .get_controls_allowed ())
237
- test .safety .safety_rx_hook (test ._brake_msg (0 ))
238
- test .assertTrue (test .safety .get_controls_allowed ())
239
- # rising edge of brake should disengage
240
- test .safety .safety_rx_hook (test ._brake_msg (1 ))
241
- test .assertFalse (test .safety .get_controls_allowed ())
242
- test .safety .safety_rx_hook (test ._brake_msg (0 )) # reset no brakes
243
-
244
- @staticmethod
245
- def test_not_allow_brake_when_moving (test , standstill_threshold ):
246
- # Brake was already pressed
247
- test .safety .safety_rx_hook (test ._brake_msg (1 ))
248
- test .safety .set_controls_allowed (1 )
249
- test .safety .safety_rx_hook (test ._speed_msg (standstill_threshold ))
250
- test .safety .safety_rx_hook (test ._brake_msg (1 ))
251
- test .assertTrue (test .safety .get_controls_allowed ())
252
- test .safety .safety_rx_hook (test ._speed_msg (standstill_threshold + 1 ))
253
- test .safety .safety_rx_hook (test ._brake_msg (1 ))
254
- test .assertFalse (test .safety .get_controls_allowed ())
255
- test .safety .safety_rx_hook (test ._speed_msg (0 ))
0 commit comments