From de4a7b719d507259e6cd99d07d2c6a83215b1bd9 Mon Sep 17 00:00:00 2001 From: ishaan-jaff Date: Mon, 4 Dec 2023 13:16:19 -0800 Subject: [PATCH] (test) proxy: reading config.yaml --- .../proxy/example_config_yaml/simple_config.yaml | 4 ++++ litellm/tests/test_proxy_server.py | 15 ++++++++++++++- 2 files changed, 18 insertions(+), 1 deletion(-) create mode 100644 litellm/proxy/example_config_yaml/simple_config.yaml diff --git a/litellm/proxy/example_config_yaml/simple_config.yaml b/litellm/proxy/example_config_yaml/simple_config.yaml new file mode 100644 index 000000000..14b39a125 --- /dev/null +++ b/litellm/proxy/example_config_yaml/simple_config.yaml @@ -0,0 +1,4 @@ +model_list: + - model_name: gpt-3.5-turbo + litellm_params: + model: gpt-3.5-turbo \ No newline at end of file diff --git a/litellm/tests/test_proxy_server.py b/litellm/tests/test_proxy_server.py index 805e2a860..858277dee 100644 --- a/litellm/tests/test_proxy_server.py +++ b/litellm/tests/test_proxy_server.py @@ -164,4 +164,17 @@ def test_chat_completion_optional_params(): pytest.fail("LiteLLM Proxy test failed. Exception", e) # Run the test -test_chat_completion_optional_params() +# test_chat_completion_optional_params() + +# Test Reading config.yaml file +from litellm.proxy.proxy_server import load_router_config + +def test_load_router_config(): + try: + print("testing reading config") + result = load_router_config(router=None, config_file_path="../proxy/example_config_yaml/simple_config.yaml") + print(result) + assert len(result[1]) == 1 + except Exception as e: + pytest.fail("Proxy: Got exception reading config", e) +# test_load_router_config()