test: port the v1 endpoint and browser tests to v2
HTTP tests against a running controller (make test-api HOST=ip). They snapshot every collection through /db and restore it afterwards. v1 behaviour v2 does not have yet is marked as a strict xfail. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
1 parent
9d628aa3c8
commit
4b42391a46
15 files changed
+2055
-1
No files matched your search
@@ -0,0 +1,31 @@
|
||||
import pytest
|
||||
|
||||
from helpers import missing
|
||||
|
||||
|
||||
def test_index(c):
|
||||
resp = c.get("/")
|
||||
assert resp.status_code == 200
|
||||
assert "LED Controller" in resp.text
|
||||
|
||||
|
||||
def test_favicon(c):
|
||||
assert c.get("/favicon.ico").status_code == 204
|
||||
|
||||
|
||||
@pytest.mark.parametrize("path", ["style.css", "zones.js", "presets.js", "profiles.js", "devices.js"])
|
||||
def test_static(c, path):
|
||||
assert c.get(f"/static/{path}").status_code == 200
|
||||
|
||||
|
||||
def test_settings_page(c):
|
||||
resp = c.get("/settings/page")
|
||||
assert resp.status_code == 200
|
||||
assert "LED Controller" in resp.text
|
||||
|
||||
|
||||
@missing("/ws")
|
||||
def test_ws_rejects_plain_get(c):
|
||||
# A websocket endpoint refuses a request that is not an upgrade
|
||||
resp = c.get("/ws")
|
||||
assert resp.status_code in {400, 401, 403, 405, 426}
|
||||
Reference in new issue
Block a user