Spaces:
Paused
Paused
v1.0 Photoreal One-Studio; keeps HF OAuth owner-only library + guest isolation, Demucs, /data
544e3ba verified Download tests/test_studio_library.py from 2Btainment/absolution-omega: direct link, hf CLI and curl.
- Browser
- Download file 2.19 kB
-
https://huggingface.co/spaces/2Btainment/absolution-omega/resolve/main/tests/test_studio_library.py
- Command line
-
hf download hf://spaces/2Btainment/absolution-omega/tests/test_studio_library.py
-
curl -L -o test_studio_library.py https://huggingface.co/spaces/2Btainment/absolution-omega/resolve/main/tests/test_studio_library.py
2.19 kB
| """Unified Studio v0.9: project library, explicit source selection and UI assets.""" | |
| from fastapi.testclient import TestClient | |
| from app.server import create_app | |
| def test_library_project_search_and_rename(tmp_path): | |
| app = create_app(tmp_path / "data") | |
| with TestClient(app) as client: | |
| assert client.get("/api/v1/projects").json() == {"projects": []} | |
| p = client.post("/api/v1/projects", json={"name": "Kick Session"}) | |
| assert p.status_code == 201 | |
| pid = p.json()["id"] | |
| items = client.get("/api/v1/projects").json()["projects"] | |
| assert len(items) == 1 | |
| assert items[0]["id"] == pid | |
| assert items[0]["name"] == "Kick Session" | |
| assert items[0]["asset"] is None | |
| assert items[0]["stem_count"] == 0 | |
| renamed = client.patch(f"/api/v1/projects/{pid}", json={"name": "Studio Session"}) | |
| assert renamed.status_code == 200 | |
| assert client.get(f"/api/v1/projects/{pid}").json()["name"] == "Studio Session" | |
| assert client.patch(f"/api/v1/projects/{pid}", json={"name": " "}).status_code == 422 | |
| assert client.get("/api/v1/projects").json()["projects"][0]["name"] == "Studio Session" | |
| def test_unified_studio_delivery(tmp_path): | |
| app = create_app(tmp_path / "data") | |
| with TestClient(app) as client: | |
| home = client.get("/") | |
| assert home.status_code == 200 | |
| assert "MULTITRACK SIGNAL MONITOR" in home.text | |
| assert 'id="projectList"' in home.text | |
| assert 'id="trackList"' in home.text | |
| assert 'id="noiseDetails"' in home.text | |
| assert "app.js" not in home.text | |
| assert "arrangement.js" not in home.text | |
| assert client.get("/static/studio.js").status_code == 200 | |
| assert client.get("/static/studio.css").status_code == 200 | |
| assert 'href="/static/studio-v1.css"' in home.text | |
| assert client.get("/static/studio-v1.css").status_code == 200 | |
| photo = client.get("/static/studio-room.jpg") | |
| assert photo.status_code == 200 | |
| assert photo.headers["content-type"].startswith("image/jpeg") | |
| assert 'id="libraryClose"' in home.text | |
| assert 'id="group-separate"' in home.text | |