File tree 2 files changed +5
-1
lines changed
2 files changed +5
-1
lines changed Original file line number Diff line number Diff line change @@ -145,7 +145,7 @@ def __call__(
145
145
146
146
def _parse_additional_config (unknown_args : Sequence [str ]) -> TAdditionalCliArgs :
147
147
for arg in unknown_args :
148
- if not re .match (r"^--[a-zA-Z\-]*? =\S*?$" , arg ):
148
+ if not re .match (r"^--[a-zA-Z][a-zA-Z0-9 \-]*=\S*?$" , arg ):
149
149
raise ValueError (f"Parsing argument { arg } failed" )
150
150
151
151
def _split_arg (_arg : str ) -> Tuple [str , str ]:
Original file line number Diff line number Diff line change @@ -146,6 +146,7 @@ def test_parse_additional_config(self):
146
146
"--receive-own-messages=True" ,
147
147
"--false-boolean=False" ,
148
148
"--offset=1.5" ,
149
+ "--tseg1-abr=127" ,
149
150
]
150
151
parsed_args = can .logger ._parse_additional_config (unknown_args )
151
152
@@ -170,6 +171,9 @@ def test_parse_additional_config(self):
170
171
assert "offset" in parsed_args
171
172
assert parsed_args ["offset" ] == 1.5
172
173
174
+ assert "tseg1_abr" in parsed_args
175
+ assert parsed_args ["tseg1_abr" ] == 127
176
+
173
177
with pytest .raises (ValueError ):
174
178
can .logger ._parse_additional_config (["--wrong-format" ])
175
179
You can’t perform that action at this time.
0 commit comments