skills-vault/skills/voice-generation/tests/conftest.py

42 lines
1.0 KiB
Python

import json
import sys
from pathlib import Path
import pytest
SOURCE_ROOT = Path(__file__).resolve().parents[1] / "src"
sys.path.insert(0, str(SOURCE_ROOT))
def pytest_addoption(parser):
parser.addoption("--run-smoke", action="store_true", default=False,
help="Run real-mmx smoke tests (consumes quota)")
@pytest.fixture
def tmp_voices_json(tmp_path):
"""Return a path to a non-existent voices.json inside tmp_path."""
return tmp_path / "voices.json"
@pytest.fixture
def populated_voices_json(tmp_path):
"""Return a path to a voices.json pre-populated with one entry."""
p = tmp_path / "voices.json"
p.write_text(
json.dumps(
{
"voices": {
"wantsong": {
"file_id": 396061597295017,
"filename": "Wantsong人物录音.mp3",
"created_at": "2026-06-08T12:00:00Z",
}
}
}
),
encoding="utf-8",
)
return p