diff options
author | zhihui wu <zhihui.wu2006+zte@gmail.com> | 2017-03-15 01:28:02 +0000 |
---|---|---|
committer | Gerrit Code Review <gerrit@opnfv.org> | 2017-03-15 01:28:02 +0000 |
commit | deb48720a34ff36d23d777b9a9a1b4f73c17d80d (patch) | |
tree | f704ac8a24c5e74c7982d0ad3c49cab9f355baa2 /legacy/tests/cli_test.py | |
parent | fef1092cdb5a28d8d39eff94dbbd0dd187a16971 (diff) | |
parent | 63c002a51ff072c911d3b89296b627b16983f5a0 (diff) |
Merge "Remove legacy code from stable branch" into stable/danube
Diffstat (limited to 'legacy/tests/cli_test.py')
-rw-r--r-- | legacy/tests/cli_test.py | 52 |
1 files changed, 0 insertions, 52 deletions
diff --git a/legacy/tests/cli_test.py b/legacy/tests/cli_test.py deleted file mode 100644 index 5b7eac65..00000000 --- a/legacy/tests/cli_test.py +++ /dev/null @@ -1,52 +0,0 @@ -############################################################################## -# Copyright (c) 2017 ZTE Corporation and others. -# -# All rights reserved. This program and the accompanying materials -# are made available under the terms of the Apache License, Version 2.0 -# which accompanies this distribution, and is available at -# http://www.apache.org/licenses/LICENSE-2.0 -############################################################################## -import pytest -import mock -import os -from qtip.utils.cli import Cli -from os.path import expanduser - - -@pytest.mark.skip("TODO(yujunz) recover test after refactoring") -class TestClass: - @pytest.mark.parametrize("test_input, expected", [ - (['-l', - 'zte', - '-f', - 'compute'], "You have specified a lab that is not present under benchmarks/testplan"), - (['-l', - 'default', - '-f', - 'test'], "This suite file test doesn't exist under benchmarks/suite/") - ]) - def test_cli_error(self, capfd, test_input, expected): - k = mock.patch.dict(os.environ, {'INSTALLER_TYPE': 'fuel', 'PWD': '/home'}) - with pytest.raises(SystemExit): - k.start() - Cli(test_input) - k.stop() - with open(expanduser('~') + "/qtip/logs/cli.log", "r") as file: - data = file.read() - assert expected in data - - @pytest.mark.parametrize("test_input, expected", [ - (['-l', - 'default', - '-f', - 'storage'], [('fuel', '/home', 'benchmarks/testplan/default/storage/fio_bm.yaml'), - ('fuel', '/home', 'benchmarks/testplan/default/storage/fio_vm.yaml')]) - ]) - @mock.patch('qtip.utils.cli.args_handler.prepare_and_run_benchmark') - def test_cli_successful(self, mock_args_handler, test_input, expected): - k = mock.patch.dict(os.environ, {'INSTALLER_TYPE': 'fuel', 'PWD': '/home'}) - k.start() - Cli(test_input) - k.stop() - call_list = map(lambda x: mock_args_handler.call_args_list[x][0], range(len(expected))) - assert sorted(call_list) == sorted(expected) |