Skip to content

Commit 3104185

Browse files
committed
Test
1 parent 8de758c commit 3104185

File tree

1 file changed

+11
-1
lines changed

1 file changed

+11
-1
lines changed

tests/test_serialization_context.py

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -62,16 +62,25 @@ def with_context(
6262
return converter
6363

6464
def to_payload(self, value: Any) -> Optional[Payload]:
65+
print(
66+
f"🌈 SerializationContextTestEncodingPayloadConverter.to_payload({value})"
67+
)
6568
assert isinstance(value, TraceData)
6669
assert isinstance(self.context, WorkflowSerializationContext)
6770
value.items.append(
6871
TraceItem(
6972
context_type="workflow", method="to_payload", context=self.context
7073
)
7174
)
72-
return None
75+
payload = JSONPlainPayloadConverter().to_payload(value)
76+
assert payload
77+
payload.metadata["encoding"] = self.encoding.encode()
78+
return payload
7379

7480
def from_payload(self, payload: Payload, type_hint: Optional[Type] = None) -> Any:
81+
print(
82+
f"🌈 SerializationContextTestEncodingPayloadConverter.from_payload({payload}, {type_hint})"
83+
)
7584
value = JSONPlainPayloadConverter().from_payload(payload, type_hint)
7685
assert isinstance(value, TraceData)
7786
assert isinstance(self.context, WorkflowSerializationContext)
@@ -102,6 +111,7 @@ def __init__(self):
102111
async def test_workflow_payload_conversion_can_be_given_access_to_serialization_context(
103112
client: Client,
104113
):
114+
print()
105115
workflow_id = str(uuid.uuid4())
106116
task_queue = str(uuid.uuid4())
107117

0 commit comments

Comments
 (0)