mirror of
https://github.com/Aider-AI/aider.git
synced 2025-05-29 00:35:00 +00:00
test: remove unused test for command completions in TestInputOutput class
This commit is contained in:
parent
e832ee8450
commit
2139de76fb
1 changed files with 0 additions and 29 deletions
|
@ -202,35 +202,6 @@ class TestInputOutput(unittest.TestCase):
|
||||||
self.assertEqual(mock_input.call_count, 2)
|
self.assertEqual(mock_input.call_count, 2)
|
||||||
self.assertNotIn(("Do you want to proceed?", None), io.never_prompts)
|
self.assertNotIn(("Do you want to proceed?", None), io.never_prompts)
|
||||||
|
|
||||||
def test_get_command_completions(self):
|
|
||||||
root = ""
|
|
||||||
rel_fnames = []
|
|
||||||
addable_rel_fnames = []
|
|
||||||
commands = MagicMock()
|
|
||||||
commands.get_commands.return_value = ["model", "chat", "help"]
|
|
||||||
commands.get_completions.return_value = ["gpt-3.5-turbo", "gpt-4"]
|
|
||||||
commands.matching_commands.return_value = (["/model", "/models"], None, None)
|
|
||||||
|
|
||||||
autocompleter = AutoCompleter(root, rel_fnames, addable_rel_fnames, commands, "utf-8")
|
|
||||||
|
|
||||||
# Create instances of Document and CompleteEvent
|
|
||||||
document = Document(text="/model gpt", cursor_position=len("/model gpt"))
|
|
||||||
complete_event = CompleteEvent()
|
|
||||||
|
|
||||||
# Call get_command_completions with the required parameters
|
|
||||||
completions = list(
|
|
||||||
autocompleter.get_command_completions(
|
|
||||||
document, complete_event, "/model gpt", ["/model", "gpt"]
|
|
||||||
)
|
|
||||||
)
|
|
||||||
|
|
||||||
# Extract completion texts
|
|
||||||
result = [completion.text for completion in completions]
|
|
||||||
|
|
||||||
# Assert the result
|
|
||||||
self.assertEqual(result, ["gpt-3.5-turbo", "gpt-4"])
|
|
||||||
commands.get_completions.assert_called_once_with("/model")
|
|
||||||
commands.matching_commands.assert_called_once_with("/model")
|
|
||||||
|
|
||||||
|
|
||||||
if __name__ == "__main__":
|
if __name__ == "__main__":
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue