7a1df0bca4
Refs #114 Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_019A9CSrh9rfM5WwqKtg8BSE
36 lines
1.0 KiB
Python
36 lines
1.0 KiB
Python
"""Runs the plain-node vision panel quote rows label test (tests/js/test_vision_rows.js).
|
|
|
|
Same thin pytest wrapper pattern as test_dxf_zoom_js.py: shells out to
|
|
``node`` and asserts the script's own exit code. Skips (does not fail) when
|
|
node is not installed.
|
|
|
|
Covers gitea:Adriano/TieMeasureFlow#114.
|
|
"""
|
|
import shutil
|
|
import subprocess
|
|
from pathlib import Path
|
|
|
|
import pytest
|
|
|
|
FLASK_APP_DIR = Path(__file__).resolve().parent.parent
|
|
JS_TEST = Path(__file__).resolve().parent / "js" / "test_vision_rows.js"
|
|
|
|
|
|
def test_vision_rows_js_behaviour():
|
|
node = shutil.which("node")
|
|
if not node:
|
|
pytest.skip("node non installato: test JS delle etichette quote saltato")
|
|
|
|
result = subprocess.run(
|
|
[node, str(JS_TEST)],
|
|
cwd=str(FLASK_APP_DIR),
|
|
capture_output=True,
|
|
text=True,
|
|
timeout=30,
|
|
)
|
|
|
|
assert result.returncode == 0, (
|
|
f"tests/js/test_vision_rows.js fallito (exit {result.returncode})\n"
|
|
f"stdout:\n{result.stdout}\nstderr:\n{result.stderr}"
|
|
)
|