File tree 1 file changed +20
-1
lines changed 1 file changed +20
-1
lines changed Original file line number Diff line number Diff line change 4
4
5
5
import json
6
6
import os
7
+ from pathlib import Path
7
8
8
9
import pytest
9
10
13
14
import libtmux
14
15
from libtmux .common import has_lt_version
15
16
from tmuxp import cli , config
16
- from tmuxp .cli import get_config_dir , is_pure_name , load_workspace , scan_config
17
+ from tmuxp .cli import (
18
+ command_ls ,
19
+ get_config_dir ,
20
+ is_pure_name ,
21
+ load_workspace ,
22
+ scan_config ,
23
+ )
17
24
18
25
from .fixtures ._util import curjoin , loadfixture
19
26
@@ -574,3 +581,15 @@ def check_cmd(config_arg):
574
581
assert str (user_config ) in check_cmd (str (configdir .join ('myconfig.yaml' )))
575
582
576
583
assert 'file not found' in check_cmd ('.tmuxp.json' )
584
+
585
+ def test_ls_cli (monkeypatch , tmpdir ):
586
+ tmpdir .join ('.tmuxp/session_1.yaml' ).ensure ()
587
+ tmpdir .join ('.tmuxp/session_2.yaml' ).ensure ()
588
+ tmpdir .join ('.tmuxp/session_3.json' ).ensure ()
589
+
590
+ monkeypatch .setenv ("HOME" , str (tmpdir ))
591
+
592
+ runner = CliRunner ()
593
+
594
+ cli_output = runner .invoke (command_ls ).output
595
+ assert cli_output == "session_1\n session_2\n session_3\n "
You can’t perform that action at this time.
0 commit comments