Skip to content

Commit 53b8c33

Browse files
committed
Add more misc standard lib types to test
1 parent 8448d3a commit 53b8c33

File tree

3 files changed

+47
-4
lines changed

3 files changed

+47
-4
lines changed

tests/contrib/pydantic/activities.py

Lines changed: 18 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,22 @@ async def pydantic_objects_activity(
1515

1616
@activity.defn
1717
async def misc_objects_activity(
18-
models: tuple[datetime, UUID],
19-
) -> tuple[datetime, UUID]:
18+
models: tuple[
19+
int,
20+
str,
21+
dict[str, float],
22+
list[dict[str, float]],
23+
tuple[dict[str, float]],
24+
datetime,
25+
UUID,
26+
],
27+
) -> tuple[
28+
int,
29+
str,
30+
dict[str, float],
31+
list[dict[str, float]],
32+
tuple[dict[str, float]],
33+
datetime,
34+
UUID,
35+
]:
2036
return models

tests/contrib/pydantic/test_pydantic.py

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -82,7 +82,15 @@ async def test_round_trip_misc_objects(client: Client):
8282
client = Client(**new_config)
8383
task_queue_name = str(uuid.uuid4())
8484

85-
orig_objects = (datetime(2025, 1, 2, 3, 4, 5), uuid.uuid4())
85+
orig_objects = (
86+
7,
87+
"7",
88+
{"7": 7.0},
89+
[{"7": 7.0}],
90+
({"7": 7.0},),
91+
datetime(2025, 1, 2, 3, 4, 5),
92+
uuid.uuid4(),
93+
)
8694

8795
async with Worker(
8896
client,

tests/contrib/pydantic/workflows.py

Lines changed: 20 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,26 @@ async def run(self, objects: List[PydanticModels]) -> List[PydanticModels]:
5656
@workflow.defn
5757
class RoundTripMiscObjectsWorkflow:
5858
@workflow.run
59-
async def run(self, objects: tuple[datetime, UUID]) -> tuple[datetime, UUID]:
59+
async def run(
60+
self,
61+
objects: tuple[
62+
int,
63+
str,
64+
dict[str, float],
65+
list[dict[str, float]],
66+
tuple[dict[str, float]],
67+
datetime,
68+
UUID,
69+
],
70+
) -> tuple[
71+
int,
72+
str,
73+
dict[str, float],
74+
list[dict[str, float]],
75+
tuple[dict[str, float]],
76+
datetime,
77+
UUID,
78+
]:
6079
return await workflow.execute_activity(
6180
misc_objects_activity,
6281
objects,

0 commit comments

Comments
 (0)