"""Router tests - LoFi endpoints.""" from app.models.lofi import LofiChannel from app.db.database import SessionLocal class TestListChannels: def test_list_channels(self, client): r = client.get("/api/lofi/channels") assert r.status_code == 200 channels = r.json() assert len(channels) >= 3 assert all("stream_url" in c for c in channels) class TestAddChannel: def test_add_channel(self, client): r = client.post("/api/lofi/add", json={ "name": "Custom Lofi", "stream_url": "https://example.com/stream", "description": "Custom channel" }) assert r.status_code == 200 data = r.json() assert data["name"] == "Custom Lofi" assert data["source_platform"] == "youtube" def test_add_duplicate(self, client): client.post("/api/lofi/add", json={"name": "Dup", "stream_url": "https://a.com"}) r = client.post("/api/lofi/add", json={"name": "Dup", "stream_url": "https://b.com"}) assert r.status_code == 400