feat(core): advance options/state handling and workflow execution integration
- extend OptionsManager to support multi-namespace option resolution and toggling - integrate OptionsManager more deeply across Action, ChainedAction, and ActionGroup - propagate shared runtime configuration through execution layers - refine action composition model (sequential + parallel execution semantics) - improve lifecycle consistency across BaseAction, Action, ChainedAction, and ActionGroup - begin aligning execution flow with centralized context and options handling wip: routing and root option parsing behavior still in progress
This commit is contained in:
@@ -2,6 +2,7 @@ import pytest
|
||||
|
||||
from falyx.exceptions import CommandArgumentError
|
||||
from falyx.parser.command_argument_parser import CommandArgumentParser
|
||||
from falyx.parser.parser_types import TLDRExample
|
||||
|
||||
|
||||
@pytest.mark.asyncio
|
||||
@@ -45,3 +46,27 @@ async def test_add_tldr_examples_in_init():
|
||||
assert parser._tldr_examples[0].description == "This is the first example."
|
||||
assert parser._tldr_examples[1].usage == "example2"
|
||||
assert parser._tldr_examples[1].description == "This is the second example."
|
||||
|
||||
|
||||
def test_add_tldr_example():
|
||||
parser = CommandArgumentParser()
|
||||
parser.add_tldr_example("example1", "This is the first example.")
|
||||
assert len(parser._tldr_examples) == 1
|
||||
assert parser._tldr_examples[0].usage == "example1"
|
||||
assert parser._tldr_examples[0].description == "This is the first example."
|
||||
|
||||
|
||||
def test_add_tldr_example_bad_args():
|
||||
parser = CommandArgumentParser()
|
||||
with pytest.raises(TypeError):
|
||||
parser.add_tldr_example("example1", "This is the first example.", "extra_arg")
|
||||
|
||||
|
||||
def test_add_tldr_examples_with_tldr_example_objects():
|
||||
parser = CommandArgumentParser()
|
||||
example1 = TLDRExample(usage="example1", description="This is the first example.")
|
||||
example2 = TLDRExample(usage="example2", description="This is the second example.")
|
||||
parser.add_tldr_examples([example1, example2])
|
||||
assert len(parser._tldr_examples) == 2
|
||||
assert parser._tldr_examples[0] == example1
|
||||
assert parser._tldr_examples[1] == example2
|
||||
|
||||
Reference in New Issue
Block a user