From 72a59e120c1ef410da599c9dd62bbd98dc60735d Mon Sep 17 00:00:00 2001 From: Paul Gauthier Date: Mon, 29 May 2023 07:14:42 -0700 Subject: [PATCH] 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. --- tests/test_utils.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/tests/test_utils.py b/tests/test_utils.py index 7f1cce6e2..3b2748239 100644 --- a/tests/test_utils.py +++ b/tests/test_utils.py @@ -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,8 +195,8 @@ 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 - list(utils.find_original_update_blocks(edit)) + with self.assertRaises(ValueError): + list(utils.find_original_update_blocks(edit)) if __name__ == "__main__":