Skip to content

Commit ce6974a

Browse files
kopekCgithub-actions[bot]
authored andcommitted
Automated pre-commit update
1 parent 62e1ab4 commit ce6974a

File tree

1 file changed

+6
-15
lines changed

1 file changed

+6
-15
lines changed

tests/unit/codegen/extensions/test_tools.py

Lines changed: 6 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,5 @@
11
"""Tests for codebase tools."""
22

3-
import subprocess
4-
53
import pytest
64

75
from codegen.extensions.tools import (
@@ -17,7 +15,6 @@
1715
replacement_edit,
1816
reveal_symbol,
1917
run_codemod,
20-
search,
2118
semantic_edit,
2219
semantic_search,
2320
view_file,
@@ -68,8 +65,7 @@ def large_codebase(tmpdir):
6865
for i in range(1, 401): # This will create a 400+ line file
6966
if i % 20 == 0:
7067
# Add some class methods periodically
71-
large_file_lines.extend(
72-
[" @classmethod", f" def class_method_{i}(cls) -> None:", f" print('Class method {i}')", " return None", ""])
68+
large_file_lines.extend([" @classmethod", f" def class_method_{i}(cls) -> None:", f" print('Class method {i}')", " return None", ""])
7369
else:
7470
# Add regular methods
7571
large_file_lines.extend(
@@ -124,8 +120,7 @@ def test_view_file_pagination(large_codebase):
124120
assert "def method_251" not in result.content # Method after page 1
125121

126122
# Test custom pagination range
127-
result = view_file(large_codebase, "src/large_file.py",
128-
start_line=200, end_line=250)
123+
result = view_file(large_codebase, "src/large_file.py", start_line=200, end_line=250)
129124
assert result.status == "success"
130125
assert result.start_line == 200
131126
assert result.end_line == 250
@@ -158,8 +153,7 @@ def test_view_file_pagination(large_codebase):
158153
assert len(result.content.splitlines()) <= 100
159154

160155
# Test line numbers display
161-
result = view_file(large_codebase, "src/large_file.py",
162-
start_line=198, end_line=202, line_numbers=True)
156+
result = view_file(large_codebase, "src/large_file.py", start_line=198, end_line=202, line_numbers=True)
163157
assert result.status == "success"
164158
assert "198|" in result.content
165159
assert "199|" in result.content
@@ -168,8 +162,7 @@ def test_view_file_pagination(large_codebase):
168162
assert "202|" in result.content
169163

170164
# Test without line numbers
171-
result = view_file(large_codebase, "src/large_file.py",
172-
start_line=198, end_line=202, line_numbers=False)
165+
result = view_file(large_codebase, "src/large_file.py", start_line=198, end_line=202, line_numbers=False)
173166
assert result.status == "success"
174167
assert "198|" not in result.content
175168
assert "199|" not in result.content
@@ -178,8 +171,7 @@ def test_view_file_pagination(large_codebase):
178171
def test_view_file_pagination_edge_cases(large_codebase):
179172
"""Test edge cases for file pagination."""
180173
# Test start_line > end_line (should respect provided end_line)
181-
result = view_file(large_codebase, "src/large_file.py",
182-
start_line=200, end_line=100)
174+
result = view_file(large_codebase, "src/large_file.py", start_line=200, end_line=100)
183175
assert result.status == "success"
184176
assert result.start_line == 200
185177
assert result.end_line == 100 # Should respect provided end_line
@@ -193,8 +185,7 @@ def test_view_file_pagination_edge_cases(large_codebase):
193185
assert result.has_more is False
194186

195187
# Test end_line > file length (should truncate to file length)
196-
result = view_file(large_codebase, "src/large_file.py",
197-
start_line=200, end_line=2000)
188+
result = view_file(large_codebase, "src/large_file.py", start_line=200, end_line=2000)
198189
assert result.status == "success"
199190
assert result.start_line == 200
200191
# Should respect max_lines and file length

0 commit comments

Comments
 (0)