Native job_workspace / datasheet_extract / review_session stay the live BOM-extract-graph-review path. Project writes follow owner_user_id.
37 lines
1.2 KiB
Python
37 lines
1.2 KiB
Python
"""Prove analysis pipeline src is native, not PinScope pipeline."""
|
|
|
|
from __future__ import annotations
|
|
|
|
import ast
|
|
from pathlib import Path
|
|
|
|
|
|
def test_src_pipeline_does_not_import_pinscope_validate():
|
|
from backend.services import pipeline as pipe
|
|
|
|
tree = ast.parse(Path(pipe.__file__).read_text())
|
|
imported = {
|
|
node.module
|
|
for node in ast.walk(tree)
|
|
if isinstance(node, ast.ImportFrom) and node.module
|
|
}
|
|
from_names = {
|
|
(node.module, alias.name)
|
|
for node in ast.walk(tree)
|
|
if isinstance(node, ast.ImportFrom) and node.module
|
|
for alias in node.names
|
|
}
|
|
assert "backend.periscopex.validate" not in imported
|
|
assert ("backend.services", "datasheet_extract") in from_names
|
|
assert ("backend.services", "job_workspace") in from_names
|
|
assert ("backend.services.validation", "validate_design_async") in from_names
|
|
assert Path(pipe.__file__).resolve().parts[-4:-1] == ("src", "backend", "services")
|
|
|
|
|
|
def test_src_projects_write_meta_uses_owner_user_id():
|
|
from backend.services import projects as proj
|
|
|
|
src = Path(proj.__file__).read_text()
|
|
assert "owner_user_id" in src
|
|
assert Path(proj.__file__).resolve().parts[-4:-1] == ("src", "backend", "services")
|