Skip to content

Commit c3ea1d3

Browse files
committed
big teamocil config, midway
1 parent a31c660 commit c3ea1d3

File tree

1 file changed

+49
-18
lines changed

1 file changed

+49
-18
lines changed

tmuxp/testsuite/test_config_teamocil.py

Lines changed: 49 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -180,44 +180,44 @@ class TeamocilLayoutsTest(unittest.TestCase):
180180
# Simple two windows layout
181181
two-windows:
182182
windows:
183-
- name: "foo"
183+
- name: "foo"
184184
clear: true
185185
root: "/foo"
186186
layout: "tiled"
187187
panes:
188-
- cmd: "echo 'foo'"
189-
- cmd: "echo 'foo again'"
190-
- name: "bar"
188+
- cmd: "echo 'foo'"
189+
- cmd: "echo 'foo again'"
190+
- name: "bar"
191191
root: "/bar"
192192
splits:
193-
- cmd:
193+
- cmd:
194194
- "echo 'bar'"
195195
- "echo 'bar in an array'"
196196
target: bottom-right
197-
- cmd: "echo 'bar again'"
197+
- cmd: "echo 'bar again'"
198198
focus: true
199199
width: 50
200200
201201
# Simple two windows layout with filters
202202
two-windows-with-filters:
203203
windows:
204-
- name: "foo"
204+
- name: "foo"
205205
root: "/foo"
206206
filters:
207-
before:
207+
before:
208208
- "echo first before filter"
209209
- "echo second before filter"
210-
after:
210+
after:
211211
- "echo first after filter"
212212
- "echo second after filter"
213213
panes:
214-
- cmd: "echo 'foo'"
215-
- cmd: "echo 'foo again'"
214+
- cmd: "echo 'foo'"
215+
- cmd: "echo 'foo again'"
216216
width: 50
217217
218218
two-windows-with-custom-command-options:
219219
windows:
220-
- name: "foo"
220+
- name: "foo"
221221
cmd_separator: "\n"
222222
with_env_var: false
223223
clear: true
@@ -226,16 +226,16 @@ class TeamocilLayoutsTest(unittest.TestCase):
226226
panes:
227227
- cmd: "echo 'foo'"
228228
- cmd: "echo 'foo again'"
229-
- name: "bar"
229+
- name: "bar"
230230
cmd_separator: " && "
231231
with_env_var: true
232232
root: "/bar"
233233
splits:
234-
- cmd:
234+
- cmd:
235235
- "echo 'bar'"
236236
- "echo 'bar in an array'"
237237
target: bottom-right
238-
- cmd: "echo 'bar again'"
238+
- cmd: "echo 'bar again'"
239239
focus: true
240240
width: 50
241241
@@ -244,16 +244,47 @@ class TeamocilLayoutsTest(unittest.TestCase):
244244
name: "my awesome session"
245245
windows:
246246
- name: "first window"
247-
panes:
247+
panes:
248248
- cmd: "echo 'foo'"
249249
- name: "second window"
250-
panes:
250+
panes:
251251
- cmd: "echo 'foo'"
252252
- name: "third window"
253-
panes:
253+
panes:
254254
- cmd: "echo 'foo'"
255255
"""
256256

257+
teamocil_dict = {
258+
'two-windows': {
259+
'windows': [{
260+
'name': 'foo',
261+
'clear': True,
262+
'root': '/root',
263+
'layout': 'tiled',
264+
'panes': [
265+
{ 'cmd': "echo 'foo'" },
266+
{ 'cmd': "echo 'foo again'" }
267+
]
268+
},
269+
{
270+
'name': 'bar',
271+
'root': '/bar',
272+
'splits': [
273+
274+
]
275+
276+
}]
277+
}
278+
}
279+
280+
def test_config_to_dict(self):
281+
self.maxDiff = None
282+
configparser = kaptan.Kaptan(handler='yaml')
283+
test_config = configparser.import_config(self.teamocil_yaml)
284+
yaml_to_dict = test_config.get()
285+
self.assertDictEqual(yaml_to_dict, self.teamocil_dict)
286+
287+
257288

258289
if __name__ == '__main__':
259290
unittest.main()

0 commit comments

Comments
 (0)