@@ -409,7 +409,7 @@ def test_convert(cli_args, tmpdir, monkeypatch):
409
409
410
410
@pytest .mark .parametrize ("cli_args" , [(['convert' , '-y' , '.' ]), (['convert' ,
411
411
'--yes' ,'.tmuxp.yaml' ])])
412
- def test_convert_confirm (cli_args , tmpdir , monkeypatch ):
412
+ def test_convert_confirm_yaml (cli_args , tmpdir , monkeypatch ):
413
413
414
414
tmpdir .join ('.tmuxp.yaml' ).write (
415
415
"""
@@ -428,6 +428,28 @@ def test_convert_confirm(cli_args, tmpdir, monkeypatch):
428
428
{'session_name' : 'hello' }, indent = 2 )
429
429
430
430
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
+
431
453
432
454
@pytest .mark .parametrize ("cli_args" , [(['import' ])])
433
455
def test_import (cli_args , monkeypatch ):
0 commit comments