diff --git a/python/commands/pin_locator.py b/python/commands/pin_locator.py index 857c76e..794b5ee 100644 --- a/python/commands/pin_locator.py +++ b/python/commands/pin_locator.py @@ -418,21 +418,23 @@ if __name__ == "__main__": # Test pin location discovery import sys - sys.path.insert(0, "/home/chris/MCP/KiCAD-MCP-Server/python") - from pathlib import Path from commands.component_schematic import ComponentManager from commands.schematic import SchematicManager import shutil + sys.path.insert(0, str(Path(__file__).parent.parent)) + print("=" * 80) print("PIN LOCATOR TEST") print("=" * 80) # Create test schematic with components (cross-platform temp directory) test_path = Path(tempfile.gettempdir()) / "test_pin_locator.kicad_sch" - template_path = Path( - "/home/chris/MCP/KiCAD-MCP-Server/python/templates/template_with_symbols_expanded.kicad_sch" + template_path = ( + Path(__file__).parent.parent + / "templates" + / "template_with_symbols_expanded.kicad_sch" ) shutil.copy(template_path, test_path) diff --git a/python/commands/wire_manager.py b/python/commands/wire_manager.py index 7ef7214..1fba738 100644 --- a/python/commands/wire_manager.py +++ b/python/commands/wire_manager.py @@ -706,20 +706,18 @@ if __name__ == "__main__": # Test wire creation import sys - sys.path.insert(0, "/home/chris/MCP/KiCAD-MCP-Server/python") - from pathlib import Path import shutil + sys.path.insert(0, str(Path(__file__).parent.parent)) + print("=" * 80) print("WIRE MANAGER TEST") print("=" * 80) # Create test schematic (cross-platform temp directory) test_path = Path(tempfile.gettempdir()) / "test_wire_manager.kicad_sch" - template_path = Path( - "/home/chris/MCP/KiCAD-MCP-Server/python/templates/empty.kicad_sch" - ) + template_path = Path(__file__).parent.parent / "templates" / "empty.kicad_sch" shutil.copy(template_path, test_path) print(f"\n✓ Created test schematic: {test_path}")