From 2a4b6da1d97cb13471fd94f7fcbffce7ad3d342d Mon Sep 17 00:00:00 2001 From: "Paul Gauthier (aider)" Date: Thu, 1 Aug 2024 16:58:51 -0300 Subject: [PATCH] test: Ensure Linter is called with correct filename --- tests/basic/test_main.py | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/tests/basic/test_main.py b/tests/basic/test_main.py index c640a8e40..10b3e595e 100644 --- a/tests/basic/test_main.py +++ b/tests/basic/test_main.py @@ -353,8 +353,12 @@ class TestMain(TestCase): # Run main with --lint option main(["--lint", "--yes"]) - # Check if the Linter was called with the correct file - MockLinter.assert_called_once_with(dirty_file) + # Check if the Linter was called with a filename ending in "dirty_file.py" + # but not ending in "subdir/dirty_file.py" + MockLinter.assert_called_once() + called_arg = MockLinter.call_args[0][0] + self.assertTrue(called_arg.endswith("dirty_file.py")) + self.assertFalse(called_arg.endswith("subdir/dirty_file.py")) def test_verbose_mode_lists_env_vars(self): self.create_env_file(".env", "AIDER_DARK_MODE=on")