From ff7ef9b121cbabb18ac1761edd8550e0baf42494 Mon Sep 17 00:00:00 2001 From: Pavel Tisnovsky Date: Mon, 9 Jun 2025 14:07:26 +0200 Subject: [PATCH] Unit test for /info endpoint handler --- tests/unit/app/endpoints/test_info.py | 32 +++++++++++++++++++++++++++ 1 file changed, 32 insertions(+) create mode 100644 tests/unit/app/endpoints/test_info.py diff --git a/tests/unit/app/endpoints/test_info.py b/tests/unit/app/endpoints/test_info.py new file mode 100644 index 00000000..9b36cbfa --- /dev/null +++ b/tests/unit/app/endpoints/test_info.py @@ -0,0 +1,32 @@ +from app.endpoints.info import info_endpoint_handler +from configuration import AppConfig + + +def test_info_endpoint(mocker): + """Test the info endpoint handler.""" + config_dict = { + "name": "foo", + "service": { + "host": "localhost", + "port": 8080, + "auth_enabled": False, + "workers": 1, + "color_log": True, + "access_log": True, + }, + "llama_stack": { + "api_key": "xyzzy", + "url": "http://x.y.com:1234", + "use_as_library_client": False, + }, + "user_data_collection": { + "feedback_disabled": True, + }, + } + cfg = AppConfig() + cfg.init_from_dict(config_dict) + request = None + response = info_endpoint_handler(request) + assert response is not None + assert response.name is not None + assert response.version is not None