Debian Codegraph @

tests/test_bind_kwargs.py

raw symbols SCIP
1 def test_kwargs_list_int(app, assert_parse_args):
2 @app.command
3 def foo(a: int, **kwargs: list[int]):
4 pass
5
6 assert_parse_args(foo, "foo 1 --bar=2 --baz=4 --bar 3", 1, bar=[2, 3], baz=[4])
7
8
9 def test_kwargs_int(app, assert_parse_args):
10 @app.command
11 def foo(a: int, **kwargs: int):
12 pass
13
14 assert_parse_args(foo, "foo 1 --bar=2 --baz 3", 1, bar=2, baz=3)
15 assert_parse_args(foo, "foo 1", 1)
16
17
18 def test_args_and_kwargs_int(app, assert_parse_args):
19 @app.command
20 def foo(a: int, *args: int, **kwargs: int):
21 pass
22
23 assert_parse_args(foo, "foo 1 2 3 4 5 --bar=2 --baz 3", 1, 2, 3, 4, 5, bar=2, baz=3)
24 assert_parse_args(foo, "foo 1", 1)