98890b9581
Tests cover curation, Lyria, queue, and API routes. Setting max_new_songs_per_day to 0 disables the limit; generate-batch runs 20 curated multilingual vocal directions. Co-authored-by: Cursor <cursoragent@cursor.com>
28 lines
879 B
Python
28 lines
879 B
Python
from __future__ import annotations
|
|
|
|
from pathlib import Path
|
|
|
|
import pytest
|
|
|
|
from ozan_radio.stats import cost_per_track, record_generation, today_stats
|
|
|
|
|
|
def test_cost_per_track_pro():
|
|
costs = {"lyria_pro_usd": 0.08, "lyria_clip_usd": 0.04, "deepseek_per_track_usd": 0.002}
|
|
assert cost_per_track("lyria-3-pro-preview", costs) == pytest.approx(0.082)
|
|
|
|
|
|
def test_cost_per_track_clip():
|
|
costs = {"lyria_pro_usd": 0.08, "lyria_clip_usd": 0.04, "deepseek_per_track_usd": 0.002}
|
|
assert cost_per_track("lyria-3-clip-preview", costs) == 0.04
|
|
|
|
|
|
def test_record_and_today_stats(tmp_path: Path):
|
|
out = tmp_path / "songs"
|
|
out.mkdir()
|
|
record_generation(out, 0.082, "abc", "Test Track")
|
|
stats = today_stats(out)
|
|
assert stats["generated"] == 1
|
|
assert stats["estimated_usd"] == pytest.approx(0.082)
|
|
assert stats["tracks"][0]["title"] == "Test Track"
|