Skip to content

Commit 70d9611

Browse files
committed
add test to check if if the bug it's fixed
1 parent 0893739 commit 70d9611

File tree

1 file changed

+35
-0
lines changed

1 file changed

+35
-0
lines changed

test/test_core.py

+35
Original file line numberDiff line numberDiff line change
@@ -777,3 +777,38 @@ def test_core_list_outdated_core(run_command):
777777
latest_version = semver.parse_version_info(samd_core["latest"])
778778
# Installed version must be older than latest
779779
assert installed_version.compare(latest_version) == -1
780+
781+
782+
def test_core_loading_package_manager(run_command):
783+
assert run_command(["update"])
784+
785+
# Install core
786+
url = "https://raw.githubusercontent.com/damellis/attiny/ide-1.6.x-boards-manager/package_damellis_attiny_index.json" # noqa: E501
787+
assert run_command(["core", "update-index", f"--additional-urls={url}"])
788+
assert run_command(["core", "install", "attiny:[email protected]", f"--additional-urls={url}"])
789+
790+
# Verifies installed core is correctly found and name is set
791+
res = run_command(["core", "list", "--format", "json"])
792+
assert res.ok
793+
cores = json.loads(res.stdout)
794+
mapped = {core["id"]: core for core in cores}
795+
assert len(mapped) == 1
796+
assert "attiny:avr" in mapped
797+
assert mapped["attiny:avr"]["name"] == "attiny"
798+
799+
# Uninstall the core: this should leave some residue:
800+
# tree ~/.arduino15/packages/
801+
# /home/umberto/.arduino15/packages/
802+
# ├── attiny
803+
# │   └── hardware
804+
# │   └── avr
805+
#
806+
# Please note that the folder avr is empty
807+
808+
assert run_command(["core", "uninstall", "attiny:avr"])
809+
result = run_command(["core", "list", "--format", "json"])
810+
assert result.ok
811+
assert not _in(result.stdout, "attiny:avr")
812+
813+
result = run_command(["core", "list", "--all", "--format", "json"])
814+
assert result.ok # this should not make the cli crash

0 commit comments

Comments
 (0)