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.
This commit is contained in:
Paul Gauthier 2023-05-29 07:14:42 -07:00
parent 445c253abc
commit 72a59e120c

View file

@ -154,7 +154,7 @@ aider/coder.py
# Should not raise a ValueError
list(utils.find_original_update_blocks(edit))
def test_false_incomplete_edit_block(self):
def test_incomplete_edit_block_missing_filename(self):
edit = """
No problem! Here are the changes to patch `subprocess.check_output` instead of `subprocess.run` in both tests:
@ -195,7 +195,7 @@ tests/test_repomap.py
These changes replace the `subprocess.run` patches with `subprocess.check_output` patches in both `test_check_for_ctags_failure` and `test_check_for_ctags_success` tests.
"""
# Should not raise a ValueError
with self.assertRaises(ValueError):
list(utils.find_original_update_blocks(edit))