Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add "--all" option to "core search" to show all available versions (#483
) * add an option to show all the versions * add all_versions option to the rpc proto * clean up code + docs * added integration tests
- Loading branch information
Massimiliano Pippi
committed
Nov 19, 2019
1 parent
ef6463b
commit 5df98ee
Showing
10 changed files
with
172 additions
and
98 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
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
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
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
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
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 |
---|---|---|
@@ -0,0 +1,53 @@ | ||
# This file is part of arduino-cli. | ||
# | ||
# Copyright 2019 ARDUINO SA (http://www.arduino.cc/) | ||
# | ||
# This software is released under the GNU General Public License version 3, | ||
# which covers the main part of arduino-cli. | ||
# The terms of this license can be found at: | ||
# https://www.gnu.org/licenses/gpl-3.0.en.html | ||
# | ||
# You can be released from the requirements of the above licenses by purchasing | ||
# a commercial license. Buying such a license is mandatory if you want to modify or | ||
# otherwise use the software for commercial activities involving the Arduino | ||
# software without disclosing the source code of your own applications. To purchase | ||
# a commercial license, send an email to license@arduino.cc. | ||
import pytest | ||
import simplejson as json | ||
|
||
from .common import running_on_ci | ||
|
||
|
||
def test_core_search(run_command): | ||
url = "https://raw.githubusercontent.com/arduino/arduino-cli/master/test/testdata/test_index.json" | ||
assert run_command("core update-index --additional-urls={}".format(url)) | ||
# list all | ||
result = run_command("core search") | ||
assert result.ok | ||
assert 3 < len(result.stdout.splitlines()) | ||
result = run_command("core search --format json") | ||
assert result.ok | ||
data = json.loads(result.stdout) | ||
assert 1 < len(data) | ||
# search a specific core | ||
result = run_command("core search avr") | ||
assert result.ok | ||
assert 2 < len(result.stdout.splitlines()) | ||
result = run_command("core search avr --format json") | ||
assert result.ok | ||
data = json.loads(result.stdout) | ||
assert 0 < len(data) | ||
# additional URL | ||
result = run_command( | ||
"core search test_core --format json --additional-urls={}".format(url) | ||
) | ||
assert result.ok | ||
data = json.loads(result.stdout) | ||
assert 1 == len(data) | ||
# show all versions | ||
result = run_command( | ||
"core search test_core --all --format json --additional-urls={}".format(url) | ||
) | ||
assert result.ok | ||
data = json.loads(result.stdout) | ||
assert 2 == len(data) |
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