@@ -409,7 +409,7 @@ def test_convert(cli_args, tmpdir, monkeypatch):
409409
410410@pytest .mark .parametrize ("cli_args" , [(['convert' , '-y' , '.' ]), (['convert' ,
411411 '--yes' ,'.tmuxp.yaml' ])])
412- def test_convert_confirm (cli_args , tmpdir , monkeypatch ):
412+ def test_convert_confirm_yaml (cli_args , tmpdir , monkeypatch ):
413413
414414 tmpdir .join ('.tmuxp.yaml' ).write (
415415 """
@@ -428,6 +428,28 @@ def test_convert_confirm(cli_args, tmpdir, monkeypatch):
428428 {'session_name' : 'hello' }, indent = 2 )
429429
430430
431+ @pytest .mark .parametrize ("cli_args" , [(['convert' , '-y' , '.' ]), (['convert' ,
432+ '--yes' ,'.tmuxp.json' ])])
433+ def test_convert_confirm_json (cli_args , tmpdir , monkeypatch ):
434+ jsonData = {}
435+ jsonData ['session_name' ] = 'hello'
436+ with open (tmpdir .join ('.tmuxp.json' ), 'w' ) as jsonfile :
437+ json .dump (jsonData , jsonfile , indent = 2 )
438+
439+
440+ tmpdir .join ('.oh-my-zsh' ).ensure (dir = True )
441+ monkeypatch .setenv ('HOME' , str (tmpdir ))
442+
443+ with tmpdir .as_cwd ():
444+ runner = CliRunner ()
445+
446+ runner .invoke (cli .cli , cli_args , input = '' )
447+ assert tmpdir .join ('.tmuxp.yaml' ).check ()
448+ assert tmpdir .join ('.tmuxp.yaml' ).open ().read () == "session_name: hello\n "
449+
450+
451+
452+
431453
432454@pytest .mark .parametrize ("cli_args" , [(['import' ])])
433455def test_import (cli_args , monkeypatch ):
0 commit comments