diff --git a/src/cotea_internal_error_case.py b/src/cotea_internal_error_case.py index e495dc4..fd55350 100644 --- a/src/cotea_internal_error_case.py +++ b/src/cotea_internal_error_case.py @@ -10,6 +10,25 @@ def tearDown(self) -> None: # to clear previous execution context remove_modules_from_imported(module_name_like="cotea") + def test_incorrect_playbook_bin_path(self): + from cotea.runner import runner + from cotea.arguments_maker import argument_maker + + pb_path = "cotea_run_files/ok.yaml" + inv_path = "cotea_run_files/inv" + ansible_pb_bin = "/path/to/.venv/bin/ansible-playbook" + + arg_maker = argument_maker() + arg_maker.add_arg("-i", inv_path) + + try: + runner(pb_path, arg_maker, show_progress_bar=True, ansible_pb_bin=ansible_pb_bin) + except Exception as e: + self.assertTrue(str(e) == f"Ansible playbook bin {ansible_pb_bin} not found", + msg="Unexpected exception message") + else: + self.assertFalse(True, msg="Ansible is supposed to fail due to incorrect ansible playbook bin path") + def test_incorrect_playbook_path_case(self): from cotea.runner import runner from cotea.arguments_maker import argument_maker