Skip to content

Commit 432f4cf

Browse files
committed
test for comfirm argument added
1 parent 0ab8b60 commit 432f4cf

File tree

1 file changed

+22
-1
lines changed

1 file changed

+22
-1
lines changed

tests/test_cli.py

+22-1
Original file line numberDiff line numberDiff line change
@@ -404,8 +404,29 @@ def test_convert(cli_args, tmpdir, monkeypatch):
404404
runner.invoke(cli.cli, cli_args, input='y\ny\n')
405405
assert tmpdir.join('.tmuxp.json').check()
406406
assert tmpdir.join('.tmuxp.json').open().read() == json.dumps(
407-
{'session_name': 'hello'}, indent=2
407+
{'session_name': 'hello'}, indent=2)
408+
409+
410+
@pytest.mark.parametrize("cli_args", [(['convert', '-y', '.']), (['convert',
411+
'--yes','.tmuxp.yaml'])])
412+
def test_convert_confirm(cli_args, tmpdir, monkeypatch):
413+
414+
tmpdir.join('.tmuxp.yaml').write(
415+
"""
416+
session_name: hello
417+
"""
408418
)
419+
tmpdir.join('.oh-my-zsh').ensure(dir=True)
420+
monkeypatch.setenv('HOME', str(tmpdir))
421+
422+
with tmpdir.as_cwd():
423+
runner = CliRunner()
424+
425+
runner.invoke(cli.cli, cli_args, input='')
426+
assert tmpdir.join('.tmuxp.json').check()
427+
assert tmpdir.join('.tmuxp.json').open().read() == json.dumps(
428+
{'session_name': 'hello'}, indent=2)
429+
409430

410431

411432
@pytest.mark.parametrize("cli_args", [(['import'])])

0 commit comments

Comments
 (0)