aider/tests/test_io.py
Paul Gauthier aedfa64eb9 Fix test
2023-07-10 15:33:46 -07:00

24 lines
714 B
Python

import os
import unittest
from unittest.mock import patch
from aider.io import AutoCompleter, 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)
def test_autocompleter_with_non_existent_file(self):
root = ""
rel_fnames = ["non_existent_file.txt"]
addable_rel_fnames = []
commands = None
autocompleter = AutoCompleter(root, rel_fnames, addable_rel_fnames, commands, "utf-8")
self.assertEqual(autocompleter.words, set(rel_fnames))
if __name__ == "__main__":
unittest.main()