Skip to content

Commit 672bacf

Browse files
committed
Test convert -y
1 parent c9c2910 commit 672bacf

File tree

1 file changed

+12
-2
lines changed

1 file changed

+12
-2
lines changed

tests/test_cli.py

+12-2
Original file line numberDiff line numberDiff line change
@@ -387,7 +387,14 @@ def test_load_zsh_autotitle_warning(cli_args, tmpdir, monkeypatch):
387387
assert 'Please set' not in result.output
388388

389389

390-
@pytest.mark.parametrize("cli_args", [(['convert', '.']), (['convert', '.tmuxp.yaml'])])
390+
@pytest.mark.parametrize(
391+
"cli_args",
392+
[
393+
(['convert', '.']),
394+
(['convert', '.tmuxp.yaml']),
395+
(['convert', '.tmuxp.yaml', '-y']),
396+
],
397+
)
391398
def test_convert(cli_args, tmpdir, monkeypatch):
392399
# create dummy tmuxp yaml so we don't get yelled at
393400
tmpdir.join('.tmuxp.yaml').write(
@@ -401,7 +408,10 @@ def test_convert(cli_args, tmpdir, monkeypatch):
401408
with tmpdir.as_cwd():
402409
runner = CliRunner()
403410

404-
runner.invoke(cli.cli, cli_args, input='y\ny\n')
411+
# If autoconfirm (-y) no need to prompt y
412+
input_args = 'y\ny\n' if '-y' not in cli_args else ''
413+
414+
runner.invoke(cli.cli, cli_args, input=input_args)
405415
assert tmpdir.join('.tmuxp.json').check()
406416
assert tmpdir.join('.tmuxp.json').open().read() == json.dumps(
407417
{'session_name': 'hello'}, indent=2

0 commit comments

Comments
 (0)