Update expected errors

Signed-off-by: Andrey Berezin <a.berezin@yadro.com>
This commit is contained in:
Andrey Berezin 2023-01-23 13:24:41 +03:00 committed by abereziny
parent f23bfe754e
commit fc6f9ac162
2 changed files with 10 additions and 4 deletions

View file

@ -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

View file

@ -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,