Merge pull request #214 from mixelpixx/refactor/extract-schematic-handlers-pr

refactor: extract schematic handlers into SchematicHandlersMixin (kicad_interface.py 6.7k→3.7k)
This commit is contained in:
mixelpixx
2026-06-12 12:50:36 -04:00
committed by GitHub
3 changed files with 3111 additions and 3075 deletions

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@@ -74,7 +74,7 @@ class TestAddMissingFootprintsFromSchematic:
} }
], ],
), ),
patch("kicad_interface.pcbnew") as mock_pcbnew, patch("commands.schematic_handlers.pcbnew") as mock_pcbnew,
patch("commands.library.LibraryManager") as mock_lm_cls, patch("commands.library.LibraryManager") as mock_lm_cls,
): ):
mock_pcbnew.FootprintLoad.return_value = loaded_module mock_pcbnew.FootprintLoad.return_value = loaded_module
@@ -113,7 +113,7 @@ class TestAddMissingFootprintsFromSchematic:
} }
], ],
), ),
patch("kicad_interface.pcbnew"), patch("commands.schematic_handlers.pcbnew"),
patch("commands.library.LibraryManager") as mock_lm_cls, patch("commands.library.LibraryManager") as mock_lm_cls,
): ):
lm = MagicMock() lm = MagicMock()
@@ -144,7 +144,7 @@ class TestAddMissingFootprintsFromSchematic:
{"reference": "#FLG0001", "value": "PWR_FLAG", "footprint": ""}, {"reference": "#FLG0001", "value": "PWR_FLAG", "footprint": ""},
], ],
), ),
patch("kicad_interface.pcbnew"), patch("commands.schematic_handlers.pcbnew"),
patch("commands.library.LibraryManager") as mock_lm_cls, patch("commands.library.LibraryManager") as mock_lm_cls,
): ):
mock_lm_cls.return_value = MagicMock(libraries={}) mock_lm_cls.return_value = MagicMock(libraries={})
@@ -172,7 +172,7 @@ class TestAddMissingFootprintsFromSchematic:
"_extract_components_from_schematic", "_extract_components_from_schematic",
return_value=[{"reference": "R1", "value": "10k", "footprint": ""}], return_value=[{"reference": "R1", "value": "10k", "footprint": ""}],
), ),
patch("kicad_interface.pcbnew"), patch("commands.schematic_handlers.pcbnew"),
patch("commands.library.LibraryManager") as mock_lm_cls, patch("commands.library.LibraryManager") as mock_lm_cls,
): ):
mock_lm_cls.return_value = MagicMock(libraries={}) mock_lm_cls.return_value = MagicMock(libraries={})
@@ -205,7 +205,7 @@ class TestAddMissingFootprintsFromSchematic:
} }
], ],
), ),
patch("kicad_interface.pcbnew"), patch("commands.schematic_handlers.pcbnew"),
patch("commands.library.LibraryManager") as mock_lm_cls, patch("commands.library.LibraryManager") as mock_lm_cls,
): ):
mock_lm_cls.return_value = MagicMock(libraries={}) # MyVendor not present mock_lm_cls.return_value = MagicMock(libraries={}) # MyVendor not present