Fix decode_session_token after API was changed

Signed-off-by: anikeev-yadro <a.anikeev@yadro.com>
This commit is contained in:
anikeev-yadro 2022-10-11 15:02:53 +03:00 committed by anikeev-yadro
parent 5eeb8b4058
commit 3eadf934e0
2 changed files with 5 additions and 8 deletions

View file

@ -106,12 +106,10 @@ def decode_session_token(data: dict):
This function reencodes a fragment of header which contains This function reencodes a fragment of header which contains
information about session token. information about session token.
""" """
data["body"]["object"]["address"]["containerID"] = json_reencode( data["body"]["object"]["target"]["container"] = json_reencode(
data["body"]["object"]["address"]["containerID"]["value"] data["body"]["object"]["target"]["container"]["value"]
)
data["body"]["object"]["address"]["objectID"] = json_reencode(
data["body"]["object"]["address"]["objectID"]["value"]
) )
data["body"]["object"]["target"]["objects"] = [json_reencode(obj["value"]) for obj in data["body"]["object"]["target"]["objects"]]
return data return data

View file

@ -6,7 +6,6 @@ import allure
import neofs_verbs import neofs_verbs
from neo3 import wallet from neo3 import wallet
@allure.step("Verify Head Tombstone") @allure.step("Verify Head Tombstone")
def verify_head_tombstone(wallet_path: str, cid: str, oid_ts: str, oid: str): def verify_head_tombstone(wallet_path: str, cid: str, oid_ts: str, oid: str):
header = neofs_verbs.head_object(wallet_path, cid, oid_ts) 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["sessionToken"]["body"]["object"]["verb"] == "DELETE"
), "Header Session Type isn't DELETE" ), "Header Session Type isn't DELETE"
assert ( assert (
header["sessionToken"]["body"]["object"]["address"]["containerID"] == cid header["sessionToken"]["body"]["object"]["target"]["container"] == cid
), "Header Session ID is wrong" ), "Header Session ID is wrong"
assert ( assert (
header["sessionToken"]["body"]["object"]["address"]["objectID"] == oid header["sessionToken"]["body"]["object"]["target"]["objects"][0] == oid
), "Header Session OID is wrong" ), "Header Session OID is wrong"