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.
This commit is contained in:
Paul Gauthier 2023-05-27 08:28:31 -07:00
parent 4ac2143cc2
commit bcf258f1c6

View file

@ -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()