File size: 951 Bytes
9f5fbb5 | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 | # voice tests
Stdlib `unittest` only. No pytest, no extra deps beyond what `voice.py` needs
(`gguf`, `numpy`). Run from the repo root, next to `voice.py`.
```bash
# offline: pure logic + fake-server download engine (always safe, <2 min)
python3 -m unittest discover -s tests
# live: real Hugging Face fetches (~1.6 GB first run, cached after) plus
# a full end-to-end cast and CPU inference run
VOICE_TEST_LIVE=1 python3 -m unittest discover -s tests
```
Live knobs (all optional):
- `VOICE_TEST_CACHE` — model download cache (default `~/.cache/voice-tests`).
- `LLAMA_CLI` — inference binary (default: `llama-cli` on `PATH`).
- No `HF_TOKEN` needed: every live fixture is a public repo.
Layout: `test_units.py` (pure logic) · `test_download.py` (fake-server
engine) · `test_live.py` (cheap real reads) · `test_voices.py` (real head
fetches + delta) · `test_e2e.py` (cast + `llama-cli` inference).
Shared fixtures live in `_helpers.py`.
|