@@ -178,6 +178,45 @@ def test_version(run_command):
178
178
dateutil .parser .isoparse (output_list [1 ])
179
179
180
180
181
+ def test_arduino_lint_official (run_command ):
182
+ project_path = test_data_path .joinpath ("ARDUINO_LINT_OFFICIAL" )
183
+
184
+ result = run_command (cmd = [project_path ])
185
+ assert not result .ok
186
+
187
+ result = run_command (cmd = [project_path ], custom_env = {"ARDUINO_LINT_OFFICIAL" : "true" })
188
+ assert result .ok
189
+
190
+ result = run_command (cmd = [project_path ], custom_env = {"ARDUINO_LINT_OFFICIAL" : "false" })
191
+ assert not result .ok
192
+
193
+ result = run_command (cmd = [project_path ], custom_env = {"ARDUINO_LINT_OFFICIAL" : "foo" })
194
+ assert not result .ok
195
+
196
+
197
+ def test_arduino_lint_log_level (run_command ):
198
+ project_path = test_data_path .joinpath ("ValidSketch" )
199
+
200
+ result = run_command (cmd = [project_path ], custom_env = {"ARDUINO_LINT_LOG_LEVEL" : "debug" })
201
+ assert result .ok
202
+
203
+ result = run_command (cmd = [project_path ], custom_env = {"ARDUINO_LINT_LOG_LEVEL" : "foo" })
204
+ assert not result .ok
205
+
206
+
207
+ def test_arduino_lint_log_format (run_command ):
208
+ project_path = test_data_path .joinpath ("ValidSketch" )
209
+
210
+ result = run_command (cmd = [project_path ], custom_env = {"ARDUINO_LINT_LOG_FORMAT" : "text" })
211
+ assert result .ok
212
+
213
+ result = run_command (cmd = [project_path ], custom_env = {"ARDUINO_LINT_LOG_FORMAT" : "json" })
214
+ assert result .ok
215
+
216
+ result = run_command (cmd = [project_path ], custom_env = {"ARDUINO_LINT_LOG_FORMAT" : "foo" })
217
+ assert not result .ok
218
+
219
+
181
220
@pytest .fixture (scope = "function" )
182
221
def run_command (pytestconfig , working_dir ) -> typing .Callable [..., invoke .runners .Result ]:
183
222
"""Provide a wrapper around invoke's `run` API so that every test will work in the same temporary folder.
0 commit comments