|
17 | 17 |
|
18 | 18 |
|
19 | 19 | @pytest.mark.parametrize(
|
20 |
| - ("user_input", "env_names", "is_all", "is_default" ), [ |
21 |
| - (None, (), False, True ), |
22 |
| - ("", (), False, True ), |
23 |
| - ("a1", ("a1",), False, False ), |
24 |
| - ("a1,b2,c3", ("a1", "b2", "c3"), False, False ), |
25 |
| - # If the user gives "ALL" as any envname, this becomes an "is_all" and other envnames are ignored. |
26 |
| - ("ALL", (), True, False ), |
27 |
| - ("a1,ALL,b2", (), True, False ), |
28 |
| - # Zero-length envnames are ignored as being not present. This is not intentional. |
29 |
| - (",,a1,,,b2,,", ("a1", "b2"), False, False ), |
30 |
| - (",,", (), False, True ), |
31 |
| - # Environment names with "invalid" characters are accepted here; the client is expected to deal with this. |
32 |
| - ("\x01.-@\x02,xxx", ("\x01.-@\x02", "xxx"), False, False ), |
| 20 | + ("user_input", "env_names", "is_all", "is_default"), |
| 21 | + [ |
| 22 | + (None, (), False, True), |
| 23 | + ("", (), False, True), |
| 24 | + ("a1", ("a1",), False, False), |
| 25 | + ("a1,b2,c3", ("a1", "b2", "c3"), False, False), |
| 26 | + # If the user gives "ALL" as any envname, this becomes an "is_all" and other envnames are ignored. |
| 27 | + ("ALL", (), True, False), |
| 28 | + ("a1,ALL,b2", (), True, False), |
| 29 | + # Zero-length envnames are ignored as being not present. This is not intentional. |
| 30 | + (",,a1,,,b2,,", ("a1", "b2"), False, False), |
| 31 | + (",,", (), False, True), |
| 32 | + # Environment names with "invalid" characters are accepted here; the client is expected to deal with this. |
| 33 | + ("\x01.-@\x02,xxx", ("\x01.-@\x02", "xxx"), False, False), |
33 | 34 | ],
|
34 | 35 | )
|
35 | 36 | def test_clienv(user_input: str, env_names: tuple[str], is_all: bool, is_default: bool) -> None:
|
36 | 37 | ce = CliEnv(user_input)
|
37 |
| - assert (ce.is_all, ce.is_default_list, tuple(ce)) \ |
38 |
| - == (is_all, is_default, tuple(env_names)) |
| 38 | + assert (ce.is_all, ce.is_default_list, tuple(ce)) == (is_all, is_default, tuple(env_names)) |
| 39 | + |
39 | 40 |
|
40 | 41 | @pytest.mark.parametrize(
|
41 | 42 | ("user_input", "expected"),
|
|
0 commit comments