Skip to content

Commit 541f248

Browse files
committed
test(api): add test case for config api
1 parent 8b04799 commit 541f248

File tree

1 file changed

+24
-0
lines changed

1 file changed

+24
-0
lines changed

ibis-server/tests/test_main.py

+24
Original file line numberDiff line numberDiff line change
@@ -15,3 +15,27 @@ def test_health():
1515
response = client.get("/health")
1616
assert response.status_code == 200
1717
assert response.json() == {"status": "ok"}
18+
19+
20+
def test_config():
21+
response = client.get("/config")
22+
assert response.status_code == 200
23+
assert response.json() == {
24+
"wren_engine_endpoint": "http://localhost:8080",
25+
"diagnose": False,
26+
}
27+
28+
29+
def test_update_diagnose():
30+
response = client.patch("/config", json={"diagnose": True})
31+
assert response.status_code == 200
32+
assert response.json()["diagnose"] is True
33+
response = client.get("/config")
34+
assert response.status_code == 200
35+
assert response.json()["diagnose"] is True
36+
response = client.patch("/config", json={"diagnose": False})
37+
assert response.status_code == 200
38+
assert response.json()["diagnose"] is False
39+
response = client.get("/config")
40+
assert response.status_code == 200
41+
assert response.json()["diagnose"] is False

0 commit comments

Comments
 (0)