Add falyx.console for single rich.console.Console instance, Add ConfirmAction, SaveFileAction, Add lazy evaluation for ArgumentAction.ACTION
This commit is contained in:
@ -23,3 +23,18 @@ async def test_multiple_positional_with_default():
|
||||
args = await parser.parse_args(["a", "b", "c"])
|
||||
assert args["files"] == ["a", "b", "c"]
|
||||
assert args["mode"] == "edit"
|
||||
|
||||
|
||||
@pytest.mark.asyncio
|
||||
async def test_multiple_positional_with_double_default():
|
||||
parser = CommandArgumentParser()
|
||||
parser.add_argument("files", nargs="+", default=["a", "b", "c"])
|
||||
parser.add_argument("mode", choices=["edit", "view"], default="edit")
|
||||
|
||||
args = await parser.parse_args()
|
||||
assert args["files"] == ["a", "b", "c"]
|
||||
assert args["mode"] == "edit"
|
||||
|
||||
args = await parser.parse_args(["a", "b"])
|
||||
assert args["files"] == ["a", "b"]
|
||||
assert args["mode"] == "edit"
|
||||
|
Reference in New Issue
Block a user