solidworks_mcp.selftest.runner¶
solidworks_mcp.selftest.runner ¶
Run the selftest's areas in order and turn each into an AreaResult.
Classes¶
Area ¶
AreaResult
dataclass
¶
Check
dataclass
¶
Check(name: str, expected: Any, measured: Any, tolerance: Any = None, unit: str = '', passed: bool | None = None)
One value read back from SolidWorks against the hand calculation.
passed is None when the value could not be measured, which
counts as a failure.
Context
dataclass
¶
What the areas share: the tool caller, the folder, and saved files.
Outcome ¶
Bases: StrEnum
An area's result.
ToolFailed ¶
Bases: Exception
A tool call returned status: error.
Remember which tool failed and its message.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
tool
|
str
|
The tool's name. |
required |
message
|
str
|
The tool's error message. |
required |
Source code in src/solidworks_mcp/selftest/results.py
Methods:¶
Functions:¶
run_areas
async
¶
Run each area, skipping one whose files an earlier area didn't save.
A tool error ends its area as FAIL with the tool's message; the checks made before it are kept. Any other exception propagates, so a bug in the selftest is never reported as a SolidWorks failure.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
areas
|
Iterable[Area]
|
The areas, in order. |
required |
ctx
|
Context
|
The selftest context. |
required |
Returns:
| Type | Description |
|---|---|
list[AreaResult]
|
list[AreaResult]: One result per area, in order. |