Files
make-cad/test/test_drawing_skill_integration.py
T
liuyu 9caa2caa3a feat(drawing): integrate PDF reconstruction and evidence validation
Add the drawing inspection namespace and its parser, calibration, section and
independent acceptance dependencies on the current dev architecture.

Protect input BREP during material fusion and sectioning. Bind dimensions,
annotations and visual reviews to source identities and measured geometry.
Connect the workflow and generated API docs to all seven skill build targets.
Make standalone verifier tests work with the pytest console entry point.

Validation: 186 drawing, documentation, skill-target and public API tests;
16 non-render BREP query tests; compileall and skillbuild --check.
2026-09-11 13:36:27 +08:00

40 lines
1.5 KiB
Python

"""The drawing workflow and exact API pages ship for every dev skill target."""
from dataclasses import replace
from pathlib import Path
import pytest
from simplecadapi.inspect import drawing
from test_skill_build import skillbuild
ROOT = Path(__file__).resolve().parents[1]
PROJECT = skillbuild.load_project(ROOT)
@pytest.mark.parametrize("target", PROJECT.targets)
def test_drawing_workflow_is_complete_in_each_host_build(target, tmp_path):
sources = skillbuild.collect_source_files(
PROJECT.source, frozenset(PROJECT.targets), PROJECT.root
)
project = replace(
PROJECT,
root=tmp_path,
outputs={name: tmp_path / name for name in PROJECT.targets},
)
output = skillbuild.build_target(project, sources, target)
router = (output / "SKILL.md").read_text(encoding="utf-8")
assert "references/workflows/drawing-reconstruction.md" in router
assert "references/domains/addon-development.md" in router
workflow = (output / "references/workflows/drawing-reconstruction.md").read_text(
encoding="utf-8"
)
assert "section_checks" in workflow and "measurement_contract" in workflow
assert "Host binding:" in workflow
assert "<!-- skill:" not in workflow
assert (output / "references/domains/drawing-inspection.md").is_file()
for name in drawing.__all__:
page = output / "references/docs/api" / f"{name}.md"
assert page.is_file(), f"{target}: missing {name} API page"
assert "drawing-inspection namespace" in page.read_text(encoding="utf-8")