diff --git a/tests/unit/action/conftest.py b/tests/unit/action/conftest.py index a664eee6..459d28b2 100644 --- a/tests/unit/action/conftest.py +++ b/tests/unit/action/conftest.py @@ -17,6 +17,7 @@ def base_metadata(): ) +# TODO : Seems like asyncio.Queue() in a fixture is causing test failure @pytest.fixture def base_control(): return Control( diff --git a/tests/unit/action/test_controller.py b/tests/unit/action/test_controller.py index 5ba46db3..d06869bf 100644 --- a/tests/unit/action/test_controller.py +++ b/tests/unit/action/test_controller.py @@ -1,5 +1,8 @@ +import asyncio + import pytest +from ansible_rulebook.action.control import Control from ansible_rulebook.action.run_job_template import RunJobTemplate from ansible_rulebook.action.run_workflow_template import RunWorkflowTemplate @@ -30,7 +33,7 @@ ) @pytest.mark.asyncio async def test_controller_custom_host_limit( - input, expected, template_class, base_metadata, base_control + input, expected, template_class, base_metadata ): """Test controller templates process the host limit in job_args.""" action_args = { @@ -42,5 +45,12 @@ async def test_controller_custom_host_limit( "set_facts": True, "job_args": input, } + base_control = Control( + queue=asyncio.Queue(), + inventory="abc", + hosts=["all"], + variables={"a": 1}, + project_data_file="", + ) template = template_class(base_metadata, base_control, **action_args) assert template.job_args["limit"] == expected