mirror of
https://github.com/Aider-AI/aider.git
synced 2025-06-01 18:25:00 +00:00
![]() # Context: USER: add setUp and tearDown. in setUp, make a remember the cwd, make a tempdir and chdir there. in teardown, chdir back to the original dir ASSISTANT: I will add `setUp` and `tearDown` methods to the `TestCommands` class in the `tests/test_commands.py` file. In the `setUp` method, I will ^C KeyboardInterrupt USER: add setUp and tearDown. in setUp, make a remember the cwd, make a tempdir and chdir there. in teardown, chdir back to the original dir ASSISTANT: I will add `setUp` and `tearDown` methods to the `TestCommands` class in the `tests/test_commands.py` file. In the `setUp` method, I will remember the current working directory, create a temporary directory, and change the working directory to the temporary directory. In the `tearDown` method, I will change the working directory back to the original directory. Here are the changes: ```python tests/test_commands.py <<<<<<< ORIGINAL class TestCommands(TestCase): def test_cmd_add(self): ======= import shutil class TestCommands(TestCase): def setUp(self): self.original_cwd = os.getcwd() self.tempdir = tempfile.mkdtemp() os.chdir(self.tempdir) def tearDown(self): os.chdir(self.original_cwd) shutil.rmtree(self.tempdir) def test_cmd_add(self): >>>>>>> UPDATED ``` |
||
---|---|---|
.. | ||
__init__.py | ||
test_coder.py | ||
test_commands.py | ||
test_io.py | ||
test_main.py | ||
test_repomap.py | ||
test_utils.py |