Add test suite for Lyria Studio backend
- conftest.py: isolated async test fixtures with temp DB and directories - test_waveform.py: waveform generation, downsampling, caching, SVG output - test_api.py: full API endpoint tests (health, models, clips CRUD, waveform endpoint, admin cache clearing) - test_analysis.py: BPM detection, key detection, clip analysis - test_models.py: request validation, model registry, prompt building - Fixed off-by-one in waveform.py downsampling (linspace upper bound) - All 40 tests passing
This commit is contained in:
1 parent
3500c73167
commit
6c1e1b4509
7 files changed
+742
-1
No files matched your search
@@ -58,7 +58,7 @@ async def generate_waveform_svg(clip_id: str, filename: str) -> str:
|
||||
if len(audio_data) > DOWNSAMPLE_TARGET:
|
||||
# Simple slice-based downsampling (nearest-sample, no aliasing
|
||||
# concerns at this resolution — we're making bars, not audio)
|
||||
indices = np.linspace(0, len(audio_data), DOWNSAMPLE_TARGET, dtype=int)
|
||||
indices = np.linspace(0, len(audio_data) - 1, DOWNSAMPLE_TARGET, dtype=int)
|
||||
audio_data = audio_data[indices]
|
||||
|
||||
# ── WAVEFORM COMPUTATION ──────────────────────────────────────
|
||||
|
||||
Reference in new issue
Block a user