mirror of
https://github.com/Aider-AI/aider.git
synced 2025-05-22 05:14:59 +00:00
Add unit test to verify cmd_lint calls linter with correct filename
This commit is contained in:
parent
167abdf851
commit
33d9f46e25
1 changed files with 4 additions and 2 deletions
|
@ -742,8 +742,10 @@ class TestCommands(TestCase):
|
||||||
# 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 a filename string whose Path().name matches the expected filename
|
||||||
mock_lint.assert_called_once_with(Path(filename).name)
|
mock_lint.assert_called_once()
|
||||||
|
called_arg = mock_lint.call_args[0][0]
|
||||||
|
self.assertEqual(Path(called_arg).name, filename)
|
||||||
|
|
||||||
# Verify that the file is still dirty after linting
|
# Verify that the file is still dirty after linting
|
||||||
self.assertTrue(repo.is_dirty(filename))
|
self.assertTrue(repo.is_dirty(filename))
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue