Skip to content

Commit

Permalink
Merge branch 'main' into AAP-15000_trim_docker_image
Browse files Browse the repository at this point in the history
  • Loading branch information
ttuffin authored Dec 8, 2023
2 parents ee36627 + 8743f53 commit 3dbdf77
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 1 deletion.
1 change: 1 addition & 0 deletions tests/unit/action/conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -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(
Expand Down
12 changes: 11 additions & 1 deletion tests/unit/action/test_controller.py
Original file line number Diff line number Diff line change
@@ -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

Expand Down Expand Up @@ -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 = {
Expand All @@ -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

0 comments on commit 3dbdf77

Please sign in to comment.