test(api): share one profile() fixture in conftest

Six test files each defined the same profile() fixture. It now lives once
in conftest.py, with test_profiles.py's 201 check on create.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
jimmyandClaude Opus 5.5 committed 2026-11-04 01:35:56 +13:00
1 parent 16a3d3aa26
commit 24d3c1149d
7 files changed
+14 -55

No files matched your search

-12
View File
@@ -1,21 +1,9 @@
import pytest
from helpers import new_id, unique
# Presets every new profile is seeded with (main's controllers/profile.py)
SEEDED = {"on", "off", "rainbow", "Colour Cycle", "transition", "flicker", "flame", "twinkle"}
@pytest.fixture
def profile(c):
resp = c.post("/profiles", json={"name": unique("pytest-profile")})
assert resp.status_code == 201
pid = new_id(resp)
assert c.post(f"/profiles/{pid}/apply").status_code == 200
yield pid
c.delete(f"/profiles/{pid}")
def test_list(c, profile):
resp = c.get("/profiles")
assert resp.status_code == 200