@@ -36,12 +36,12 @@ def tearDown(self) -> None:
36
36
37
37
def test_bus_creation (self ) -> None :
38
38
self .assertIsInstance (self .bus , neousys .NeousysBus )
39
- self . assertTrue ( neousys .NEOUSYS_CANLIB .CAN_Setup .called )
40
- self . assertTrue ( neousys .NEOUSYS_CANLIB .CAN_Start .called )
41
- self . assertTrue ( neousys .NEOUSYS_CANLIB .CAN_RegisterReceived .called )
42
- self . assertTrue ( neousys .NEOUSYS_CANLIB .CAN_RegisterStatus .called )
43
- self . assertTrue ( neousys .NEOUSYS_CANLIB .CAN_Send .not_called )
44
- self . assertTrue ( neousys .NEOUSYS_CANLIB .CAN_Stop .not_called )
39
+ neousys .NEOUSYS_CANLIB .CAN_Setup .assert_called ( )
40
+ neousys .NEOUSYS_CANLIB .CAN_Start .assert_called ( )
41
+ neousys .NEOUSYS_CANLIB .CAN_RegisterReceived .assert_called ( )
42
+ neousys .NEOUSYS_CANLIB .CAN_RegisterStatus .assert_called ( )
43
+ neousys .NEOUSYS_CANLIB .CAN_Send .assert_not_called ( )
44
+ neousys .NEOUSYS_CANLIB .CAN_Stop .assert_not_called ( )
45
45
46
46
CAN_Start_args = (
47
47
can .interfaces .neousys .neousys .NEOUSYS_CANLIB .CAN_Setup .call_args [0 ]
@@ -95,11 +95,11 @@ def test_send(self) -> None:
95
95
arbitration_id = 0x01 , data = [1 , 2 , 3 , 4 , 5 , 6 , 7 , 8 ], is_extended_id = False
96
96
)
97
97
self .bus .send (msg )
98
- self . assertTrue ( neousys .NEOUSYS_CANLIB .CAN_Send .called )
98
+ neousys .NEOUSYS_CANLIB .CAN_Send .assert_called ( )
99
99
100
100
def test_shutdown (self ) -> None :
101
101
self .bus .shutdown ()
102
- self . assertTrue ( neousys .NEOUSYS_CANLIB .CAN_Stop .called )
102
+ neousys .NEOUSYS_CANLIB .CAN_Stop .assert_called ( )
103
103
104
104
105
105
if __name__ == "__main__" :
0 commit comments