From e6be69ec6d06cc2f84844f25fd3c53efac3ea9dc Mon Sep 17 00:00:00 2001 From: "Paul Gauthier (aider)" Date: Fri, 10 Jan 2025 14:24:27 -0800 Subject: [PATCH] test: add test case for TERM=dumb terminal handling --- tests/basic/test_io.py | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/tests/basic/test_io.py b/tests/basic/test_io.py index c2c71f85b..178f7a90c 100644 --- a/tests/basic/test_io.py +++ b/tests/basic/test_io.py @@ -17,6 +17,13 @@ class TestInputOutput(unittest.TestCase): io = InputOutput(fancy_input=False) self.assertFalse(io.pretty) + def test_dumb_terminal(self): + with patch.dict(os.environ, {"TERM": "dumb"}): + io = InputOutput(fancy_input=True) + self.assertTrue(io.is_dumb_terminal) + self.assertFalse(io.pretty) + self.assertIsNone(io.prompt_session) + def test_autocompleter_get_command_completions(self): # Step 3: Mock the commands object commands = MagicMock()