Files
my-pal-mcp-server/tests/test_line_numbers_integration.py
Fahad 99fab3e83d Docs added to show how a new provider is added
Docs added to show how a new tool is created
All tools should add numbers to code for models to be able to reference if needed
Enabled line numbering for code for all tools to use
Additional tests to validate line numbering is not added to git diffs
2025-06-15 07:02:27 +04:00

50 lines
1.7 KiB
Python

"""
Integration test demonstrating that all tools get line numbers by default.
"""
from tools.analyze import AnalyzeTool
from tools.chat import ChatTool
from tools.codereview import CodeReviewTool
from tools.debug import DebugIssueTool
from tools.precommit import Precommit
from tools.refactor import RefactorTool
from tools.testgen import TestGenTool
class TestLineNumbersIntegration:
"""Test that all tools inherit line number behavior correctly."""
def test_all_tools_want_line_numbers(self):
"""Verify that all tools want line numbers by default."""
tools = [
ChatTool(),
AnalyzeTool(),
CodeReviewTool(),
DebugIssueTool(),
RefactorTool(),
TestGenTool(),
Precommit(),
]
for tool in tools:
assert tool.wants_line_numbers_by_default(), f"{tool.get_name()} should want line numbers by default"
def test_no_tools_override_line_numbers(self):
"""Verify that no tools override the base class line number behavior."""
# Check that tools don't have their own wants_line_numbers_by_default method
tools_classes = [
ChatTool,
AnalyzeTool,
CodeReviewTool,
DebugIssueTool,
RefactorTool,
TestGenTool,
Precommit,
]
for tool_class in tools_classes:
# Check if the method is defined in the tool class itself
# (not inherited from base)
has_override = "wants_line_numbers_by_default" in tool_class.__dict__
assert not has_override, f"{tool_class.__name__} should not override wants_line_numbers_by_default"