diff --git a/TP/NGSI-LD/DistributedOperations/Consumption/Entity/RetrieveEntity/D010_01_aux.robot b/TP/NGSI-LD/DistributedOperations/Consumption/Entity/RetrieveEntity/D010_01_aux.robot index 0922214d62c302271485458f460225b00c819b60..e5149d91c9b642170283c8bd2cfa6d7091d8258f 100644 --- a/TP/NGSI-LD/DistributedOperations/Consumption/Entity/RetrieveEntity/D010_01_aux.robot +++ b/TP/NGSI-LD/DistributedOperations/Consumption/Entity/RetrieveEntity/D010_01_aux.robot @@ -28,7 +28,13 @@ D010_01_aux Retrieve Entity That Exists On Both The Context Source And The Conte [Tags] since_v1.6.1 dist-ops 4_3_3 cf_06 additive-auxiliary 4_3_6_2 5_7_1 ${entity_body}= Load Entity ${entity_payload_filename} ${entity_id} ${entity_fragment}= Load JSON From File ${EXECDIR}/data/entities/fragmentEntities/${fragment_filename} - Set Stub Reply GET /ngsi-ld/v1/entities/${entity_id} 200 ${entity_body} + # `Load Entity` returns a Python dict; HttpCtrl's `Set Stub Reply` writes + # the body argument verbatim and does NOT auto-serialise non-string values + # (a dict passed straight in: `len(dict)` reports the key count for the + # Content-Length header, and `wfile.write(dict)` raises silently — the + # mock ends up sending headers only). Serialise to a JSON string first. + ${entity_body_json}= Evaluate json.dumps($entity_body) json + Set Stub Reply GET /ngsi-ld/v1/entities/${entity_id} 200 ${entity_body_json} ${response}= Retrieve Entity ${entity_id} context=${ngsild_test_suite_context} Check Response Status Code 200 ${response.status_code}