diff options
author | Yujun Zhang <zhang.yujunz@zte.com.cn> | 2016-07-08 00:27:12 +0000 |
---|---|---|
committer | Gerrit Code Review <gerrit@172.30.200.206> | 2016-07-08 00:27:12 +0000 |
commit | 910362d520450f29d1ed3dcf49671a84dc1acf69 (patch) | |
tree | 056a818ab3e8d2a3178b161de4150621b55eed25 /tests/cli_test.py | |
parent | f2776c6c64b0a84df55edc1542dd6e67420d9076 (diff) | |
parent | 4c7387f811c01bd74b5ae6e0d0cca4bc98d298e8 (diff) |
Merge "Add some UT test cases and fix pep8 errors for cli and env_setup."
Diffstat (limited to 'tests/cli_test.py')
-rw-r--r-- | tests/cli_test.py | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/tests/cli_test.py b/tests/cli_test.py new file mode 100644 index 00000000..f12e8fed --- /dev/null +++ b/tests/cli_test.py @@ -0,0 +1,20 @@ +import pytest +from func.cli import cli + + +class TestClass: + @pytest.mark.parametrize("test_input, expected", [ + (['-l', + 'zte', + '-f', + 'compute'], "You have specified a lab that is not present in test_cases"), + (['-l', + 'zte-pod1', + '-f', + 'test'], "Test File Does not exist in test_list") + ]) + def test_cli_error(self, capfd, test_input, expected): + with pytest.raises(SystemExit): + cli(test_input) + resout, reserr = capfd.readouterr() + assert expected in resout |