@@ -387,7 +387,14 @@ def test_load_zsh_autotitle_warning(cli_args, tmpdir, monkeypatch):
387
387
assert 'Please set' not in result .output
388
388
389
389
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
+ )
391
398
def test_convert (cli_args , tmpdir , monkeypatch ):
392
399
# create dummy tmuxp yaml so we don't get yelled at
393
400
tmpdir .join ('.tmuxp.yaml' ).write (
@@ -401,7 +408,10 @@ def test_convert(cli_args, tmpdir, monkeypatch):
401
408
with tmpdir .as_cwd ():
402
409
runner = CliRunner ()
403
410
404
- runner .invoke (cli .cli , cli_args , input = 'y\n y\n ' )
411
+ # If autoconfirm (-y) no need to prompt y
412
+ input_args = 'y\n y\n ' if '-y' not in cli_args else ''
413
+
414
+ runner .invoke (cli .cli , cli_args , input = input_args )
405
415
assert tmpdir .join ('.tmuxp.json' ).check ()
406
416
assert tmpdir .join ('.tmuxp.json' ).open ().read () == json .dumps (
407
417
{'session_name' : 'hello' }, indent = 2
0 commit comments