We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 4eb90f6 commit 23bda2bCopy full SHA for 23bda2b
1 file changed
test/test_util.py
@@ -209,6 +209,28 @@ def test_bit_timing_fd_cfg(self):
209
assert timing.data_tseg2 == 10
210
assert timing.data_sjw == 10
211
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
226
227
228
+ "state": expected_state,
229
230
231
232
233
+ assert state == expected_state
234
235
class TestChannel2Int(unittest.TestCase):
236
def test_channel2int(self) -> None:
0 commit comments