@@ -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:platform_with_wrong_custom_board_options@4.2.0: "
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-
695657def 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 )
@@ -715,19 +677,11 @@ def test_core_with_missing_custom_board_options_is_loaded(run_command, data_dir)
715677 # Verifies platform is loaded except excluding board with missing options
716678 assert "arduino-beta-dev:platform_with_missing_custom_board_options" in mapped
717679 boards = {b ["fqbn" ]: b for b in mapped ["arduino-beta-dev:platform_with_missing_custom_board_options" ]["boards" ]}
718- assert len (boards ) == 1
680+ assert len (boards ) == 2
719681 # Verify board with malformed options is not loaded
720- assert "arduino-beta-dev:platform_with_missing_custom_board_options:nessuno" not in boards
682+ assert "arduino-beta-dev:platform_with_missing_custom_board_options:nessuno" in boards
721683 # Verify other board is loaded
722684 assert "arduino-beta-dev:platform_with_missing_custom_board_options:altra" in boards
723- # Verify warning is shown to user
724- assert (
725- "Error initializing instance: Error loading hardware platform: "
726- + "loading platform release arduino-beta-dev:platform_with_missing_custom_board_options@4.2.0: "
727- + "loading boards: "
728- + "skipping loading of boards arduino-beta-dev:platform_with_missing_custom_board_options:nessuno: "
729- + "malformed custom board options"
730- ) in res .stderr
731685
732686
733687def test_core_list_outdated_core (run_command ):
0 commit comments