Add multi selecto to SelectionAction and SelectFileAction, Allow IOActions to receive no input, Rename subpackage falyx.parsers -> falyx.parser, Add default_text to UserInputAction
This commit is contained in:
@ -38,13 +38,14 @@ async def test_action_async_callable():
|
||||
action = Action("test_action", async_callable)
|
||||
result = await action()
|
||||
assert result == "Hello, World!"
|
||||
print(action)
|
||||
assert (
|
||||
str(action)
|
||||
== "Action(name='test_action', action=async_callable, args=(), kwargs={}, retry=False)"
|
||||
== "Action(name='test_action', action=async_callable, retry=False, rollback=False)"
|
||||
)
|
||||
assert (
|
||||
repr(action)
|
||||
== "Action(name='test_action', action=async_callable, args=(), kwargs={}, retry=False)"
|
||||
== "Action(name='test_action', action=async_callable, retry=False, rollback=False)"
|
||||
)
|
||||
|
||||
|
||||
|
@ -50,9 +50,10 @@ def test_command_str():
|
||||
"""Test if Command string representation is correct."""
|
||||
action = Action("test_action", dummy_action)
|
||||
cmd = Command(key="TEST", description="Test Command", action=action)
|
||||
print(cmd)
|
||||
assert (
|
||||
str(cmd)
|
||||
== "Command(key='TEST', description='Test Command' action='Action(name='test_action', action=dummy_action, args=(), kwargs={}, retry=False)')"
|
||||
== "Command(key='TEST', description='Test Command' action='Action(name='test_action', action=dummy_action, retry=False, rollback=False)')"
|
||||
)
|
||||
|
||||
|
||||
|
@ -1,7 +1,7 @@
|
||||
import pytest
|
||||
|
||||
from falyx.exceptions import CommandArgumentError
|
||||
from falyx.parsers import ArgumentAction, CommandArgumentParser
|
||||
from falyx.parser import ArgumentAction, CommandArgumentParser
|
||||
from falyx.signals import HelpSignal
|
||||
|
||||
|
||||
|
@ -2,7 +2,7 @@ import pytest
|
||||
|
||||
from falyx.action import Action, SelectionAction
|
||||
from falyx.exceptions import CommandArgumentError
|
||||
from falyx.parsers import ArgumentAction, CommandArgumentParser
|
||||
from falyx.parser import ArgumentAction, CommandArgumentParser
|
||||
|
||||
|
||||
def test_add_argument():
|
||||
|
@ -1,6 +1,6 @@
|
||||
import pytest
|
||||
|
||||
from falyx.parsers import Argument, ArgumentAction
|
||||
from falyx.parser import Argument, ArgumentAction
|
||||
|
||||
|
||||
def test_positional_text_with_choices():
|
||||
|
@ -1,4 +1,4 @@
|
||||
from falyx.parsers import ArgumentAction
|
||||
from falyx.parser import ArgumentAction
|
||||
|
||||
|
||||
def test_argument_action():
|
||||
|
@ -1,7 +1,7 @@
|
||||
import pytest
|
||||
|
||||
from falyx.exceptions import CommandArgumentError
|
||||
from falyx.parsers import CommandArgumentParser
|
||||
from falyx.parser import CommandArgumentParser
|
||||
|
||||
|
||||
def test_str():
|
||||
|
@ -5,7 +5,7 @@ from typing import Literal
|
||||
|
||||
import pytest
|
||||
|
||||
from falyx.parsers.utils import coerce_value
|
||||
from falyx.parser.utils import coerce_value
|
||||
|
||||
|
||||
# --- Tests ---
|
||||
|
@ -1,7 +1,7 @@
|
||||
import pytest
|
||||
|
||||
from falyx.exceptions import CommandArgumentError
|
||||
from falyx.parsers import ArgumentAction, CommandArgumentParser
|
||||
from falyx.parser import ArgumentAction, CommandArgumentParser
|
||||
|
||||
|
||||
@pytest.mark.asyncio
|
||||
|
@ -1,7 +1,7 @@
|
||||
import pytest
|
||||
|
||||
from falyx.exceptions import CommandArgumentError
|
||||
from falyx.parsers import ArgumentAction, CommandArgumentParser
|
||||
from falyx.parser import ArgumentAction, CommandArgumentParser
|
||||
|
||||
|
||||
@pytest.mark.asyncio
|
||||
|
Reference in New Issue
Block a user