29 lines
690 B
Python
29 lines
690 B
Python
|
|
import json
|
||
|
|
import sys
|
||
|
|
from pathlib import Path
|
||
|
|
|
||
|
|
REPO_ROOT = Path(__file__).resolve().parents[1]
|
||
|
|
SRC = REPO_ROOT / "src"
|
||
|
|
if str(SRC) not in sys.path:
|
||
|
|
sys.path.insert(0, str(SRC))
|
||
|
|
|
||
|
|
EXAMPLES_DIR = REPO_ROOT / "examples" / "phase-001"
|
||
|
|
FIXTURES_DIR = Path(__file__).resolve().parent / "fixtures"
|
||
|
|
|
||
|
|
|
||
|
|
def load_json(path: Path) -> dict:
|
||
|
|
with open(path, encoding="utf-8") as f:
|
||
|
|
return json.load(f)
|
||
|
|
|
||
|
|
|
||
|
|
def golden_manifest() -> dict:
|
||
|
|
return load_json(EXAMPLES_DIR / "manifest.json")
|
||
|
|
|
||
|
|
|
||
|
|
def golden_entries() -> list[dict]:
|
||
|
|
return load_json(EXAMPLES_DIR / "ledger.json")
|
||
|
|
|
||
|
|
|
||
|
|
def golden_extension(name: str) -> dict:
|
||
|
|
return load_json(EXAMPLES_DIR / "extensions" / f"{name}.json")
|