generated from coulomb/repo-seed
Complete WP-0006 through WP-0009: registry expansion, catalog, graph, tests
Some checks failed
ci / validate-registry (push) Has been cancelled
Some checks failed
ci / validate-registry (push) Has been cancelled
Register six new capabilities (12 total), add searchable catalog UI and graph explorer, introduce pytest suite with CI fail-on-warnings, and close gap analysis priorities 13 and 16. WP-0010 remains backlog for network federation.
This commit is contained in:
58
tests/test_registry.py
Normal file
58
tests/test_registry.py
Normal file
@@ -0,0 +1,58 @@
|
||||
from __future__ import annotations
|
||||
|
||||
import subprocess
|
||||
import sys
|
||||
from pathlib import Path
|
||||
|
||||
ROOT = Path(__file__).resolve().parent.parent
|
||||
|
||||
|
||||
def run_cli(*args: str) -> subprocess.CompletedProcess[str]:
|
||||
return subprocess.run(
|
||||
[sys.executable, "-m", "reuse_surface.cli", *args],
|
||||
cwd=ROOT,
|
||||
capture_output=True,
|
||||
text=True,
|
||||
check=False,
|
||||
)
|
||||
|
||||
|
||||
def test_validate_passes():
|
||||
result = run_cli("validate")
|
||||
assert result.returncode == 0
|
||||
assert "ok: validated" in result.stdout
|
||||
|
||||
|
||||
def test_validate_relations_clean():
|
||||
result = run_cli("validate", "--relations", "--fail-on-warnings")
|
||||
assert result.returncode == 0, result.stderr
|
||||
|
||||
|
||||
def test_query_finds_registry():
|
||||
result = run_cli("query", "--tag", "registry")
|
||||
assert result.returncode == 0
|
||||
assert "capability.registry.register" in result.stdout
|
||||
|
||||
|
||||
def test_federation_compose():
|
||||
result = run_cli("federation", "compose")
|
||||
assert result.returncode == 0
|
||||
assert (ROOT / "registry/indexes/federated.yaml").exists()
|
||||
|
||||
|
||||
def test_export_json():
|
||||
result = run_cli("export", "--format", "json")
|
||||
assert result.returncode == 0
|
||||
assert '"capabilities"' in result.stdout
|
||||
|
||||
|
||||
def test_graph_check_clean():
|
||||
result = run_cli("graph", "--check", "--fail-on-warnings")
|
||||
assert result.returncode == 0, result.stderr
|
||||
|
||||
|
||||
def test_catalog_writes_search():
|
||||
result = run_cli("catalog")
|
||||
assert result.returncode == 0
|
||||
assert (ROOT / "docs/catalog/registry.json").exists()
|
||||
assert (ROOT / "docs/catalog/search.html").exists()
|
||||
Reference in New Issue
Block a user