Skip to content
Myr

test_parser.py

This file

Path

tests/test_parser.py

17 lines · 436 bytes · Python

Last changed by

use shlex to split completion argument stringSam Schottbefore adoptionf7cd0ff

History of this file

Take it

use shlex to split completion argument stringSam Schottbefore adoptionf7cd0ff

lines 1–17why, one step back
1import pytest
23from click.parser import split_arg_string456@pytest.mark.parametrize(7 ("value", "expect"),8 [9 ("cli a b c", ["cli", "a", "b", "c"]),10 ("cli 'my file", ["cli", "my file"]),11 ("cli 'my file'", ["cli", "my file"]),12 ("cli my\\", ["cli", "my"]),13 ("cli my\\ file", ["cli", "my file"]),14 ],15)16def test_split_arg_string(value, expect):17 assert split_arg_string(value) == expect