Skip to content

Commit 5b88482

Browse files
committed
LCORE-303: fixed all remaining pylint issues
1 parent d3522af commit 5b88482

5 files changed

Lines changed: 21 additions & 10 deletions

File tree

tests/unit/auth/test_k8s.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
"""Unit tests for auth/k8s module."""
22

3+
# pylint: disable=too-many-arguments,too-many-positional-arguments,too-few-public-methods,protected-access
4+
35
import os
46

57
import pytest

tests/unit/utils/test_checks.py

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,18 @@
1-
import os
2-
import pytest
1+
"""Unit tests for functions defined in utils/checks module."""
32

3+
import os
44
from unittest.mock import patch
55

6+
import pytest
7+
68
from utils import checks
79

810

9-
@pytest.fixture
10-
def input_file(tmp_path):
11+
@pytest.fixture(name="input_file")
12+
def input_file_fixture(tmp_path):
1113
"""Create file manually using the tmp_path fixture."""
1214
filename = os.path.join(tmp_path, "mydoc.csv")
13-
with open(filename, "wt") as fout:
15+
with open(filename, "wt", encoding="utf-8") as fout:
1416
fout.write("some content!")
1517
return filename
1618

tests/unit/utils/test_common.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,10 @@
11
"""Test module for utils/common.py."""
22

3-
import pytest
43
from unittest.mock import Mock, AsyncMock
54
from logging import Logger
65

6+
import pytest
7+
78
from utils.common import (
89
retrieve_user_id,
910
register_mcp_servers_async,

tests/unit/utils/test_suid.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,11 @@
1+
"""Unit tests for functions defined in utils.suid module."""
2+
13
from utils import suid
24

35

46
class TestSUID:
7+
"""Unit tests for functions defined in utils.suid module."""
8+
59
def test_get_suid(self):
610
"""Test that get_suid generates a valid UUID."""
711
suid_value = suid.get_suid()

tests/unit/utils/test_types.py

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,13 @@
1-
"""Test module for utils/types.py."""
1+
"""Unit tests for functionns defined in utils/types.py."""
22

33
from unittest.mock import Mock
44

55
from utils.types import GraniteToolParser
66

77

88
class TestGraniteToolParser:
9+
"""Unit tests for functionns defined in utils/types.py."""
10+
911
def test_get_tool_parser_when_model_is_is_not_granite(self):
1012
"""Test that the tool_parser is None when model_id is not a granite model."""
1113
assert (
@@ -29,12 +31,12 @@ def test_get_tool_calls_from_completion_message_when_none(self):
2931
assert tool_parser.get_tool_calls(None) == [], "get_tool_calls should return []"
3032

3133
def test_get_tool_calls_from_completion_message_when_not_none(self):
32-
"""Test that get_tool_calls returns an empty array when CompletionMessage has no tool_calls."""
34+
"""Test that get_tool_calls returns an empty array when CompletionMessage has no tool_calls.""" # pylint: disable=line-too-long
3335
tool_parser = GraniteToolParser.get_parser("granite-3.3-8b-instruct")
3436
completion_message = Mock()
3537
completion_message.tool_calls = []
36-
assert (
37-
tool_parser.get_tool_calls(completion_message) == []
38+
assert not tool_parser.get_tool_calls(
39+
completion_message
3840
), "get_tool_calls should return []"
3941

4042
def test_get_tool_calls_from_completion_message_when_message_has_tool_calls(self):

0 commit comments

Comments
 (0)