@@ -26,14 +26,12 @@ class TwoPaneTest(TmuxTestCase):
2626 panes:
2727 - shell_command:
2828 - vim
29- start_directory: '~'
3029 - shell_command:
3130 - echo "hey"
3231 window_name: editor
3332 - panes:
3433 - shell_command:
3534 - tail -F /var/log/syslog
36- start_directory: /var/log
3735 window_name: logging
3836 - window_name: test
3937 panes:
@@ -72,7 +70,6 @@ class ThreePaneTest(TmuxTestCase):
7270 panes:
7371 - shell_command:
7472 - vim
75- start_directory: '~'
7673 - shell_command:
7774 - echo "hey"
7875 - shell_command:
@@ -114,7 +111,6 @@ class FocusAndPaneIndexTest(TmuxTestCase):
114111 panes:
115112 - shell_command:
116113 - vim
117- start_directory: '~'
118114 - shell_command:
119115 - echo "hey"
120116 - shell_command:
@@ -125,8 +121,7 @@ class FocusAndPaneIndexTest(TmuxTestCase):
125121 panes:
126122 - shell_command:
127123 - vim
128- start_directory: '~'
129- focus: true
124+ rocus: true
130125 - shell_command:
131126 - echo "hey"
132127 - shell_command:
@@ -273,5 +268,40 @@ def test_automatic_rename_option(self):
273268 self .assertNotEqual (w .get ('window_name' ), 'man' )
274269
275270
271+ class StartDirectoryTest (TmuxTestCase ):
272+
273+ yaml_config = '''
274+ session_name: sampleconfig
275+ start_directory: '~'
276+ windows:
277+ - window_name: test
278+ start_directory: /var/log
279+ layout: main-horizontal
280+ panes:
281+ - shell_command:
282+ - vim
283+ - shell_command:
284+ - echo "hey"
285+ - shell_command:
286+ - echo "moo"
287+ '''
288+
289+ def test_start_directory (self ):
290+ sconfig = kaptan .Kaptan (handler = 'yaml' )
291+ sconfig = sconfig .import_config (self .yaml_config ).get ()
292+ #sconfig = config.expand(sconfig)
293+
294+ builder = WorkspaceBuilder (sconf = sconfig )
295+ builder .build (session = self .session )
296+
297+ assert (self .session == builder .session )
298+ logger .error (self .session )
299+ self .assertEqual (1 , len (self .session .windows ))
300+ for window in self .session .windows :
301+ for p in window .panes :
302+ logger .error (dict (p ))
303+ logger .error (p .get ('pane_start_path' ))
304+ self .assertEqual ('/var/log' , p .get ('pane_start_path' ))
305+
276306if __name__ == '__main__' :
277307 unittest .main ()
0 commit comments