From 1243c0b644e7cacb9cfdf093912e02d926eed8b0 Mon Sep 17 00:00:00 2001 From: Gabriel Luiz Freitas Almeida Date: Tue, 19 Sep 2023 14:08:12 -0300 Subject: [PATCH] =?UTF-8?q?=F0=9F=90=9B=20fix(test=5Fllms=5Ftemplate.py):?= =?UTF-8?q?=20remove=20unused=20test=5Fllms=5Fsettings=20function=20to=20i?= =?UTF-8?q?mprove=20code=20readability=20and=20maintainability=20?= =?UTF-8?q?=F0=9F=90=9B=20fix(test=5Ftemplate.py):=20update=20type=20annot?= =?UTF-8?q?ation=20in=20test=5Fformat=5Fdict=20function=20to=20reflect=20t?= =?UTF-8?q?he=20correct=20type=20of=20the=20field=20=F0=9F=90=9B=20fix(tes?= =?UTF-8?q?t=5Fprompts=5Ftemplate.py):=20update=20type=20annotation=20in?= =?UTF-8?q?=20test=5Fprompt=5Ftemplate=20function=20to=20reflect=20the=20c?= =?UTF-8?q?orrect=20type=20of=20the=20field?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- tests/test_llms_template.py | 17 ++++------------- tests/test_prompts_template.py | 2 +- tests/test_template.py | 4 ++-- 3 files changed, 7 insertions(+), 16 deletions(-) diff --git a/tests/test_llms_template.py b/tests/test_llms_template.py index 14e151479..3da176192 100644 --- a/tests/test_llms_template.py +++ b/tests/test_llms_template.py @@ -2,15 +2,6 @@ from fastapi.testclient import TestClient from langflow.services.utils import get_settings_manager -def test_llms_settings(client: TestClient, logged_in_headers): - settings_manager = get_settings_manager() - response = client.get("api/v1/all", headers=logged_in_headers) - assert response.status_code == 200 - json_response = response.json() - llms = json_response["llms"] - assert set(llms.keys()) == set(settings_manager.settings.LLMS) - - # def test_hugging_face_hub(client: TestClient): # response = client.get("api/v1/all") # assert response.status_code == 200 @@ -85,7 +76,7 @@ def test_llms_settings(client: TestClient, logged_in_headers): # "multiline": False, # "password": False, # "name": "model_kwargs", -# "type": "code", +# "type": "dict" , # "list": False, # "advanced": True, # } @@ -279,7 +270,7 @@ def test_openai(client: TestClient, logged_in_headers): "multiline": False, "password": False, "name": "model_kwargs", - "type": "code", + "type": "dict", "list": False, "advanced": True, "info": "", @@ -334,7 +325,7 @@ def test_openai(client: TestClient, logged_in_headers): "multiline": False, "password": False, "name": "logit_bias", - "type": "code", + "type": "dict", "list": False, "advanced": False, "info": "", @@ -451,7 +442,7 @@ def test_chat_open_ai(client: TestClient, logged_in_headers): "multiline": False, "password": False, "name": "model_kwargs", - "type": "code", + "type": "dict", "list": False, "advanced": True, "info": "", diff --git a/tests/test_prompts_template.py b/tests/test_prompts_template.py index 676448f73..434691038 100644 --- a/tests/test_prompts_template.py +++ b/tests/test_prompts_template.py @@ -55,7 +55,7 @@ def test_prompt_template(client: TestClient, logged_in_headers): "multiline": False, "password": False, "name": "partial_variables", - "type": "code", + "type": "dict", "list": False, "advanced": False, "info": "", diff --git a/tests/test_template.py b/tests/test_template.py index 4be6dff06..81f2a6020 100644 --- a/tests/test_template.py +++ b/tests/test_template.py @@ -135,7 +135,7 @@ def test_format_dict(): } expected_output = { "field1": { - "type": "code", # Mapping type is replaced with dict which is replaced with code + "type": "dict[str, int]", # Mapping type is replaced with dict which is replaced with code "required": False, "list": False, "show": False, @@ -249,7 +249,7 @@ def test_format_dict(): } expected_output = { "field1": { - "type": "code", + "type": "Dict[str, int]", "required": False, "list": False, "show": False,