From fc6f9ac162ec81e8728bb3e014fbd5eaf5981db1 Mon Sep 17 00:00:00 2001 From: Andrey Berezin Date: Mon, 23 Jan 2023 13:24:41 +0300 Subject: [PATCH] Update expected errors Signed-off-by: Andrey Berezin --- pytest_tests/helpers/grpc_responses.py | 1 + .../test_static_object_session_token.py | 13 +++++++++---- 2 files changed, 10 insertions(+), 4 deletions(-) diff --git a/pytest_tests/helpers/grpc_responses.py b/pytest_tests/helpers/grpc_responses.py index 08c0a760..1e9fdc35 100644 --- a/pytest_tests/helpers/grpc_responses.py +++ b/pytest_tests/helpers/grpc_responses.py @@ -11,6 +11,7 @@ OBJECT_NOT_FOUND = "code = 2049.*message = object not found" OBJECT_ALREADY_REMOVED = "code = 2052.*message = object already removed" SESSION_NOT_FOUND = "code = 4096.*message = session token not found" OUT_OF_RANGE = "code = 2053.*message = out of range" +EXPIRED_SESSION_TOKEN = "code = 4097.*message = expired session token" # TODO: Due to https://github.com/nspcc-dev/neofs-node/issues/2092 we have to check only codes until fixed # OBJECT_IS_LOCKED = "code = 2050.*message = object is locked" # LOCK_NON_REGULAR_OBJECT = "code = 2051.*message = ..." will be available once 2092 is fixed diff --git a/pytest_tests/testsuites/session_token/test_static_object_session_token.py b/pytest_tests/testsuites/session_token/test_static_object_session_token.py index 9107b065..701ecbaf 100644 --- a/pytest_tests/testsuites/session_token/test_static_object_session_token.py +++ b/pytest_tests/testsuites/session_token/test_static_object_session_token.py @@ -6,7 +6,12 @@ from cluster import Cluster from cluster_test_base import ClusterTestBase from epoch import ensure_fresh_epoch from file_helper import generate_file -from grpc_responses import MALFORMED_REQUEST, OBJECT_ACCESS_DENIED, OBJECT_NOT_FOUND +from grpc_responses import ( + EXPIRED_SESSION_TOKEN, + MALFORMED_REQUEST, + OBJECT_ACCESS_DENIED, + OBJECT_NOT_FOUND, +) from neofs_testlib.shell import Shell from pytest import FixtureRequest from python_keywords.container import create_container @@ -516,7 +521,7 @@ class TestObjectStaticSession(ClusterTestBase): self.tick_epoch() - with pytest.raises(Exception, match=MALFORMED_REQUEST): + with pytest.raises(Exception, match=EXPIRED_SESSION_TOKEN): head_object( user_wallet.path, container, @@ -581,7 +586,7 @@ class TestObjectStaticSession(ClusterTestBase): ) self.tick_epoch() - with pytest.raises(Exception, match=MALFORMED_REQUEST): + with pytest.raises(Exception, match=EXPIRED_SESSION_TOKEN): head_object( user_wallet.path, container, @@ -625,7 +630,7 @@ class TestObjectStaticSession(ClusterTestBase): expiration, ) - with pytest.raises(Exception, match=MALFORMED_REQUEST): + with pytest.raises(Exception, match=EXPIRED_SESSION_TOKEN): head_object( user_wallet.path, container,