|
15 | 15 | @pytest.mark.parametrize(
|
16 | 16 | (
|
17 | 17 | "name",
|
| 18 | + "aliases", |
18 | 19 | "invert",
|
19 | 20 | "expected",
|
20 | 21 | ),
|
21 | 22 | [
|
22 |
| - ("test", False, "--test"), |
23 |
| - ("test", True, "--no-test"), |
24 |
| - ("test_two", False, "--test-two"), |
25 |
| - ("test_two", True, "--no-test-two"), |
| 23 | + ("test", ["-t", "-te"], False, ["-t", "-te", "--test"]), |
| 24 | + ("test", ["-nt"], True, ["-nt", "--no-test"]), |
| 25 | + ("test_two", [], False, ["--test-two"]), |
| 26 | + ("test_two", [], True, ["--no-test-two"]), |
26 | 27 | ],
|
27 | 28 | )
|
28 |
| -def test_argument_name( |
| 29 | +def test_argument_names( |
29 | 30 | name: str,
|
| 31 | + aliases: list[str], |
30 | 32 | invert: bool,
|
31 | 33 | expected: str,
|
32 | 34 | ) -> None:
|
33 | 35 | """Tests `utils.arguments.name` Function.
|
34 | 36 |
|
35 | 37 | Args:
|
36 | 38 | name (str): Argument name to test.
|
| 39 | + aliases (list[str]): List of aliases. |
37 | 40 | invert (bool): Whether to invert the name.
|
38 | 41 | expected (str): Expected result of the test.
|
39 | 42 | """
|
40 | 43 | # Construct Pydantic Field
|
41 |
| - field = conf.create_test_field(name) |
| 44 | + field = conf.create_test_field(name, aliases=aliases) |
42 | 45 |
|
43 | 46 | # Generate Argument Name
|
44 |
| - result = utils.arguments.name(field, invert) |
| 47 | + result = utils.arguments.names(field, invert) |
45 | 48 |
|
46 | 49 | # Assert
|
47 | 50 | assert result == expected
|
|
0 commit comments