style: Format code and fix whitespace issues

This commit is contained in:
Paul Gauthier (aider) 2025-02-06 08:43:11 -08:00
parent 5c9746e209
commit b5d17b99df
2 changed files with 15 additions and 18 deletions

View file

@ -65,16 +65,16 @@ def test_get_roots_to_watch(tmp_path):
# Create a test directory structure
(tmp_path / "included").mkdir()
(tmp_path / "excluded").mkdir()
io = InputOutput(pretty=False, fancy_input=False, yes=False)
coder = MinimalCoder(io)
# Test with no gitignore
watcher = FileWatcher(coder, root=tmp_path)
roots = watcher.get_roots_to_watch()
assert len(roots) == 1
assert roots[0] == str(tmp_path)
# Test with gitignore
gitignore = tmp_path / ".gitignore"
gitignore.write_text("excluded/")
@ -83,20 +83,22 @@ def test_get_roots_to_watch(tmp_path):
assert len(roots) == 1
assert Path(roots[0]).name == "included"
def test_handle_changes():
io = InputOutput(pretty=False, fancy_input=False, yes=False)
coder = MinimalCoder(io)
watcher = FileWatcher(coder)
# Test no changes
assert not watcher.handle_changes([])
assert len(watcher.changed_files) == 0
# Test with changes
changes = [('modified', '/path/to/file.py')]
changes = [("modified", "/path/to/file.py")]
assert watcher.handle_changes(changes)
assert len(watcher.changed_files) == 1
assert str(Path('/path/to/file.py')) in watcher.changed_files
assert str(Path("/path/to/file.py")) in watcher.changed_files
def test_ai_comment_pattern():
# Create minimal IO and Coder instances for testing