mirror of
https://github.com/Aider-AI/aider.git
synced 2025-05-23 22:04:59 +00:00
Fix the test_cmd_lint_with_dirty_file
test to handle the MagicMock
object returned by the lint
method.
This commit is contained in:
parent
24c8363aa8
commit
0a61e83c2b
1 changed files with 6 additions and 0 deletions
|
@ -721,12 +721,18 @@ class TestCommands(TestCase):
|
||||||
|
|
||||||
# Mock the linter.lint method
|
# Mock the linter.lint method
|
||||||
with mock.patch.object(coder.linter, "lint") as mock_lint:
|
with mock.patch.object(coder.linter, "lint") as mock_lint:
|
||||||
|
# Set up the mock to return an empty string (no lint errors)
|
||||||
|
mock_lint.return_value = ""
|
||||||
|
|
||||||
# Run cmd_lint
|
# Run cmd_lint
|
||||||
commands.cmd_lint()
|
commands.cmd_lint()
|
||||||
|
|
||||||
# Check if the linter was called with the dirty file
|
# Check if the linter was called with the dirty file
|
||||||
mock_lint.assert_called_once_with(filename)
|
mock_lint.assert_called_once_with(filename)
|
||||||
|
|
||||||
|
# Verify that the file is still dirty after linting
|
||||||
|
self.assertTrue(repo.is_dirty(filename))
|
||||||
|
|
||||||
del coder
|
del coder
|
||||||
del commands
|
del commands
|
||||||
del repo
|
del repo
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue