Dedicated deterministic engines certify class and connection integrity (CC1/CC2, Rd 5.1 kΩ, VBUS/GND, SuperSpeed if USB3; 10/100 vs GbE magnetics; PoE only with evidence). Missing evidence is INSUFFICIENT or N/A, never invented PoE, SuperSpeed, Z, or I. No FEM, no via IPC.
68 lines
2.7 KiB
Python
68 lines
2.7 KiB
Python
"""Native frontend package.json and backend requirements live under src."""
|
|
|
|
from __future__ import annotations
|
|
|
|
from pathlib import Path
|
|
|
|
ROOT = Path(__file__).resolve().parents[1]
|
|
PKG = ROOT / "periscope" / "src" / "frontend" / "package.json"
|
|
REQ = ROOT / "periscope" / "src" / "backend" / "requirements.txt"
|
|
LOCK = ROOT / "periscope" / "src" / "frontend" / "package-lock.json"
|
|
COMPONENTS = ROOT / "periscope" / "src" / "frontend" / "components.json"
|
|
FE_DOCKER = ROOT / "periscope" / "src" / "frontend" / "dockerfile"
|
|
BE_DOCKER = ROOT / "periscope" / "src" / "backend" / "Dockerfile"
|
|
DOCKERIGNORE = ROOT / ".dockerignore"
|
|
|
|
|
|
def test_package_json_is_periscope_web():
|
|
import re
|
|
text = PKG.read_text(encoding="utf-8")
|
|
assert '"name": "periscope-web"' in text
|
|
chg = (ROOT / "periscope" / "src" / "frontend" / "content" / "changelog.md").read_text(
|
|
encoding="utf-8",
|
|
)
|
|
ver = re.search(r"^##\s+(\d+\.\d+\.\d+)", chg, re.M)
|
|
assert ver, "changelog missing ## X.Y.Z"
|
|
assert f'"version": "{ver.group(1)}"' in text
|
|
assert "Native Periscope overlay" not in text[:400]
|
|
assert LOCK.is_file()
|
|
lock = LOCK.read_text(encoding="utf-8")
|
|
assert '"name": "periscope-web"' in lock
|
|
|
|
|
|
def test_components_json_is_src():
|
|
text = COMPONENTS.read_text(encoding="utf-8")
|
|
assert "base-nova" in text
|
|
assert '"css": "src/app/globals.css"' in text
|
|
|
|
|
|
def test_requirements_are_src_and_deepseek_first():
|
|
text = REQ.read_text(encoding="utf-8")
|
|
assert "fastapi>=" in text
|
|
assert "openai>=" in text
|
|
assert "PyJWT" in text
|
|
lines = [ln.strip() for ln in text.splitlines() if ln.strip() and not ln.startswith("#")]
|
|
assert lines[0].startswith("fastapi")
|
|
|
|
|
|
def test_docker_installs_from_src():
|
|
fe = FE_DOCKER.read_text(encoding="utf-8")
|
|
be = BE_DOCKER.read_text(encoding="utf-8")
|
|
assert "COPY periscope/src/frontend/package.json" in fe
|
|
assert "periscope/src/frontend/package-lock.json" in fe
|
|
assert "COPY periscope/src/backend/requirements*.txt" in be
|
|
assert "COPY periscope/dependency/backend/ /app/backend/" not in be
|
|
ignore = DOCKERIGNORE.read_text(encoding="utf-8")
|
|
assert "faradworks-logo-white.png" in ignore
|
|
assert "power-tree.gif" in ignore
|
|
assert "next.svg" in ignore
|
|
|
|
|
|
def test_eda_logos_and_examples_are_src():
|
|
logos = ROOT / "periscope" / "src" / "frontend" / "public" / "eda-logos"
|
|
examples = ROOT / "periscope" / "src" / "frontend" / "public" / "examples"
|
|
assert (logos / "kicad.svg").is_file()
|
|
assert (examples / "TI-MSP-KICAD9-TUTORIAL.asc").is_file()
|
|
assert not (ROOT / "periscope" / "src" / "frontend" / "public" / "faradworks-logo-white.png").exists()
|
|
assert not (ROOT / "periscope" / "src" / "frontend" / "public" / "power-tree.gif").exists()
|