Skip to content

Commit 2aed673

Browse files
committed
Add test_tuple_argument
1 parent ab18a4c commit 2aed673

File tree

1 file changed

+36
-0
lines changed

1 file changed

+36
-0
lines changed

tests/dev/test_tuple_argument.py

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
import json
2+
3+
from devtools import debug
4+
from pydantic import validate_call
5+
6+
from fractal_tasks_core.dev.lib_args_schemas import (
7+
create_schema_for_single_task,
8+
)
9+
10+
11+
@validate_call
12+
def task_function(arg_A: tuple[int, int] = (1, 1)):
13+
"""
14+
Short task description
15+
16+
Args:
17+
arg_A: Description of arg_A.
18+
"""
19+
pass
20+
21+
22+
def test_tuple_argument():
23+
"""
24+
This test only asserts that `create_schema_for_single_task` runs
25+
successfully. Its goal is also to offer a quick way to experiment
26+
with new task arguments and play with the generated JSON Schema,
27+
without re-building the whole fractal-tasks-core manifest.
28+
"""
29+
schema = create_schema_for_single_task(
30+
task_function=task_function,
31+
executable=__file__,
32+
package=None,
33+
verbose=True,
34+
)
35+
debug(schema)
36+
print(json.dumps(schema, indent=2))

0 commit comments

Comments
 (0)