From 6ba8f42a17d9e56c7bc8dbe50b25ea13797fa809 Mon Sep 17 00:00:00 2001 From: Alexander_Kabui Date: Mon, 14 Jul 2025 17:02:27 +0300 Subject: feat: Add unittest for cleaning up gnqna queries. --- tests/unit/test_llm.py | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'tests/unit/test_llm.py') diff --git a/tests/unit/test_llm.py b/tests/unit/test_llm.py index 8fbaba6..3b91918 100644 --- a/tests/unit/test_llm.py +++ b/tests/unit/test_llm.py @@ -4,6 +4,7 @@ import pytest from gn3.llms.process import fetch_pubmed from gn3.llms.process import parse_context from gn3.llms.process import format_bibliography_info +from gn3.api.llm import clean_query @pytest.mark.unit_test @@ -104,3 +105,11 @@ def test_fetching_pubmed_info(monkeypatch): assert (fetch_pubmed(data, "/pubmed.json", "data/") == expected_results) + + +@pytest.mark.unit_test +def test_clean_query(): + """Test function for cleaning up query""" + assert clean_query("!what is genetics.") == "what is genetics" + assert clean_query("hello test?") == "hello test" + assert clean_query(" hello test with space?") == "hello test with space" -- cgit 1.4.1