Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[CLIENT-3118] Fix failing tests when running against server 7.2 #671

Merged
merged 3 commits into from
Sep 16, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 5 additions & 2 deletions test/new_tests/test_index.py
Original file line number Diff line number Diff line change
Expand Up @@ -245,11 +245,14 @@ def test_create_string_index_with_correct_parameters_ns_length_extra(self):
ns_name = "a" * 50
policy = {}

with pytest.raises(e.InvalidRequest) as err_info:
with pytest.raises((e.InvalidRequest, e.NamespaceNotFound)) as err_info:
self.as_connection.index_string_create(ns_name, "demo", "name", "name_index", policy)

err_code = err_info.value.code
assert err_code is AerospikeStatus.AEROSPIKE_ERR_REQUEST_INVALID
if (TestBaseClass.major_ver, TestBaseClass.minor_ver) >= (7, 2):
assert err_code is AerospikeStatus.AEROSPIKE_ERR_NAMESPACE_NOT_FOUND
else:
assert err_code is AerospikeStatus.AEROSPIKE_ERR_REQUEST_INVALID

def test_create_string_index_with_incorrect_namespace(self):
"""
Expand Down
9 changes: 6 additions & 3 deletions test/new_tests/test_mapkeys_index.py
Original file line number Diff line number Diff line change
Expand Up @@ -121,16 +121,19 @@ def test_mapkeysindex_with_correct_parameters_string_on_numerickeys(self):
),
ids=("ns too long", "set too long", "bin too long", "index name too long"),
)
def test_mapkeys_with_parameters_too_long(self, ns, test_set, test_bin, index_name):
def test_mapkeys_with_parameters_too_long(self, ns, test_set, test_bin, index_name, request):
# Invoke index_map_keys_create() with correct arguments and set
# length extra
policy = {}

with pytest.raises(e.InvalidRequest) as err_info:
with pytest.raises((e.InvalidRequest, e.NamespaceNotFound)) as err_info:
self.as_connection.index_map_keys_create(ns, test_set, test_bin, aerospike.INDEX_STRING, index_name, policy)

err_code = err_info.value.code
assert err_code == AerospikeStatus.AEROSPIKE_ERR_REQUEST_INVALID
if request.node.callspec.id == "ns too long" and (TestBaseClass.major_ver, TestBaseClass.minor_ver) >= (7, 2):
assert err_code is AerospikeStatus.AEROSPIKE_ERR_NAMESPACE_NOT_FOUND
else:
assert err_code is AerospikeStatus.AEROSPIKE_ERR_REQUEST_INVALID

def test_mapkeysindex_with_incorrect_namespace(self):
"""
Expand Down
Loading