1919logger = logging .getLogger (__name__ )
2020TMUXP_DIR = os .path .join (os .path .dirname (__file__ ), '.tmuxp' )
2121
22- sampleconfigdict = {
23- 'session_name' : 'sampleconfig' ,
24- 'start_directory' : '~' ,
25- 'windows' : [
26- {
27- 'window_name' : 'editor' ,
28- 'panes' : [
29- {
30- 'start_directory' : '~' ,
31- 'shell_command' : ['vim' ],
32- }, {
33- 'shell_command' : ['cowsay "hey"' ]
34- },
35- ],
36- 'layout' : 'main-verticle'
37- },
38- {
39- 'window_name' : 'logging' ,
40- 'panes' : [{
41- 'shell_command' : ['tail -F /var/log/syslog' ],
42- 'start_directory' :'/var/log'
43- }]
44- },
45- {
46- 'options' : {
47- 'automatic_rename' : True ,
48- },
49- 'panes' : [
50- {'shell_command' : ['htop' ]}
51- ]
52- }
53- ]
54- }
55-
5622
5723def yaml_to_dict (yaml ):
5824 return kaptan .Kaptan (handler = 'yaml' ).import_config (yaml ).get ()
@@ -62,22 +28,22 @@ def test_export_json(tmpdir):
6228 json_config_file = tmpdir .join ('config.json' )
6329
6430 configparser = kaptan .Kaptan ()
65- configparser .import_config (sampleconfigdict )
31+ configparser .import_config (fixtures . config . sampleconfig . sampleconfigdict )
6632
6733 json_config_data = configparser .export ('json' , indent = 2 )
6834
6935 json_config_file .write (json_config_data )
7036
7137 new_config = kaptan .Kaptan ()
7238 new_config_data = new_config .import_config (str (json_config_file )).get ()
73- assert sampleconfigdict == new_config_data
39+ assert fixtures . config . sampleconfig . sampleconfigdict == new_config_data
7440
7541
7642def test_export_yaml (tmpdir ):
7743 yaml_config_file = tmpdir .join ('config.yaml' )
7844
7945 configparser = kaptan .Kaptan ()
80- sampleconfig = config .inline (sampleconfigdict )
46+ sampleconfig = config .inline (fixtures . config . sampleconfig . sampleconfigdict )
8147 configparser .import_config (sampleconfig )
8248
8349 yaml_config_data = configparser .export (
@@ -87,7 +53,7 @@ def test_export_yaml(tmpdir):
8753
8854 new_config = kaptan .Kaptan ()
8955 new_config_data = new_config .import_config (str (yaml_config_file )).get ()
90- sampleconfigdict == new_config_data
56+ fixtures . config . sampleconfig . sampleconfigdict == new_config_data
9157
9258
9359def test_scan_config (tmpdir ):
0 commit comments