fix(music-lab): cache-buster query 제거 + DALL·E prompt에 background_keyword 활용
1. video.py _container_to_nas, orchestrator.py _local_path에서 path 변환 전 ?쿼리 strip — 이전 commit 20c5268의 cache-buster ?v=...가 Windows path로 그대로 전달되어 input_validation 실패하던 문제 픽스 2. cover.py _generate_with_dalle가 background_keyword를 prompt에 포함 — 사용자가 PipelineStartModal에서 '배경 키워드' 입력 시 처음부터 원하는 분위기 cover 생성
This commit is contained in:
@@ -147,3 +147,30 @@ async def test_pexels_zero_results_falls_back(tmp_storage, monkeypatch):
|
||||
image_source="pexels",
|
||||
)
|
||||
assert out["used_fallback"] is True
|
||||
|
||||
|
||||
@pytest.mark.asyncio
|
||||
@respx.mock
|
||||
async def test_dalle_uses_background_keyword(tmp_storage, monkeypatch):
|
||||
monkeypatch.setenv("OPENAI_API_KEY", "test-key")
|
||||
captured = {}
|
||||
def hook(req):
|
||||
import json as _json
|
||||
captured["body"] = _json.loads(req.content)
|
||||
return Response(200, json={"data": [{"url": "https://x"}]})
|
||||
respx.post("https://api.openai.com/v1/images/generations").mock(side_effect=hook)
|
||||
png_bytes = bytes.fromhex(
|
||||
"89504e470d0a1a0a0000000d49484452000000010000000108020000009077"
|
||||
"53de0000000c4944415478da6300010000050001"
|
||||
"0d0a2db40000000049454e44ae426082"
|
||||
)
|
||||
respx.get("https://x").mock(return_value=Response(200, content=png_bytes))
|
||||
await cover.generate(
|
||||
pipeline_id=80, genre="lo-fi",
|
||||
prompt_template="moody anime",
|
||||
mood="chill", track_title="X",
|
||||
image_source="ai",
|
||||
background_keyword="skateboard park bright atmosphere",
|
||||
)
|
||||
assert "skateboard" in captured["body"]["prompt"]
|
||||
assert "bright" in captured["body"]["prompt"]
|
||||
|
||||
Reference in New Issue
Block a user