claude-video/tests/test_packaging.py
bradautomates e90ef44c32 Implement v0.3.0 reliability fixes and managed WhisperX transcription
Add opt-in local transcription with managed installation, cache warm-up,
and a one-time backend choice while preserving native-caption priority.

Correct frame timing and coverage, caption provenance and download
ownership, configuration parsing, provider pairing, and partial reports.
Update cross-host instructions, packaging, and test-gated release CI.

Validate 198 isolated tests, real local English and Spanish inference,
network-denied warm-cache inference, live captions/media, and packaging.
Record platform and account-dependent acceptance limits separately.
2026-09-12 22:09:43 +10:00

29 lines
1.3 KiB
Python

"""Cross-host layout and version consistency are release invariants."""
import json
import os
import re
import shutil
import subprocess
import sys
from pathlib import Path
ROOT = Path(__file__).resolve().parents[1]
def test_release_versions_match_canonical_skill():
skill = ROOT / 'skills/watch/SKILL.md'
version = re.search(r'^version: "([^"]+)"', skill.read_text(), re.M).group(1)
for relative in ('.claude-plugin/plugin.json', '.codex-plugin/plugin.json'):
assert json.loads((ROOT / relative).read_text())['version'] == version
assert json.loads((ROOT / '.codex-plugin/plugin.json').read_text())['skills'] == './skills/'
assert not (ROOT / 'commands').exists()
def test_copied_skill_runs_outside_repository(tmp_path, static_clip):
target = tmp_path / 'other host' / 'watch'
shutil.copytree(ROOT / 'skills/watch', target, ignore=shutil.ignore_patterns('__pycache__', '*.pyc'))
result = subprocess.run([sys.executable, str(target / 'scripts/watch.py'), str(static_clip), '--no-whisper', '--out-dir', str(tmp_path / 'output')],
capture_output=True, encoding='utf-8', env=dict(os.environ))
assert result.returncode == 0, result.stderr
assert '**Detail:** balanced' in result.stdout and 'reason=uniform' in result.stdout