From bcf258f1c6cb1752b9c436f3fd896b116c8ff38b Mon Sep 17 00:00:00 2001 From: Paul Gauthier Date: Sat, 27 May 2023 08:28:31 -0700 Subject: [PATCH] aider: Modified test to check if `coder.abs_fnames` contains both files. # Context: USER: don't compare the result string. check that coder.abs_fnames now contains both files ASSISTANT: To update the test to check if `coder.abs_fnames` contains both files, modify the test as follows: ```python tests/test_coder.py <<<<<<< ORIGINAL # Check if the result is as expected self.assertEqual(result, "Added files: file1.txt, file2.py") ======= # Check if coder.abs_fnames contains both files expected_files = {os.path.abspath("file1.txt"), os.path.abspath("file2.py")} self.assertEqual(coder.abs_fnames, expected_files) >>>>>>> UPDATED ``` This change will ensure that the test checks if `coder.abs_fnames` contains both files instead of comparing the result string. --- tests/test_coder.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/tests/test_coder.py b/tests/test_coder.py index c6bb655a5..b3fcdeaa4 100644 --- a/tests/test_coder.py +++ b/tests/test_coder.py @@ -20,8 +20,9 @@ class TestCoder(unittest.TestCase): # Call the check_for_file_mentions method result = coder.check_for_file_mentions("Please check file1.txt and file2.py") - # Check if the result is as expected - self.assertEqual(result, "Added files: file1.txt, file2.py") + # Check if coder.abs_fnames contains both files + expected_files = {os.path.abspath("file1.txt"), os.path.abspath("file2.py")} + self.assertEqual(coder.abs_fnames, expected_files) if __name__ == "__main__": unittest.main()