fix: ensure the entire file will be read when the start_line is None (#325)

This commit is contained in:
Lucas Gomide
2025-06-11 10:02:56 -03:00
committed by GitHub
parent 748f438232
commit dc2d4af8ea
2 changed files with 11 additions and 4 deletions

View File

@@ -139,6 +139,11 @@ def test_file_read_tool_zero_or_negative_start_line():
with patch("builtins.open", mock_open(read_data=file_content)):
tool = FileReadTool()
# Test with start_line = None
result = tool._run(file_path=test_file, start_line=None)
expected = "".join(lines) # Should read the entire file
assert result == expected
# Test with start_line = 0
result = tool._run(file_path=test_file, start_line=0)
expected = "".join(lines) # Should read the entire file