Skip to content

Commit 8b74195

Browse files
committed
Fixed tests
1 parent 999a51f commit 8b74195

File tree

3 files changed

+0
-103
lines changed

3 files changed

+0
-103
lines changed

test/test_core.py

-38
Original file line numberDiff line numberDiff line change
@@ -654,44 +654,6 @@ def test_core_download_multiple_platforms(run_command, data_dir):
654654
assert "Invalid argument passed: Found 2 platform for reference" in res.stderr
655655

656656

657-
def test_core_with_wrong_custom_board_options_is_loaded(run_command, data_dir):
658-
test_platform_name = "platform_with_wrong_custom_board_options"
659-
platform_install_dir = Path(data_dir, "hardware", "arduino-beta-dev", test_platform_name)
660-
platform_install_dir.mkdir(parents=True)
661-
662-
# Install platform in Sketchbook hardware dir
663-
shutil.copytree(
664-
Path(__file__).parent / "testdata" / test_platform_name,
665-
platform_install_dir,
666-
dirs_exist_ok=True,
667-
)
668-
669-
assert run_command(["update"])
670-
671-
res = run_command(["core", "list", "--format", "json"])
672-
assert res.ok
673-
674-
cores = json.loads(res.stdout)
675-
mapped = {core["id"]: core for core in cores}
676-
assert len(mapped) == 1
677-
# Verifies platform is loaded except excluding board with wrong options
678-
assert "arduino-beta-dev:platform_with_wrong_custom_board_options" in mapped
679-
boards = {b["fqbn"]: b for b in mapped["arduino-beta-dev:platform_with_wrong_custom_board_options"]["boards"]}
680-
assert len(boards) == 1
681-
# Verify board with malformed options is not loaded
682-
assert "arduino-beta-dev:platform_with_wrong_custom_board_options:nessuno" not in boards
683-
# Verify other board is loaded
684-
assert "arduino-beta-dev:platform_with_wrong_custom_board_options:altra" in boards
685-
# Verify warning is shown to user
686-
assert (
687-
"Error initializing instance: Error loading hardware platform: "
688-
+ "loading platform release arduino-beta-dev:[email protected]: "
689-
+ "loading boards: "
690-
+ "skipping loading of boards arduino-beta-dev:platform_with_wrong_custom_board_options:nessuno: "
691-
+ "malformed custom board options"
692-
) in res.stderr
693-
694-
695657
def test_core_with_missing_custom_board_options_is_loaded(run_command, data_dir):
696658
test_platform_name = "platform_with_missing_custom_board_options"
697659
platform_install_dir = Path(data_dir, "hardware", "arduino-beta-dev", test_platform_name)

test/testdata/platform_with_wrong_custom_board_options/boards.txt

-63
This file was deleted.

test/testdata/platform_with_wrong_custom_board_options/platform.txt

-2
This file was deleted.

0 commit comments

Comments
 (0)