diff options
Diffstat (limited to 'tests/cli_test.py')
-rw-r--r-- | tests/cli_test.py | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/tests/cli_test.py b/tests/cli_test.py index bd31d987..f9861dee 100644 --- a/tests/cli_test.py +++ b/tests/cli_test.py @@ -1,4 +1,5 @@ import pytest +import mock from func.cli import cli @@ -18,3 +19,16 @@ class TestClass: cli(test_input) resout, reserr = capfd.readouterr() assert expected in resout + + @pytest.mark.parametrize("test_input, expected", [ + (['-l', + 'zte-pod1', + '-f', + 'storage'], [('./test_cases/zte-pod1/storage/fio_bm.yaml'), + ('./test_cases/zte-pod1/storage/fio_vm.yaml')]) + ]) + @mock.patch('func.cli.args_handler.prepare_and_run_benchmark') + def test_cli_successful(self, mock_args_handler, test_input, expected): + cli(test_input) + call_list = map(lambda x: mock_args_handler.call_args_list[x][0][0], range(len(expected))) + assert sorted(call_list) == sorted(expected) |