@@ -690,6 +690,38 @@ async def test_update_with_request_id(self, client: Client) -> None:
690690 body = mock .call_args .kwargs .get ("json" ) or mock .call_args [1 ].get ("json" )
691691 assert body ["request_id" ] == "req-123"
692692
693+ @pytest .mark .asyncio
694+ async def test_update_request_matches_polyglot_fixture (self , client : Client ) -> None :
695+ fixture_path = Path (__file__ ).parent / "fixtures" / "control-plane" / "workflow-update-parity.json"
696+ fixture = json .loads (fixture_path .read_text ())
697+ sdk = fixture ["sdk_python" ]
698+ expected = sdk ["expected_body" ]
699+ envelope_contract = sdk ["payload_envelope" ]
700+
701+ resp = _mock_response (200 , {"outcome" : "update_completed" , "result" : {"quota" : 50 }})
702+
703+ with patch .object (client ._http , "request" , new_callable = AsyncMock , return_value = resp ) as mock :
704+ result = await client .update_workflow (** sdk ["args" ])
705+
706+ assert result ["outcome" ] == "update_completed"
707+
708+ call_args = mock .call_args
709+ assert call_args .args [0 ] == fixture ["request" ]["method" ]
710+ assert call_args .args [1 ] == f"/api{ fixture ['request' ]['path' ]} "
711+ body = call_args .kwargs .get ("json" ) or call_args [1 ].get ("json" )
712+
713+ for field , value in expected .items ():
714+ assert body [field ] == value
715+
716+ envelope = body [envelope_contract ["field" ]]
717+ assert envelope ["codec" ] == envelope_contract ["codec" ]
718+ assert serializer .decode (envelope ["blob" ], codec = envelope ["codec" ]) == envelope_contract ["decoded" ]
719+
720+ semantic = fixture ["semantic_body" ]
721+ assert sdk ["args" ]["workflow_id" ] == semantic ["workflow_id" ]
722+ assert sdk ["args" ]["update_name" ] == semantic ["update_name" ]
723+ assert sdk ["args" ]["wait_for" ] == semantic ["wait_for" ]
724+
693725
694726class TestGetResult :
695727 @pytest .mark .asyncio
0 commit comments