From 95a5a3fda698661a2a0527ccec7a8e1970f965e7 Mon Sep 17 00:00:00 2001 From: anastasia prasolova Date: Mon, 25 Apr 2022 13:34:33 +0300 Subject: [PATCH] fixed Link Object Header decoding in complex_object_operations.robot Signed-off-by: anastasia prasolova --- robot/resources/lib/python/json_transformers.py | 10 ++++++++-- .../lib/robot/complex_object_operations.robot | 6 +++--- 2 files changed, 11 insertions(+), 5 deletions(-) diff --git a/robot/resources/lib/python/json_transformers.py b/robot/resources/lib/python/json_transformers.py index b389553..6bfa079 100644 --- a/robot/resources/lib/python/json_transformers.py +++ b/robot/resources/lib/python/json_transformers.py @@ -42,8 +42,14 @@ def decode_split_header(data: dict): ''' try: data["splitId"] = json_reencode(data["splitId"]) - data["lastPart"] = json_reencode(data["lastPart"]["value"]) - data["link"] = json_reencode(data["link"]["value"]) + data["lastPart"] = ( + json_reencode(data["lastPart"]["value"]) + if data["lastPart"] else None + ) + data["link"] = ( + json_reencode(data["link"]["value"]) + if data["link"] else None + ) except Exception as exc: raise ValueError(f"failed to decode JSON output: {exc}") from exc diff --git a/robot/resources/lib/robot/complex_object_operations.robot b/robot/resources/lib/robot/complex_object_operations.robot index 51bd753..2ee4a76 100644 --- a/robot/resources/lib/robot/complex_object_operations.robot +++ b/robot/resources/lib/robot/complex_object_operations.robot @@ -2,7 +2,7 @@ Variables common.py Library neofs_verbs.py -Library complex_object_operations.py +Library complex_object_actions.py *** Keywords *** @@ -14,7 +14,7 @@ Get Object Parts By Link Object [Arguments] ${WIF} ${CID} ${LARGE_OID} - &{RESPONSE} = Get Link Object ${WIF} ${CID} ${LARGE_OID} - &{LINK_HEADER} = Head Object ${WIF} ${CID} ${RESPONSE.link} is_raw=True + ${LINK_OID} = Get Link Object ${WIF} ${CID} ${LARGE_OID} + &{LINK_HEADER} = Head Object ${WIF} ${CID} ${LINK_OID} is_raw=True [Return] ${LINK_HEADER.header.split.children}