forked from arduino/arduino-cli
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
"lib list" now returns an empty json array when there are no librarie…
…s installed (arduino#511) * add test for arduino#443 * return an empty json array when there are no libs
- Loading branch information
Massimiliano Pippi
authored
Dec 13, 2019
1 parent
6b047bb
commit e164137
Showing
2 changed files
with
18 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -27,7 +27,7 @@ def test_list(run_command): | |
result = run_command("lib list --format json") | ||
assert result.ok | ||
assert "" == result.stderr | ||
assert "null" == result.stdout | ||
assert 0 == len(json.loads(result.stdout)) | ||
|
||
# Install something we can list at a version older than latest | ||
result = run_command("lib install [email protected]") | ||
|
@@ -70,13 +70,21 @@ def test_update_index(run_command): | |
) | ||
|
||
|
||
def test_remove(run_command): | ||
libs = ['"AzureIoTProtocol_MQTT"', '"CMMC MQTT Connector"', '"WiFiNINA"'] | ||
def test_uninstall(run_command): | ||
libs = ['"AzureIoTProtocol_MQTT"', '"WiFiNINA"'] | ||
assert run_command("lib install {}".format(" ".join(libs))) | ||
|
||
result = run_command("lib uninstall {}".format(" ".join(libs))) | ||
assert result.ok | ||
|
||
def test_uninstall_spaces(run_command): | ||
key = '"LiquidCrystal I2C"' | ||
assert run_command("lib install {}".format(key)) | ||
assert run_command("lib uninstall {}".format(key)) | ||
result = run_command("lib list --format json") | ||
assert result.ok | ||
assert len(json.loads(result.stdout)) == 0 | ||
|
||
|
||
def test_search(run_command): | ||
assert run_command("lib update-index") | ||
|