Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit 9c4c0c9

Browse files
umbynosper1234
andcommitted
Apply suggestions from code review
Co-authored-by: per1234 <accounts@perglass.com>
1 parent a2f1dc6 commit 9c4c0c9

File tree

1 file changed

+4
-31
lines changed

1 file changed

+4
-31
lines changed

‎test/test_core.py‎

Lines changed: 4 additions & 31 deletions
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:avr@1.0.2", 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)

AltStyle によって変換されたページ (->オリジナル) /