aider/tests
Paul Gauthier 83f084a800 aider: Added assertion to check if repo.iter_commits(repo.active_branch.name) raises git.exc.GitCommandError.
# Aider chat conversation:

ASSISTANT: I understand that you want to complete the TODO task in the `test_new_file_edit_one_commit` method in the `tests/test_coder.py` file. However, the task is not clear. The TODO comment says:

```python
### TODO: assert that the next line raises git.exc.GitCommandError
```

This suggests that the following line of code should raise a `git.exc.GitCommandError` exception:

```python
repo.iter_commits(repo.active_branch.name)
```

To complete this task, we need to add a test assertion that checks if this line of code raises the `git.exc.GitCommandError` exception. We can use the `assertRaises` method from the `unittest.TestCase` class to do this.

Here is the change that needs to be made:

<source>python
tests/test_coder.py
<<<<<<< HEAD
            ### TODO: assert that the next line raises git.exc.GitCommandError
            repo.iter_commits(repo.active_branch.name)
=======
            with self.assertRaises(git.exc.GitCommandError):
                repo.iter_commits(repo.active_branch.name)
>>>>>>> updated
</source>

This change will add an assertion that checks if the `repo.iter_commits(repo.active_branch.name)` line of code raises a `git.exc.GitCommandError` exception. If the line of code does not raise this exception, the test will fail.
2023-08-18 08:00:04 -07:00
..
__init__.py aider: Added empty __init__.py file to tests directory to fix ModuleNotFoundError when running tests. 2023-05-11 17:12:42 -07:00
test_coder.py aider: Added assertion to check if repo.iter_commits(repo.active_branch.name) raises git.exc.GitCommandError. 2023-08-18 08:00:04 -07:00
test_commands.py Fixed /commit after repo refactor, added test coverage 2023-08-04 06:39:04 -03:00
test_editblock.py updated tests, disabled send cache 2023-08-10 12:27:46 -03:00
test_io.py Fix test 2023-07-10 15:33:46 -07:00
test_main.py tests and bugfix 2023-07-24 17:47:53 -03:00
test_models.py More Model test cases 2023-06-21 14:13:34 -07:00
test_repo.py fixed spurious "Adding to git" messages when running aider in subdir of repo 2023-08-17 08:32:44 -07:00
test_repomap.py linting 2023-07-21 16:08:50 -03:00
test_sendchat.py move tests to test_sendchat.py 2023-07-21 14:17:14 -03:00
test_wholefile.py fix wholefile tests 2023-08-17 11:08:50 -07:00
utils.py tests and bugfix 2023-07-24 17:47:53 -03:00