Skip to content

Commit 36567b4

Browse files
umbynosper1234
andcommitted
Apply suggestions from code review
Co-authored-by: per1234 <[email protected]>
1 parent 7a7ce46 commit 36567b4

File tree

1 file changed

+4
-31
lines changed

1 file changed

+4
-31
lines changed

Diff for: test/test_core.py

+4-31
Original file line numberDiff line numberDiff line change
@@ -779,44 +779,17 @@ def test_core_list_outdated_core(run_command):
779779
assert installed_version.compare(latest_version) == -1
780780

781781

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")
782+
def test_core_loading_package_manager(run_command, data_dir):
783+
# Create empty architecture folder (this condition is normally produced by `core uninstall`)
784+
(Path(data_dir) / "packages" / "foovendor" / "hardware" / "fooarch").mkdir(parents=True)
812785

813786
result = run_command(["core", "list", "--all", "--format", "json"])
814787
assert result.ok # this should not make the cli crash
815788

816789

817790
def test_core_index_without_checksum(run_command):
818791
assert run_command(["config", "init", "--dest-dir", "."])
819-
url = "https://raw.githubusercontent.com/keyboardio/ArduinoCore-GD32-Keyboardio/main/package_gd32_index.json" # noqa: E501
792+
url = "https://raw.githubusercontent.com/keyboardio/ArduinoCore-GD32-Keyboardio/ae5938af2f485910729e7d27aa233032a1cb4734/package_gd32_index.json" # noqa: E501
820793
assert run_command(["config", "add", "board_manager.additional_urls", url])
821794

822795
assert run_command(["core", "update-index"])

0 commit comments

Comments
 (0)