def test_get_settings(c): resp = c.get("/settings") assert resp.status_code == 200 assert "wifi_channel" in resp.json() def test_wifi_channel(c): assert c.put("/settings/settings", json={"wifi_channel": 11}).status_code == 200 assert c.get("/settings").json()["wifi_channel"] == 11 def test_wifi_channel_out_of_range(c): assert c.put("/settings/settings", json={"wifi_channel": 12}).status_code == 400 def test_global_brightness(c): assert c.put("/settings/settings", json={"global_brightness": 42}).status_code == 200 assert c.get("/settings").json().get("global_brightness") == 42 def test_global_brightness_out_of_range(c): assert c.put("/settings/settings", json={"global_brightness": 300}).status_code == 400