Skip to content

Commit f1ea26f

Browse files
author
cellwebb
committed
test(completion): add tests for new model command completions
- Add test_model_remove_command_completion to verify model name suggestions - Add test_model_threshold_command_completion to verify model name suggestions - Ensure completions don't include subcommands when model names expected
1 parent bfe4ba5 commit f1ea26f

1 file changed

Lines changed: 34 additions & 0 deletions

File tree

tests/cli/test_completion.py

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -67,6 +67,40 @@ def test_model_subcommand_completion(self) -> None:
6767
assert "add" in command_texts
6868
assert "remove" in command_texts
6969

70+
def test_model_remove_command_completion(self) -> None:
71+
"""Test completion of model names for /model remove command."""
72+
completer = ClippyCommandCompleter()
73+
74+
# Test completing "/model remove " - should show model names
75+
doc = Document("/model remove ")
76+
completions = list(completer.get_completions(doc, None))
77+
78+
# Should have some model completions
79+
assert len(completions) > 0
80+
# Check that completions contain model names (not subcommands)
81+
completion_texts = [c.text for c in completions]
82+
# Should not include subcommands like "list", "add", etc.
83+
assert "list" not in completion_texts
84+
assert "add" not in completion_texts
85+
assert "remove" not in completion_texts
86+
87+
def test_model_threshold_command_completion(self) -> None:
88+
"""Test completion of model names for /model threshold command."""
89+
completer = ClippyCommandCompleter()
90+
91+
# Test completing "/model threshold " - should show model names
92+
doc = Document("/model threshold ")
93+
completions = list(completer.get_completions(doc, None))
94+
95+
# Should have some model completions
96+
assert len(completions) > 0
97+
# Check that completions contain model names (not subcommands)
98+
completion_texts = [c.text for c in completions]
99+
# Should not include subcommands like "list", "add", etc.
100+
assert "list" not in completion_texts
101+
assert "add" not in completion_texts
102+
assert "threshold" not in completion_texts
103+
70104
def test_provider_command_completion(self) -> None:
71105
"""Test completion of provider argument."""
72106
completer = ClippyCommandCompleter()

0 commit comments

Comments
 (0)