Commit graph

10 commits

Author SHA1 Message Date
Paul Gauthier
72a59e120c aider: Modified final test to check if a ValueError is raised.
# Context:
USER: the final test SHOULD raise ValueError
ASSISTANT: I understand that you want the final test in `tests/test_utils.py` to raise a `ValueError`. I will modify the test to check for the exception.

```python
tests/test_utils.py
<<<<<<< ORIGINAL
        # Should raise a ValueError!
        list(utils.find_original_update_blocks(edit))
=======
        with self.assertRaises(ValueError):
            list(utils.find_original_update_blocks(edit))
>>>>>>> UPDATED
```

Now, the final test in `tests/test_utils.py` will check if a `ValueError` is raised.
2023-05-29 07:14:42 -07:00
Paul Gauthier
a404698a92 added test_false_incomplete_edit_block 2023-05-29 07:07:08 -07:00
Paul Gauthier
92cd2f3ce6 isort 2023-05-28 22:47:38 -07:00
Paul Gauthier
92e091f5a6 fix bug if ORIG/UPD block is missing trailing newline; added test 2023-05-12 13:30:39 -07:00
Paul Gauthier
d45b7ae752 handle filenames above the triple quotes 2023-05-11 22:59:02 -07:00
Paul Gauthier
3ec7880dc8 added tests 2023-05-11 22:10:21 -07:00
Paul Gauthier
5444b45a93 aider: Added test for ValueError containing the word "Incomplete" in test_find_original_update_blocks_unclosed.
# Context:
USER: in test_find_original_update_blocks_unclosed, assert that it throws a valueerror containing the word "Incomplete"
ASSISTANT: To add the test for ValueError containing the word "Incomplete" in the `test_find_original_update_blocks_unclosed` function, you can use the `assertRaises` context manager and check if the exception message contains the word "Incomplete". Here's the change:

```python
tests/test_utils.py
<<<<<<< ORIGINAL
        utils.find_original_update_blocks(edit)
=======
        with self.assertRaises(ValueError) as cm:
            utils.find_original_update_blocks(edit)
        self.assertIn("Incomplete", str(cm.exception))
>>>>>>> UPDATED
```
2023-05-11 22:08:30 -07:00
Paul Gauthier
684b0e4964 Provide structured errors to GPT if it generates malformed ORIG/UPD blocks 2023-05-11 22:06:02 -07:00
Paul Gauthier
6133eb61c1 fix tests and bug 2023-05-11 17:15:19 -07:00
Paul Gauthier
6dd586c753 init testing 2023-05-11 17:11:22 -07:00
Renamed from aider/test_utils.py (Browse further)