From 3eadf934e095b8e3e21e110cbe43404212273dda Mon Sep 17 00:00:00 2001 From: anikeev-yadro Date: Tue, 11 Oct 2022 15:02:53 +0300 Subject: [PATCH] Fix decode_session_token after API was changed Signed-off-by: anikeev-yadro --- robot/resources/lib/python_keywords/json_transformers.py | 8 +++----- robot/resources/lib/python_keywords/tombstone.py | 5 ++--- 2 files changed, 5 insertions(+), 8 deletions(-) diff --git a/robot/resources/lib/python_keywords/json_transformers.py b/robot/resources/lib/python_keywords/json_transformers.py index 384aa5cb..c1554b3f 100644 --- a/robot/resources/lib/python_keywords/json_transformers.py +++ b/robot/resources/lib/python_keywords/json_transformers.py @@ -106,12 +106,10 @@ def decode_session_token(data: dict): This function reencodes a fragment of header which contains information about session token. """ - data["body"]["object"]["address"]["containerID"] = json_reencode( - data["body"]["object"]["address"]["containerID"]["value"] - ) - data["body"]["object"]["address"]["objectID"] = json_reencode( - data["body"]["object"]["address"]["objectID"]["value"] + data["body"]["object"]["target"]["container"] = json_reencode( + data["body"]["object"]["target"]["container"]["value"] ) + data["body"]["object"]["target"]["objects"] = [json_reencode(obj["value"]) for obj in data["body"]["object"]["target"]["objects"]] return data diff --git a/robot/resources/lib/python_keywords/tombstone.py b/robot/resources/lib/python_keywords/tombstone.py index 5e6027d1..f0fd762e 100644 --- a/robot/resources/lib/python_keywords/tombstone.py +++ b/robot/resources/lib/python_keywords/tombstone.py @@ -6,7 +6,6 @@ import allure import neofs_verbs from neo3 import wallet - @allure.step("Verify Head Tombstone") def verify_head_tombstone(wallet_path: str, cid: str, oid_ts: str, oid: str): header = neofs_verbs.head_object(wallet_path, cid, oid_ts) @@ -25,8 +24,8 @@ def verify_head_tombstone(wallet_path: str, cid: str, oid_ts: str, oid: str): header["sessionToken"]["body"]["object"]["verb"] == "DELETE" ), "Header Session Type isn't DELETE" assert ( - header["sessionToken"]["body"]["object"]["address"]["containerID"] == cid + header["sessionToken"]["body"]["object"]["target"]["container"] == cid ), "Header Session ID is wrong" assert ( - header["sessionToken"]["body"]["object"]["address"]["objectID"] == oid + header["sessionToken"]["body"]["object"]["target"]["objects"][0] == oid ), "Header Session OID is wrong"