diff --git a/tests/unit/auth/test_k8s.py b/tests/unit/auth/test_k8s.py index 4b121fa6..e7e6b477 100644 --- a/tests/unit/auth/test_k8s.py +++ b/tests/unit/auth/test_k8s.py @@ -1,5 +1,7 @@ """Unit tests for auth/k8s module.""" +# pylint: disable=too-many-arguments,too-many-positional-arguments,too-few-public-methods,protected-access + import os import pytest diff --git a/tests/unit/utils/test_checks.py b/tests/unit/utils/test_checks.py index e01b46fc..e78e5b9f 100644 --- a/tests/unit/utils/test_checks.py +++ b/tests/unit/utils/test_checks.py @@ -1,16 +1,18 @@ -import os -import pytest +"""Unit tests for functions defined in utils/checks module.""" +import os from unittest.mock import patch +import pytest + from utils import checks -@pytest.fixture -def input_file(tmp_path): +@pytest.fixture(name="input_file") +def input_file_fixture(tmp_path): """Create file manually using the tmp_path fixture.""" filename = os.path.join(tmp_path, "mydoc.csv") - with open(filename, "wt") as fout: + with open(filename, "wt", encoding="utf-8") as fout: fout.write("some content!") return filename diff --git a/tests/unit/utils/test_common.py b/tests/unit/utils/test_common.py index 0ca387f2..0b34e0de 100644 --- a/tests/unit/utils/test_common.py +++ b/tests/unit/utils/test_common.py @@ -1,9 +1,10 @@ """Test module for utils/common.py.""" -import pytest from unittest.mock import Mock, AsyncMock from logging import Logger +import pytest + from utils.common import ( retrieve_user_id, register_mcp_servers_async, diff --git a/tests/unit/utils/test_suid.py b/tests/unit/utils/test_suid.py index b0e33e8c..b9c44088 100644 --- a/tests/unit/utils/test_suid.py +++ b/tests/unit/utils/test_suid.py @@ -1,7 +1,11 @@ +"""Unit tests for functions defined in utils.suid module.""" + from utils import suid class TestSUID: + """Unit tests for functions defined in utils.suid module.""" + def test_get_suid(self): """Test that get_suid generates a valid UUID.""" suid_value = suid.get_suid() diff --git a/tests/unit/utils/test_types.py b/tests/unit/utils/test_types.py index 70f284de..441651d0 100644 --- a/tests/unit/utils/test_types.py +++ b/tests/unit/utils/test_types.py @@ -1,4 +1,4 @@ -"""Test module for utils/types.py.""" +"""Unit tests for functionns defined in utils/types.py.""" from unittest.mock import Mock @@ -6,6 +6,8 @@ class TestGraniteToolParser: + """Unit tests for functionns defined in utils/types.py.""" + def test_get_tool_parser_when_model_is_is_not_granite(self): """Test that the tool_parser is None when model_id is not a granite model.""" assert ( @@ -29,12 +31,12 @@ def test_get_tool_calls_from_completion_message_when_none(self): assert tool_parser.get_tool_calls(None) == [], "get_tool_calls should return []" def test_get_tool_calls_from_completion_message_when_not_none(self): - """Test that get_tool_calls returns an empty array when CompletionMessage has no tool_calls.""" + """Test that get_tool_calls returns an empty array when CompletionMessage has no tool_calls.""" # pylint: disable=line-too-long tool_parser = GraniteToolParser.get_parser("granite-3.3-8b-instruct") completion_message = Mock() completion_message.tool_calls = [] - assert ( - tool_parser.get_tool_calls(completion_message) == [] + assert not tool_parser.get_tool_calls( + completion_message ), "get_tool_calls should return []" def test_get_tool_calls_from_completion_message_when_message_has_tool_calls(self):