File tree Expand file tree Collapse file tree 1 file changed +16
-1
lines changed Expand file tree Collapse file tree 1 file changed +16
-1
lines changed Original file line number Diff line number Diff line change 1
1
import unittest
2
2
import warnings
3
3
4
- from can .util import _rename_kwargs
4
+ from can .util import _create_bus_config , _rename_kwargs
5
5
6
6
7
7
class RenameKwargsTest (unittest .TestCase ):
@@ -47,3 +47,18 @@ def test_with_new_and_alias_present(self):
47
47
aliases = {"old_a" : "a" , "old_b" : "b" , "z" : None }
48
48
with self .assertRaises (TypeError ):
49
49
self ._test (kwargs , aliases )
50
+
51
+
52
+ class TestBusConfig (unittest .TestCase ):
53
+ base_config = dict (interface = "socketcan" , bitrate = 500_000 )
54
+
55
+ def test_timing_can_use_int (self ):
56
+ """
57
+ Test that an exception is not raised when using
58
+ integers for timing values in config.
59
+ """
60
+ timing_conf = dict (tseg1 = 5 , tseg2 = 10 , sjw = 25 )
61
+ try :
62
+ _create_bus_config ({** self .base_config , ** timing_conf })
63
+ except TypeError as e :
64
+ self .fail (e )
You can’t perform that action at this time.
0 commit comments