From 927c302bd4b698a96758fd04d328da42b9649807 Mon Sep 17 00:00:00 2001 From: Hendrik Schreiber Date: Fri, 11 Oct 2024 14:48:55 +0200 Subject: [PATCH] Change script_runner.run(x, x) to ret = script_runner.run([x, x]). --- test/test_commands.py | 30 +++++++++++++++--------------- 1 file changed, 15 insertions(+), 15 deletions(-) diff --git a/test/test_commands.py b/test/test_commands.py index 22cfece..d1fad6c 100644 --- a/test/test_commands.py +++ b/test/test_commands.py @@ -18,7 +18,7 @@ def test_track(): @pytest.mark.parametrize('entry_point', entry_points) def test_help(script_runner, entry_point): # sanity check -- can it be called at all - ret = script_runner.run(entry_point, '--help') + ret = script_runner.run([entry_point, '--help']) assert ret.success assert ret.stdout.startswith('usage:') assert ret.stderr == '' @@ -27,7 +27,7 @@ def test_help(script_runner, entry_point): @pytest.mark.parametrize('entry_point', entry_points) def test_version(script_runner, entry_point): # sanity check -- can it be called at all - ret = script_runner.run(entry_point, '--version') + ret = script_runner.run([entry_point, '--version']) assert ret.success assert ret.stdout.startswith(entry_point) assert version.__version__ in ret.stdout @@ -35,55 +35,55 @@ def test_version(script_runner, entry_point): def test_tempo(script_runner, test_track): - ret = script_runner.run('tempo', '-i', test_track) + ret = script_runner.run(['tempo', '-i', test_track]) assert ret.success assert 'Loading model' in ret.stdout assert '100' in ret.stdout def test_tempogram(script_runner, test_track): - ret = script_runner.run('tempogram', '-p', test_track) + ret = script_runner.run(['tempogram', '-p', test_track]) assert ret.success assert 'Loading model' in ret.stdout assert os.path.exists(test_track + '.png') def test_meter(script_runner, test_track): - ret = script_runner.run('meter', '-i', test_track) + ret = script_runner.run(['meter', '-i', test_track]) assert ret.success assert 'Loading model' in ret.stdout assert '9' in ret.stdout def test_greekfolk(script_runner, tmpdir, test_track): - ret = script_runner.run('greekfolk', dirname(test_track), str(tmpdir)) + ret = script_runner.run(['greekfolk', dirname(test_track), str(tmpdir)]) assert ret.success assert 'No .wav files found in' in ret.stdout def test_tempo_interpolate(script_runner, test_track): - ret = script_runner.run('tempo', '--interpolate', '-i', test_track) + ret = script_runner.run(['tempo', '--interpolate', '-i', test_track]) assert ret.success assert 'Loading model' in ret.stdout assert '100' in ret.stdout def test_tempo_model(script_runner, test_track): - ret = script_runner.run('tempo', '-m', 'deeptemp', '-i', test_track) + ret = script_runner.run(['tempo', '-m', 'deeptemp', '-i', test_track]) assert ret.success assert 'Loading model' in ret.stdout assert '100' in ret.stdout def test_tempo_mirex(script_runner, test_track): - ret = script_runner.run('tempo', '--mirex', '-i', test_track) + ret = script_runner.run(['tempo', '--mirex', '-i', test_track]) assert ret.success assert 'Loading model' in ret.stdout assert '100 201 0.99' in ret.stdout def test_tempo_jams(script_runner, test_track): - ret = script_runner.run('tempo', '--jams', '-i', test_track) + ret = script_runner.run(['tempo', '--jams', '-i', test_track]) assert ret.success assert 'Loading model' in ret.stdout assert 'Processing file' in ret.stdout @@ -107,12 +107,12 @@ def test_tempo_jams(script_runner, test_track): def test_tempo_jams_and_mirex(script_runner, test_track): - ret = script_runner.run('tempo', '--jams', '--mirex', '-i', test_track) + ret = script_runner.run(['tempo', '--jams', '--mirex', '-i', test_track]) assert not ret.success def test_tempo_extension(script_runner, test_track): - ret = script_runner.run('tempo', '-e', '.fancy_pants', '-i', test_track) + ret = script_runner.run(['tempo', '-e', '.fancy_pants', '-i', test_track]) assert ret.success extension_name = test_track + '.fancy_pants' assert os.path.exists(extension_name) @@ -121,7 +121,7 @@ def test_tempo_extension(script_runner, test_track): def test_tempo_replace_extension(script_runner, test_track): - ret = script_runner.run('tempo', '-re', '.fancy_pants', '-i', test_track) + ret = script_runner.run(['tempo', '-re', '.fancy_pants', '-i', test_track]) assert ret.success extension_name = test_track.replace('.mp3', '.fancy_pants') assert os.path.exists(extension_name) @@ -130,12 +130,12 @@ def test_tempo_replace_extension(script_runner, test_track): def test_tempo_replace_exclusive(script_runner, test_track): - ret = script_runner.run('tempo', '-e', '.fancy_pants', '-re', '.fancy_pants2', '-i', test_track) + ret = script_runner.run(['tempo', '-e', '.fancy_pants', '-re', '.fancy_pants2', '-i', test_track]) assert not ret.success def test_tempo_cont(script_runner, test_track): - ret = script_runner.run('tempo', '--cont', '-i', test_track) + ret = script_runner.run(['tempo', '--cont', '-i', test_track]) assert ret.success # TODO: more comprehensive testing