From 74f260711cd87c1a91235f10f686684effce679f Mon Sep 17 00:00:00 2001 From: nyanpasu64 Date: Sun, 26 Aug 2018 23:50:21 -0700 Subject: [PATCH] Add test for command-line write paths Fails at the moment --- tests/test_cli.py | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/tests/test_cli.py b/tests/test_cli.py index ba18d24..c1e9590 100644 --- a/tests/test_cli.py +++ b/tests/test_cli.py @@ -80,3 +80,17 @@ def test_file_dirs(any_sink, wav_dir): assert isinstance(cfg, Config) assert [chan.wav_path for chan in cfg.channels] == wavs + + +def test_write_dir(yaml_sink): + """ Loading `--audio another/dir` should write YAML to current dir. """ + + audio_path = Path('tests/sine440.wav') + arg_str = f'tests -a {audio_path} -w' + + cfg, outpath = yaml_sink(arg_str) + assert isinstance(outpath, Path) + + assert outpath.parent == '.' + assert outpath.name == outpath + assert outpath == audio_path.with_suffix(YAML_NAME).name