v2.18.1 (#856)
Co-authored-by: Charles-Edouard Cady <charles.edouard.cady@mistral.ai> Co-authored-by: Guillaume LE GOFF <guillaume.lgf@gmail.com> Co-authored-by: Pierre Rossinès <pierre.rossines@mistral.ai> Co-authored-by: Sylvain Afchain <safchain@gmail.com> Co-authored-by: Mistral Vibe <vibe@mistral.ai>
This commit is contained in:
parent
e607ccbb00
commit
ed5b7192e6
33 changed files with 1456 additions and 125 deletions
26
tests/cli/test_input_kinds.py
Normal file
26
tests/cli/test_input_kinds.py
Normal file
|
|
@ -0,0 +1,26 @@
|
|||
from __future__ import annotations
|
||||
|
||||
import pytest
|
||||
|
||||
from vibe.cli.commands import CommandRegistry
|
||||
from vibe.cli.textual_ui.widgets.chat_input.input_kinds import (
|
||||
Prompt,
|
||||
SlashCommand,
|
||||
classify,
|
||||
)
|
||||
|
||||
|
||||
def _classify(value: str) -> object:
|
||||
return classify(value, commands=CommandRegistry(), expand_skill=lambda _value: None)
|
||||
|
||||
|
||||
@pytest.mark.parametrize("alias", ["/exit", "exit", "quit", ":q", ":quit"])
|
||||
def test_classify_treats_bare_exit_synonyms_as_slash_command(alias: str) -> None:
|
||||
assert isinstance(_classify(alias), SlashCommand)
|
||||
|
||||
|
||||
@pytest.mark.parametrize("value", ["exit the function early", "quit your job"])
|
||||
def test_classify_keeps_bare_synonym_with_trailing_text_as_prompt(value: str) -> None:
|
||||
result = _classify(value)
|
||||
assert isinstance(result, Prompt)
|
||||
assert result.text == value
|
||||
Loading…
Add table
Add a link
Reference in a new issue