Skip to content

Commit 69016db

Browse files
committed
Added tests for arduino#1669
1 parent 436f0bb commit 69016db

File tree

1 file changed

+19
-0
lines changed

1 file changed

+19
-0
lines changed

Diff for: test/test_board.py

+19
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,8 @@
1414
# a commercial license, send an email to [email protected].
1515
from pathlib import Path
1616
from git import Repo
17+
import os
18+
import glob
1719
import simplejson as json
1820
import semver
1921
import pytest
@@ -405,6 +407,23 @@ def test_board_list(run_command):
405407
assert "protocol_label" in port["port"]
406408

407409

410+
def test_board_list_with_invalid_discovery(run_command, data_dir):
411+
run_command(["core", "update-index"])
412+
result = run_command(["board", "list"])
413+
assert result.ok
414+
415+
# check that the CLI do no crash if an invalid discovery is installed
416+
# (for example if the installation fails midway).
417+
# https://github.com/arduino/arduino-cli/issues/1669
418+
tool_dir = os.path.join(data_dir, "packages", "builtin", "tools", "serial-discovery")
419+
for file_to_delete in glob.glob(tool_dir + "/*/*"):
420+
os.remove(file_to_delete)
421+
422+
result = run_command(["board", "list"])
423+
assert result.ok
424+
assert "builtin:serial-discovery" in result.stderr
425+
426+
408427
def test_board_listall(run_command):
409428
assert run_command(["update"])
410429
assert run_command(["core", "install", "arduino:[email protected]"])

0 commit comments

Comments
 (0)