File tree Expand file tree Collapse file tree 1 file changed +22
-0
lines changed Expand file tree Collapse file tree 1 file changed +22
-0
lines changed Original file line number Diff line number Diff line change @@ -209,6 +209,28 @@ def test_bit_timing_fd_cfg(self):
209209 assert timing .data_tseg2 == 10
210210 assert timing .data_sjw == 10
211211
212+ def test_state_with_str (self ):
213+ can_cfg = _create_bus_config (
214+ {
215+ ** self .base_config ,
216+ "state" : "PASSIVE" ,
217+ }
218+ )
219+ state = can_cfg ["state" ]
220+ assert isinstance (state , can .BusState )
221+ assert state == can .BusState .PASSIVE
222+
223+ def test_state_with_enum (self ):
224+ expected_state = can .BusState .PASSIVE
225+ can_cfg = _create_bus_config (
226+ {
227+ ** self .base_config ,
228+ "state" : expected_state ,
229+ }
230+ )
231+ state = can_cfg ["state" ]
232+ assert isinstance (state , can .BusState )
233+ assert state == expected_state
212234
213235class TestChannel2Int (unittest .TestCase ):
214236 def test_channel2int (self ) -> None :
You can’t perform that action at this time.
0 commit comments