From b82052c8c00ba54f03c0f23a10a18c787946ffc1 Mon Sep 17 00:00:00 2001 From: Taseer Date: Fri, 2 Jun 2017 15:18:56 +0500 Subject: Pass on unhandled options. - More robust testing Change-Id: Iaef21e9e244e1b5112ea5faa630e04424dc0b264 Signed-off-by: Taseer Ahmed --- tests/unit/cli/cmd_project_test.py | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) (limited to 'tests/unit') diff --git a/tests/unit/cli/cmd_project_test.py b/tests/unit/cli/cmd_project_test.py index 8b9216fa..102e9ed7 100644 --- a/tests/unit/cli/cmd_project_test.py +++ b/tests/unit/cli/cmd_project_test.py @@ -20,18 +20,36 @@ def runner(): def test_run(mocker, runner): + mocker.patch('os.system') + runner.invoke(cli, ['run']) + os.system.assert_called_once_with('ansible-playbook run.yml') + + +def test_run_verbose(mocker, runner): mocker.patch('os.system') runner.invoke(cli, ['run', '-vvv']) os.system.assert_called_once_with('ansible-playbook run.yml -vvv') def test_setup(mocker, runner): + mocker.patch('os.system') + runner.invoke(cli, ['setup']) + os.system.assert_called_once_with('ansible-playbook setup.yml') + + +def test_setup_verbose(mocker, runner): mocker.patch('os.system') runner.invoke(cli, ['setup', '-vvv']) os.system.assert_called_once_with('ansible-playbook setup.yml -vvv') def test_teardown(mocker, runner): + mocker.patch('os.system') + runner.invoke(cli, ['teardown']) + os.system.assert_called_once_with('ansible-playbook teardown.yml') + + +def test_teardown_verbose(mocker, runner): mocker.patch('os.system') runner.invoke(cli, ['teardown', '-vvv']) os.system.assert_called_once_with('ansible-playbook teardown.yml -vvv') -- cgit 1.2.3-korg