Add ProcessPoolAction, update CAP to look only at keywords correctly
This commit is contained in:
25
tests/test_actions/test_action_factory.py
Normal file
25
tests/test_actions/test_action_factory.py
Normal file
@ -0,0 +1,25 @@
|
||||
import pytest
|
||||
|
||||
from falyx.action import Action, ActionFactoryAction, ChainedAction
|
||||
|
||||
|
||||
def make_chain(value) -> ChainedAction:
|
||||
return ChainedAction(
|
||||
"test_chain",
|
||||
[
|
||||
Action("action1", lambda: value + "_1"),
|
||||
Action("action2", lambda: value + "_2"),
|
||||
],
|
||||
return_list=True,
|
||||
)
|
||||
|
||||
|
||||
@pytest.mark.asyncio
|
||||
async def test_action_factory_action():
|
||||
action = ActionFactoryAction(
|
||||
name="test_action", factory=make_chain, args=("test_value",)
|
||||
)
|
||||
|
||||
result = await action()
|
||||
|
||||
assert result == ["test_value_1", "test_value_2"]
|
Reference in New Issue
Block a user