File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1+ from synapdrive_ai .interface import web_dashboard
2+
3+
4+ def test_dashboard_home_route ():
5+ client = web_dashboard .app .test_client ()
6+ r = client .get ("/" )
7+ assert r .status_code == 200
8+ assert b"SynapDrive-AI Dashboard" in r .data
9+
10+
11+ def test_dashboard_text_api ():
12+ client = web_dashboard .app .test_client ()
13+ r = client .post ("/api/run/text" , json = {"text" : "stop" , "image" : "hazard" })
14+ assert r .status_code == 200
15+ payload = r .get_json ()
16+ assert "status" in payload
17+ assert "result" in payload
18+ assert payload ["result" ]["status" ] in {"success" , "blocked" }
19+
20+
21+ def test_dashboard_log_api ():
22+ client = web_dashboard .app .test_client ()
23+ # generate one action so log is non-empty
24+ client .post ("/api/run/text" , json = {"text" : "move left" , "image" : "road" })
25+
26+ r = client .get ("/api/log" )
27+ assert r .status_code == 200
28+ payload = r .get_json ()
29+ assert "count" in payload
30+ assert "log" in payload
31+ assert isinstance (payload ["log" ], list )
You can’t perform that action at this time.
0 commit comments