forked from tmux-python/tmuxp
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathtest_config_tmuxinator.py
47 lines (36 loc) · 1.3 KB
/
test_config_tmuxinator.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
# -*- coding: utf-8 -*-
"""Test for tmuxp tmuxinator configuration."""
from __future__ import absolute_import, unicode_literals
import os
import pytest
import kaptan
from tmuxp import config
from .fixtures import config_tmuxinator as fixtures
TMUXP_DIR = os.path.join(os.path.dirname(__file__), '.tmuxp')
@pytest.mark.parametrize(
"tmuxinator_yaml,tmuxinator_dict,tmuxp_dict",
[
(
fixtures.test1.tmuxinator_yaml,
fixtures.test1.tmuxinator_dict,
fixtures.test1.expected,
),
(
fixtures.test2.tmuxinator_yaml,
fixtures.test2.tmuxinator_dict,
fixtures.test2.expected,
), # older vers use `tabs` instead of `windows`
(
fixtures.test3.tmuxinator_yaml,
fixtures.test3.tmuxinator_dict,
fixtures.test3.expected,
), # Test importing <spec/fixtures/sample.yml>
],
)
def test_config_to_dict(tmuxinator_yaml, tmuxinator_dict, tmuxp_dict):
configparser = kaptan.Kaptan(handler='yaml')
test_config = configparser.import_config(tmuxinator_yaml)
yaml_to_dict = test_config.get()
assert yaml_to_dict == tmuxinator_dict
assert config.import_tmuxinator(tmuxinator_dict) == tmuxp_dict
config.validate_schema(config.import_tmuxinator(tmuxinator_dict))