Frontend periscope-web manifests, pip requirements, and EDA logos/examples overlay from src. Docker installs from those files. Unused PinScope public blobs are dockerignored. Landing png/gif stay in dependency until native captures exist.
61 lines
2.4 KiB
Python
61 lines
2.4 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():
|
|
text = PKG.read_text(encoding="utf-8")
|
|
assert '"name": "periscope-web"' in text
|
|
assert '"version": "2.57.0"' 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
|
|
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()
|