Skip to content

Commit ff7ef9b

Browse files
committed
Unit test for /info endpoint handler
1 parent 89ea5ee commit ff7ef9b

File tree

1 file changed

+32
-0
lines changed

1 file changed

+32
-0
lines changed
Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
from app.endpoints.info import info_endpoint_handler
2+
from configuration import AppConfig
3+
4+
5+
def test_info_endpoint(mocker):
6+
"""Test the info endpoint handler."""
7+
config_dict = {
8+
"name": "foo",
9+
"service": {
10+
"host": "localhost",
11+
"port": 8080,
12+
"auth_enabled": False,
13+
"workers": 1,
14+
"color_log": True,
15+
"access_log": True,
16+
},
17+
"llama_stack": {
18+
"api_key": "xyzzy",
19+
"url": "http://x.y.com:1234",
20+
"use_as_library_client": False,
21+
},
22+
"user_data_collection": {
23+
"feedback_disabled": True,
24+
},
25+
}
26+
cfg = AppConfig()
27+
cfg.init_from_dict(config_dict)
28+
request = None
29+
response = info_endpoint_handler(request)
30+
assert response is not None
31+
assert response.name is not None
32+
assert response.version is not None

0 commit comments

Comments
 (0)