kicad-mcp/tests/test_drc.py
Ryan Malloy 4ae38fed59 Rebuild on FastMCP 3 with src-layout and kicad-sch-api integration
Migrate from FastMCP 2.14.5 to 3.1.0 with complete architectural
overhaul. Adopt src-layout packaging, lazy config functions to
eliminate .env race condition, and decorator-based tool registration.

Consolidate 14 tool modules into 8 focused modules (33 tools total).
Add 9 new schematic tools via kicad-sch-api for creating and
manipulating .kicad_sch files. Drop pandas dependency (BOM uses
stdlib csv). Remove ~17k lines of stubs, over-engineering, and
dead code.

All checks pass: ruff clean, mypy 0 errors, 17/17 tests green.
2026-03-03 18:26:54 -07:00

33 lines
1.0 KiB
Python

"""Tests for DRC tools."""
import pytest
@pytest.mark.unit
def test_create_drc_rule_set_standard():
"""create_drc_rule_set should return rules for standard technology."""
from mckicad.tools.drc import create_drc_rule_set
result = create_drc_rule_set(name="test_rules", technology="standard")
assert result["success"] is True
assert "rules" in result["data"]
@pytest.mark.unit
def test_create_drc_rule_set_invalid_technology():
"""create_drc_rule_set should fail for unknown technology."""
from mckicad.tools.drc import create_drc_rule_set
result = create_drc_rule_set(name="test", technology="quantum")
assert result["success"] is False
@pytest.mark.unit
def test_get_manufacturing_constraints():
"""get_manufacturing_constraints should return constraints dict."""
from mckicad.tools.drc import get_manufacturing_constraints
result = get_manufacturing_constraints(technology="standard")
assert result["success"] is True
assert "constraints" in result["data"]