|
11 | 11 | from tmuxp.workspace import importers, validation |
12 | 12 |
|
13 | 13 |
|
| 14 | +class TmuxinatorConfigTestFixture(t.NamedTuple): |
| 15 | + """Test fixture for tmuxinator config conversion tests.""" |
| 16 | + |
| 17 | + test_id: str |
| 18 | + tmuxinator_yaml: str |
| 19 | + tmuxinator_dict: dict[str, t.Any] |
| 20 | + tmuxp_dict: dict[str, t.Any] |
| 21 | + |
| 22 | + |
| 23 | +TMUXINATOR_CONFIG_TEST_FIXTURES: list[TmuxinatorConfigTestFixture] = [ |
| 24 | + TmuxinatorConfigTestFixture( |
| 25 | + test_id="basic_config", |
| 26 | + tmuxinator_yaml=fixtures.test1.tmuxinator_yaml, |
| 27 | + tmuxinator_dict=fixtures.test1.tmuxinator_dict, |
| 28 | + tmuxp_dict=fixtures.test1.expected, |
| 29 | + ), |
| 30 | + TmuxinatorConfigTestFixture( |
| 31 | + test_id="legacy_tabs_config", # older vers use `tabs` instead of `windows` |
| 32 | + tmuxinator_yaml=fixtures.test2.tmuxinator_yaml, |
| 33 | + tmuxinator_dict=fixtures.test2.tmuxinator_dict, |
| 34 | + tmuxp_dict=fixtures.test2.expected, |
| 35 | + ), |
| 36 | + TmuxinatorConfigTestFixture( |
| 37 | + test_id="sample_config", # Test importing <spec/fixtures/sample.yml> |
| 38 | + tmuxinator_yaml=fixtures.test3.tmuxinator_yaml, |
| 39 | + tmuxinator_dict=fixtures.test3.tmuxinator_dict, |
| 40 | + tmuxp_dict=fixtures.test3.expected, |
| 41 | + ), |
| 42 | +] |
| 43 | + |
| 44 | + |
14 | 45 | @pytest.mark.parametrize( |
15 | | - ("tmuxinator_yaml", "tmuxinator_dict", "tmuxp_dict"), |
16 | | - [ |
17 | | - ( |
18 | | - fixtures.test1.tmuxinator_yaml, |
19 | | - fixtures.test1.tmuxinator_dict, |
20 | | - fixtures.test1.expected, |
21 | | - ), |
22 | | - ( |
23 | | - fixtures.test2.tmuxinator_yaml, |
24 | | - fixtures.test2.tmuxinator_dict, |
25 | | - fixtures.test2.expected, |
26 | | - ), # older vers use `tabs` instead of `windows` |
27 | | - ( |
28 | | - fixtures.test3.tmuxinator_yaml, |
29 | | - fixtures.test3.tmuxinator_dict, |
30 | | - fixtures.test3.expected, |
31 | | - ), # Test importing <spec/fixtures/sample.yml> |
32 | | - ], |
| 46 | + list(TmuxinatorConfigTestFixture._fields), |
| 47 | + TMUXINATOR_CONFIG_TEST_FIXTURES, |
| 48 | + ids=[test.test_id for test in TMUXINATOR_CONFIG_TEST_FIXTURES], |
33 | 49 | ) |
34 | 50 | def test_config_to_dict( |
| 51 | + test_id: str, |
35 | 52 | tmuxinator_yaml: str, |
36 | 53 | tmuxinator_dict: dict[str, t.Any], |
37 | 54 | tmuxp_dict: dict[str, t.Any], |
|
0 commit comments