This repository has been archived on 2026-03-24. You can view files and clone it. You cannot open issues or pull requests or push a commit.
Files
Timmy-time-dashboard/tests/test_creative_route.py
Claude 1103da339c feat: add full creative studio + DevOps tools (Pixel, Lyra, Reel personas)
Adds 3 new personas (Pixel, Lyra, Reel) and 5 new tool modules:

- Git/DevOps tools (GitPython): clone, status, diff, log, blame, branch,
  add, commit, push, pull, stash — wired to Forge and Helm personas
- Image generation (FLUX via diffusers): text-to-image, storyboards,
  variations — Pixel persona
- Music generation (ACE-Step 1.5): full songs with vocals+instrumentals,
  instrumental tracks, vocal-only tracks — Lyra persona
- Video generation (Wan 2.1 via diffusers): text-to-video, image-to-video
  clips — Reel persona
- Creative Director pipeline: multi-step orchestration that chains
  storyboard → music → video → assembly into 3+ minute final videos
- Video assembler (MoviePy + FFmpeg): stitch clips, overlay audio,
  title cards, subtitles, final export

Also includes:
- Spark Intelligence tool-level + creative pipeline event capture
- Creative Studio dashboard page (/creative/ui) with 4 tabs
- Config settings for all new models and output directories
- pyproject.toml creative optional extra for GPU dependencies
- 107 new tests covering all modules (624 total, all passing)

https://claude.ai/code/session_01KJm6jQkNi3aA3yoQJn636c
2026-02-24 16:31:47 +00:00

62 lines
1.9 KiB
Python

"""Tests for the Creative Studio dashboard route."""
import os
import pytest
os.environ.setdefault("TIMMY_TEST_MODE", "1")
from fastapi.testclient import TestClient
@pytest.fixture
def client(tmp_path, monkeypatch):
"""Test client with temp DB paths."""
monkeypatch.setattr("swarm.tasks.DB_PATH", tmp_path / "swarm.db")
monkeypatch.setattr("swarm.registry.DB_PATH", tmp_path / "swarm.db")
monkeypatch.setattr("swarm.stats.DB_PATH", tmp_path / "swarm.db")
monkeypatch.setattr("swarm.learner.DB_PATH", tmp_path / "swarm.db")
from dashboard.app import app
return TestClient(app)
class TestCreativeStudioPage:
def test_creative_page_loads(self, client):
resp = client.get("/creative/ui")
assert resp.status_code == 200
assert "Creative Studio" in resp.text
def test_creative_page_has_tabs(self, client):
resp = client.get("/creative/ui")
assert "tab-images" in resp.text
assert "tab-music" in resp.text
assert "tab-video" in resp.text
assert "tab-director" in resp.text
def test_creative_page_shows_personas(self, client):
resp = client.get("/creative/ui")
assert "Pixel" in resp.text
assert "Lyra" in resp.text
assert "Reel" in resp.text
class TestCreativeAPI:
def test_projects_api_empty(self, client):
resp = client.get("/creative/api/projects")
assert resp.status_code == 200
data = resp.json()
assert "projects" in data
def test_genres_api(self, client):
resp = client.get("/creative/api/genres")
assert resp.status_code == 200
data = resp.json()
assert "genres" in data
def test_video_styles_api(self, client):
resp = client.get("/creative/api/video-styles")
assert resp.status_code == 200
data = resp.json()
assert "styles" in data
assert "resolutions" in data