Skip to content

Commit f6adfa2

Browse files
author
Massimiliano Pippi
committed
fix integration tests
1 parent 1d2e51a commit f6adfa2

File tree

2 files changed

+8
-9
lines changed

2 files changed

+8
-9
lines changed

test/test_board.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ def test_core_list(run_command):
2525
result = run_command("board list --format json")
2626
assert result.ok
2727
# check is a valid json and contains a list of ports
28-
ports = json.loads(result.stdout).get("ports")
28+
ports = json.loads(result.stdout)
2929
assert isinstance(ports, list)
3030
for port in ports:
3131
assert "protocol" in port

test/test_lib.py

+7-8
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,6 @@
1212
# otherwise use the software for commercial activities involving the Arduino
1313
# software without disclosing the source code of your own applications. To purchase
1414
# a commercial license, send an email to license@arduino.cc.
15-
import pytest
1615
import simplejson as json
1716

1817

@@ -40,7 +39,7 @@ def test_list(run_command):
4039
assert "" == result.stderr
4140
lines = result.stdout.strip().splitlines()
4241
assert 2 == len(lines)
43-
toks = lines[1].split("\t")
42+
toks = [t.strip() for t in lines[1].split()]
4443
# be sure line contain the current version AND the available version
4544
assert "" != toks[1]
4645
assert "" != toks[2]
@@ -79,22 +78,22 @@ def test_remove(run_command):
7978
assert result.ok
8079

8180

82-
@pytest.mark.slow
8381
def test_search(run_command):
84-
result = run_command("lib search")
82+
assert run_command("lib update-index")
83+
84+
result = run_command("lib search --names")
8585
assert result.ok
8686
out_lines = result.stdout.splitlines()
8787
# Create an array with just the name of the vars
8888
libs = []
8989
for line in out_lines:
90-
if line.startswith("Name: "):
91-
start = line.find('"') + 1
92-
libs.append(line[start:-1])
90+
start = line.find('"') + 1
91+
libs.append(line[start:-1])
9392

9493
expected = {"WiFi101", "WiFi101OTA", "Firebase Arduino based on WiFi101"}
9594
assert expected == {lib for lib in libs if "WiFi101" in lib}
9695

97-
result = run_command("lib search --format json")
96+
result = run_command("lib search --names --format json")
9897
assert result.ok
9998
libs_json = json.loads(result.stdout)
10099
assert len(libs) == len(libs_json.get("libraries"))

0 commit comments

Comments
 (0)