From 4ea68efd0eb4b11e6185dac4d92d48c709c80c70 Mon Sep 17 00:00:00 2001 From: "Paul Gauthier (aider)" Date: Sat, 28 Sep 2024 15:19:19 -0700 Subject: [PATCH] test: Fix confirm_ask test to handle invalid input and verify call count --- tests/basic/test_io.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tests/basic/test_io.py b/tests/basic/test_io.py index a6ecf7b4b..6fbfa44ef 100644 --- a/tests/basic/test_io.py +++ b/tests/basic/test_io.py @@ -193,10 +193,10 @@ class TestInputOutput(unittest.TestCase): # Test that allow_never=False does not add to never_prompts mock_input.reset_mock() - mock_input.side_effect = ["d"] + mock_input.side_effect = ["d", "n"] result = io.confirm_ask("Do you want to proceed?", allow_never=False) self.assertFalse(result) - mock_input.assert_called_once() + self.assertEqual(mock_input.call_count, 2) self.assertNotIn(("Do you want to proceed?", None), io.never_prompts) def test_get_command_completions(self):