File tree Expand file tree Collapse file tree 1 file changed +20
-1
lines changed
Expand file tree Collapse file tree 1 file changed +20
-1
lines changed Original file line number Diff line number Diff line change 44
55import json
66import os
7+ from pathlib import Path
78
89import pytest
910
1314import libtmux
1415from libtmux .common import has_lt_version
1516from 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+ )
1724
1825from .fixtures ._util import curjoin , loadfixture
1926
@@ -574,3 +581,15 @@ def check_cmd(config_arg):
574581 assert str (user_config ) in check_cmd (str (configdir .join ('myconfig.yaml' )))
575582
576583 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