Add completions, Add suggestions list to Argument
This commit is contained in:
18
tests/test_parsers/test_completions.py
Normal file
18
tests/test_parsers/test_completions.py
Normal file
@ -0,0 +1,18 @@
|
||||
import pytest
|
||||
|
||||
from falyx.parser.command_argument_parser import CommandArgumentParser
|
||||
|
||||
|
||||
@pytest.mark.asyncio
|
||||
@pytest.mark.parametrize(
|
||||
"input_tokens, expected",
|
||||
[
|
||||
([""], ["--help", "--tag", "-h"]),
|
||||
(["--ta"], ["--tag"]),
|
||||
(["--tag"], ["analytics", "build"]),
|
||||
],
|
||||
)
|
||||
async def test_suggest_next(input_tokens, expected):
|
||||
parser = CommandArgumentParser(...)
|
||||
parser.add_argument("--tag", choices=["analytics", "build"])
|
||||
assert sorted(parser.suggest_next(input_tokens)) == sorted(expected)
|
Reference in New Issue
Block a user