From 9d06da582b104b1cfa7d891b65d8090333b33663 Mon Sep 17 00:00:00 2001 From: jafermarq Date: Thu, 14 Aug 2025 20:59:57 +0100 Subject: [PATCH] init --- .../clientappio/clientappio_servicer_test.py | 17 ++++++++++++----- 1 file changed, 12 insertions(+), 5 deletions(-) diff --git a/framework/py/flwr/supernode/servicer/clientappio/clientappio_servicer_test.py b/framework/py/flwr/supernode/servicer/clientappio/clientappio_servicer_test.py index 279862fd5f78..eea44b278037 100644 --- a/framework/py/flwr/supernode/servicer/clientappio/clientappio_servicer_test.py +++ b/framework/py/flwr/supernode/servicer/clientappio/clientappio_servicer_test.py @@ -35,6 +35,7 @@ ) from flwr.proto.message_pb2 import Context as ProtoContext # pylint:disable=E0611 from flwr.proto.message_pb2 import ( # pylint:disable=E0611 + PullObjectRequest, PullObjectResponse, PushObjectRequest, PushObjectResponse, @@ -80,12 +81,18 @@ def test_pull_clientapp_inputs(self) -> None: # Create series of responses for PullObject # Adding responses for objects in a post-order traversal of object tree order all_objects = get_all_nested_objects(mock_message) - self.mock_stub.PullObject.side_effect = [ - PullObjectResponse( - object_found=True, object_available=True, object_content=obj.deflate() + all_objects[mock_message.object_id] = mock_message + + # Get the object tree and iterate in the correct order + def pull_object_side_effect(request: PullObjectRequest) -> PullObjectResponse: + obj_id = request.object_id + return PullObjectResponse( + object_found=True, + object_available=True, + object_content=all_objects[obj_id].deflate(), ) - for obj in all_objects.values() - ] + + self.mock_stub.PullObject.side_effect = pull_object_side_effect self.mock_stub.PullClientAppInputs.return_value = mock_response # Execute