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