|
7 | 7 |
|
8 | 8 |
|
9 | 9 | @pytest.mark.parametrize("version", ["v1", "v2"]) |
10 | | -@pytest.mark.parametrize("config_format", ["yaml"]) |
| 10 | +@pytest.mark.parametrize("config_format", ["yaml", "toml"]) |
11 | 11 | @pytest.mark.parametrize("shell", ShellType) |
12 | | -def test_output_file_to_samples( |
13 | | - version: str, |
14 | | - config_format: str, |
15 | | - shell: ShellType, |
16 | | -) -> None: |
17 | | - App.run( |
18 | | - [ |
19 | | - "--file", |
20 | | - str(SAMPLES_DIR / version / f"config.cmdcomp.{config_format}"), |
21 | | - "--shell-type", |
22 | | - shell.value, |
23 | | - "--output", |
24 | | - str(SAMPLES_DIR / version / f"output.{shell.value}"), |
25 | | - ] |
26 | | - ) |
| 12 | +class TestApplication: |
| 13 | + def test_application( |
| 14 | + self, |
| 15 | + capsys: CaptureFixture, |
| 16 | + version: str, |
| 17 | + config_format: str, |
| 18 | + shell: ShellType, |
| 19 | + ) -> None: |
| 20 | + App.run( |
| 21 | + [ |
| 22 | + "--file", |
| 23 | + str(SAMPLES_DIR / version / f"config.cmdcomp.{config_format}"), |
| 24 | + "--shell-type", |
| 25 | + shell.value, |
| 26 | + ] |
| 27 | + ) |
27 | 28 |
|
| 29 | + assert ( |
| 30 | + capsys.readouterr().out |
| 31 | + == open(SAMPLES_DIR / version / f"output.{str(shell.value)}").read() |
| 32 | + ) |
28 | 33 |
|
29 | | -@pytest.mark.parametrize("version", ["v1", "v2"]) |
30 | | -@pytest.mark.parametrize("config_format", ["yaml"]) |
31 | | -@pytest.mark.parametrize("shell", ShellType) |
32 | | -def test_application( |
33 | | - capsys: CaptureFixture, |
34 | | - version: str, |
35 | | - config_format: str, |
36 | | - shell: ShellType, |
37 | | -) -> None: |
38 | | - App.run( |
39 | | - [ |
40 | | - "--file", |
41 | | - str(SAMPLES_DIR / version / f"config.cmdcomp.{config_format}"), |
42 | | - "--shell-type", |
43 | | - shell.value, |
44 | | - ] |
45 | | - ) |
46 | | - |
47 | | - assert ( |
48 | | - capsys.readouterr().out |
49 | | - == open(SAMPLES_DIR / version / f"output.{str(shell.value)}").read() |
50 | | - ) |
| 34 | + def test_output_file_to_samples( |
| 35 | + self, |
| 36 | + version: str, |
| 37 | + config_format: str, |
| 38 | + shell: ShellType, |
| 39 | + ) -> None: |
| 40 | + App.run( |
| 41 | + [ |
| 42 | + "--file", |
| 43 | + str(SAMPLES_DIR / version / f"config.cmdcomp.{config_format}"), |
| 44 | + "--shell-type", |
| 45 | + shell.value, |
| 46 | + "--output", |
| 47 | + str(SAMPLES_DIR / version / f"output.{shell.value}"), |
| 48 | + ] |
| 49 | + ) |
0 commit comments