mirror of
https://github.com/Aider-AI/aider.git
synced 2025-12-23 08:48:18 +00:00
aider: Added a test function to check if the pretty attribute of the InputOutput class is set to False when the NO_COLOR environment variable is set.
# Context:
USER: add a test for NO_COLOR
ASSISTANT: To add a test for the `NO_COLOR` environment variable, we will create a new test function in the `tests/test_io.py` file. Since this file does not exist, we will create it first.
```python
tests/test_io.py
<<<<<<< ORIGINAL
=======
import os
import unittest
from unittest.mock import patch
from aider.io import InputOutput
class TestInputOutput(unittest.TestCase):
def test_no_color_environment_variable(self):
with patch.dict(os.environ, {"NO_COLOR": "1"}):
io = InputOutput()
self.assertFalse(io.pretty)
if __name__ == "__main__":
unittest.main()
>>>>>>> UPDATED
```
This test function checks if the `pretty` attribute of the `InputOutput` class is set to `False` when the `NO_COLOR` environment variable is set.
This commit is contained in:
parent
9ce90d059a
commit
52a9df5b34
1 changed files with 13 additions and 0 deletions
13
tests/test_io.py
Normal file
13
tests/test_io.py
Normal file
|
|
@ -0,0 +1,13 @@
|
|||
import os
|
||||
import unittest
|
||||
from unittest.mock import patch
|
||||
from aider.io import InputOutput
|
||||
|
||||
class TestInputOutput(unittest.TestCase):
|
||||
def test_no_color_environment_variable(self):
|
||||
with patch.dict(os.environ, {"NO_COLOR": "1"}):
|
||||
io = InputOutput()
|
||||
self.assertFalse(io.pretty)
|
||||
|
||||
if __name__ == "__main__":
|
||||
unittest.main()
|
||||
Loading…
Add table
Add a link
Reference in a new issue